Maze generation: Difference between revisions

m
No edit summary
Line 4,195:
Here we have positive steps so we can translate nicely from Basic without the use of the switch.
 
Also there is another switch if we want a Dim a(10) to have 11 items, from 0 to 10. But here we set lower and upper index (we may use negative numbers too, when we use number to number for each dimension)
Variables with % in name as last character are like integers, but inside can be any numeric type, so width%=40 is internal a double, width$=40@ is internal a decimal. When we assign a number then this number rounded to integer, where w%=1.5 is 2 and w%=-1.5 is -2. If w%=1 then the statement w%/=2 not changed the w% (internal go to 0.5 so rounded to 1).
 
Line 4,205 ⟶ 4,206:
width% = 40
height% = 20
\\ we can use DIM maze$(0 to width%,0 to height%)="#"
\\ so we can delete the two For loops
DIM maze$(0 to width%,0 to height%)
FOR x% = 0 TO width%
Anonymous user