07-13-2011, 08:22 PM
Darkstar Wrote:Sorry for this mega-delay (I'm alive), but I've been *REALLY* busy (okay, I went to NY for two weeks, but had lot of stuff piled up upon return). I will check this ASAP.Code:' tn = TriangleNumber, mt = MaximumTriangles (# of), rn = RandomNumber, GraphicWidth, GraphicHeight, zn = ZeroNumber (Modifier) 'DIM udg(7) AS UBYTE => {0,1,3,7,15,31,63,127}
[...]
FirstPoint:
x(tn,4)=x(tn,2): y(tn,4)=y(tn,2): RETURN
This crashes after a few pixels drawn with an out of memory error while if you use float it works fine under
the latest version of the compiler. In version 1.2.6 uinteger works without a hitch. The compilation options are:
zxb Triangles.bas --optimize=2 --output=TRIANGLES.ASM --asm --org=24576 --array-base=1 --string-base=1 --heap-size=1024
zxbasm TRIANGLES.ASM --output=TRIANGLES --tap --BASIC --autorun
Quote:On to another subject, what is the correct syntax for "DIM udg(7) AS UBYTE => {0,1,3,7,15,31,63,127}"Use "vector inside vectors":
as a multidimensional array? I tried "DIM ma(2,2) AS UBYTE => {1,4,6,2,0,55}" but it did not work.
Code:
DIM ma(1 TO 2, 2) AS UBYTE => {{1, 4, 6}, {2, 0, 55}}
You can read more about it here: <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:DIM">http://www.boriel.com/wiki/en/index.php/ZX_BASIC:DIM</a><!-- m -->