Create a two-dimensional array at runtime: Difference between revisions
Create a two-dimensional array at runtime (view source)
Revision as of 19:29, 19 June 2020
, 3 years ago→{{header|Phixmonti}}
Line 1,727:
pstack /# show the content of the stack #/
( -1 -1 ) mget "Value of the last element of the last dimension: " print print drop
drop /# remove array/list from the stack #/
</lang>
With more syntactic sugar
<lang Phixmonti>include ..\Utilitys.pmt
"Enter height: " input tonum nl
"Enter width: " input tonum nl
0 swap repeat swap repeat /# create two dimensional array/list. All zeroes #/
99 ( -1 -1 ) sset /# set the last element o last dimension #/
pstack /# show the content of the stack #/
( -1 -1 ) sget "Value of the last element of the last dimension: " print print
drop /# remove array/list from the stack #/
</lang>
|