0 Members and 1 Guest are viewing this topic.
TEST1()BEGIN X:=RANDINT(1,3); RETURN PIECEWISE(X==1,3,X==2,2,1);END;TEST2()BEGIN X:=RANDINT(1,3); IF X==1 THEN RETURN 3; ELSE IF X==2 THEN RETURN 2; ELSE RETURN 1; END; END;END;TEST3()BEGIN X:=RANDINT(1,3); RETURN IFTE(X==1,3,IFTE(X==2,2,3));END;
TEST1()BEGIN X:=RANDINT(1,2); RETURN PIECEWISE(X==1,3,4);END;TEST2()BEGIN X:=RANDINT(1,2); IF X==1 THEN RETURN 3; ELSE RETURN 4; END;END;TEST3()BEGIN X:=RANDINT(1,2); RETURN IFTE(X==1,3,4);END;
FF(X)BEGIN RETURN X;END;TEST1()BEGIN MAKELIST(FF(I),I,1,1000);END;TEST2()BEGIN FOR I FROM 1 TO 1000 DO FF(I); END;END;
FF(X)BEGIN RETURN X;END;TEST1()BEGIN MAKELIST(FF(I),I,1000,1,-1);END;TEST2()BEGIN FOR I FROM 1000 DOWNTO 1 DO FF(I); END;END;
FF(X)BEGIN RETURN X;END;TEST1()BEGIN MAKELIST(FF(I),I,1,2000,2);END;TEST2()BEGIN FOR I FROM 1 TO 2000 STEP 2 DO FF(I); END;END;
SS:="1234567890";TT:={48,49,50,51,52,53,54,55,56,57,58};MM:=[[48,49,50,51,52,53,54,55,56,57,58]];TEST1()BEGIN RETURN SS[3];END;TEST2()BEGIN RETURN TT[3];END;TEST3()BEGIN RETURN MM[1,3];END;
TT:={{1,2,3},{4,5,6}};MM:=[[1,2,3],[4,5,6]];TEST1()BEGIN RETURN TT[1,2];END;TEST2()BEGIN RETURN MM[1,2];END;
TT:={{{1,1},{2,2}},{{3,3},{4,4}}};MM:=[[(1,1),(2,2)],[(3,3),(4,4)]];TEST1()BEGIN RETURN TT[1,2,1];END;TEST2()BEGIN RETURN IM(MM[1,2]);END;
TT=MAKELIST(MAKELIST(#0,Y,1,100),X,1,100);TTT=MAKELIST(MAKELIST(0,Y,1,100),X,1,100);EXPORT TST()BEGIN GETPIX_P(G1,10,10);END;EXPORT TST2()BEGIN TT[10,10];END;EXPORT TST3()BEGIN TTT[10,10];END;ONCOMPILE()BEGIN DIMGROB_P(G1,100,100);END;lol_hax=ONCOMPILE();
TT=MAKELIST(49,X,1,10000);TTT=ΣLIST(MAKELIST("1",X,1,10000));EXPORT TST()BEGIN TT[9999];END;EXPORT TST2()BEGIN TTT[9999];END;
TT=MAKELIST(MAKELIST(Y,Y,1,100),X,1,100);MM=MAKEMAT(I+J,100,100);EXPORT TST()BEGIN TT[99,99]END;EXPORT TST2()BEGIN MM[99,99]END;EXPORT TST3()BEGINEND;
TT=MAKELIST(49,X,1,1000);EXPORT TTT=ΣLIST(MAKELIST("1",X,1,1000));EXPORT TST()BEGIN TT[999]:=5326;END;EXPORT TST2()BEGIN TTT[999]:=5326;END;
EXPORT TST()BEGIN ΣLIST(MAKELIST("1",X,1,100));END;EXPORT TST2()BEGIN CHAR(MAKELIST(49,X,1,100));END;
FF()BEGINEND;EXPORT TST()BEGIN MAKELIST(FF(),X,1,1000);END;EXPORT TST2()BEGIN ITERATE(FF(),X,1,1000);END;EXPORT TST3()BEGIN FOR I FROM 1 TO 1000 DO FF(); END;END;
FF(X)BEGIN RETURN X+1;END;EXPORT TST()BEGIN MAKELIST(FF(X),X,1,1000);END;EXPORT TST2()BEGIN ITERATE(FF(X),X,1,1000);END;EXPORT TST3()BEGIN FOR I FROM 1 TO 1000 DO FF(I); END;END;
(If this test was done with a ClassPad II, I would be 65 years old and retired by the time it's finished. )Thanks a lot for this post by the way. THis might be pretty handy because sometimes we might need the fastest possible speed, but not be aware of what is actually faster. It sucks to have to rewrite most of the code after discovering we could have done it faster in certain ways >.<
Also, speed was a major concern for me regarding tilemapping because I was not sure if I should use lists, matrices, strings or images. I am not surprised that strings are slower, though, because on the TI models they were much slower than lists (in fact, the farther a character was in a string, the slower it was to read it, so inside a 2000 bytes large string, reading map data at the beginning was about 3 times faster than at the end). For data storage and reading, could you test how fast/slow it is with Pixel-test commands? Using such data would make it much easier to design tilemap data, but if the speed loss is considerable, then it might not be worth it.
Quote from: DJ Omnimaga on October 08, 2014, 05:54:56 pm(If this test was done with a ClassPad II, I would be 65 years old and retired by the time it's finished. )Thanks a lot for this post by the way. THis might be pretty handy because sometimes we might need the fastest possible speed, but not be aware of what is actually faster. It sucks to have to rewrite most of the code after discovering we could have done it faster in certain ways >.<Yeah, I know what you mean. Looking back at HP Tetris, I realize that representing the grid with a complex matrix was a bad idea. Quote from: DJ Omnimaga on October 08, 2014, 05:54:56 pmAlso, speed was a major concern for me regarding tilemapping because I was not sure if I should use lists, matrices, strings or images. I am not surprised that strings are slower, though, because on the TI models they were much slower than lists (in fact, the farther a character was in a string, the slower it was to read it, so inside a 2000 bytes large string, reading map data at the beginning was about 3 times faster than at the end). For data storage and reading, could you test how fast/slow it is with Pixel-test commands? Using such data would make it much easier to design tilemap data, but if the speed loss is considerable, then it might not be worth it.Do you mean testing list access vs. pixel access? If that's what you mean, sure! Im going to guess that lists are faster, but who knows! This is why I'm testing.
Quote from: iconmaster on October 08, 2014, 09:35:25 pmQuote from: DJ Omnimaga on October 08, 2014, 05:54:56 pm(If this test was done with a ClassPad II, I would be 65 years old and retired by the time it's finished. )Thanks a lot for this post by the way. THis might be pretty handy because sometimes we might need the fastest possible speed, but not be aware of what is actually faster. It sucks to have to rewrite most of the code after discovering we could have done it faster in certain ways >.<Yeah, I know what you mean. Looking back at HP Tetris, I realize that representing the grid with a complex matrix was a bad idea. Quote from: DJ Omnimaga on October 08, 2014, 05:54:56 pmAlso, speed was a major concern for me regarding tilemapping because I was not sure if I should use lists, matrices, strings or images. I am not surprised that strings are slower, though, because on the TI models they were much slower than lists (in fact, the farther a character was in a string, the slower it was to read it, so inside a 2000 bytes large string, reading map data at the beginning was about 3 times faster than at the end). For data storage and reading, could you test how fast/slow it is with Pixel-test commands? Using such data would make it much easier to design tilemap data, but if the speed loss is considerable, then it might not be worth it.Do you mean testing list access vs. pixel access? If that's what you mean, sure! Im going to guess that lists are faster, but who knows! This is why I'm testing.Yeah that's what I mean. Some TI-84+ programmers use pictures to store map data, but on the HP Prime it's even more convenient in the way that pixel-test can actually detect which color the pixel is, while on the color 84+ it only detects if the pixel is transparent or not.
What do you mean? Are lists and matrices limited to a max amount of elements (eg on the 84+ it was 999 and on the 82 it was 99) or do you refer to how much larger GROB data is?
TT=MAKELIST(MAKELIST(#0,Y,1,100),X,1,100);TTT=MAKELIST(MAKELIST(0,Y,1,100),X,1,100);EXPORT TST()BEGIN PIXON_P(G1,50,50,#0);END;EXPORT TST2()BEGIN TT[50,50]:=#0;END;EXPORT TST3()BEGIN TTT[50,50]:=0;END;ONCOMPILE()BEGIN DIMGROB_P(G1,100,100);END;lol_hax=ONCOMPILE;
On the other hand, if you try to store a picture-based map data with DIMGROB, then the result is atrociously large, since each pixel is like 64 bytes or so in unicode form (maybe more?). Size-wise, every other alternative is more viable, but again this calc has a lot of memory so that is not a big issue.