- hp39gii dimgrob, grob editor created.
- 06 Dec 2016 07:36:37 am
- Last edited by ScottZilogZ80fan on 08 Dec 2016 09:34:20 am; edited 4 times in total
Im having problems with dimgrob(G1,list)
How do i define a block say 8*8 ive entered many different parameters
And failed... i know about dimgrob(G1,x,y,c) i have the prime grob Creator,
But it doesn't work on hp39gii... i think you are correct about dimgrob not working on the hp39gii...
i've been writing some more programs, if you copy and paste them to your calculator, you may find the ► character needs to be deleted and retyped, due to a translation error.
Code:
that program defines and draws a tile of blocks, it defines its own block,
the next program just tiles a user defined block stored in M2,
Code:
If you get an error run the top program to create M2.
this next program is GrobEd, a 16x16 grayscale block editor, create your own block,
and then run Tile() to view it,
Code:
use cursor keys and number keys 0,1,2,3 for different greys...
feel free to use any of this code, i dont mind...
to insert a matrix into a program go to the home screen type M2 press enter, press shift-copy, then copy the current edited line and then paste it into your program...
How do i define a block say 8*8 ive entered many different parameters
And failed... i know about dimgrob(G1,x,y,c) i have the prime grob Creator,
But it doesn't work on hp39gii... i think you are correct about dimgrob not working on the hp39gii...
i've been writing some more programs, if you copy and paste them to your calculator, you may find the ► character needs to be deleted and retyped, due to a translation error.
Code:
EXPORT Tile()
BEGIN
[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3],[0,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3],[0,3,0,0,0,0,0,0,0,0,0,0,0,3,0,3],[0,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3],[0,3,0,0,3,0,3,0,3,0,3,0,0,3,0,3],[0,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3],[0,3,0,0,3,0,3,0,3,0,3,0,0,3,0,3],[0,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3],[0,3,0,0,3,0,3,0,3,0,3,0,0,3,0,3],[0,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3],[0,3,0,0,3,0,3,0,3,0,3,0,0,3,0,3],[0,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3],[0,3,0,0,0,0,0,0,0,0,0,0,0,3,0,3],[0,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]]►M2;
RECT_P(3);
DIMGROB_P(G1,16,16,3);
FOR X FROM 1 TO 16 DO
FOR Y FROM 1 TO 16 DO
IFTE(M2[X,Y]<0 OR M2[X,Y]>3,3►M2[X,Y]);
PIXON_P(G1,X-1,Y-1,M2[X,Y]);
END;END;
FOR X FROM 0 TO 15 DO
FOR Y FROM 0 TO 7 DO
BLIT_P(G0,(X*16),(Y*16),(X*16)+16,(Y*16)+16,G1);
END;END;
FREEZE;
END;
that program defines and draws a tile of blocks, it defines its own block,
the next program just tiles a user defined block stored in M2,
Code:
EXPORT Tile()
BEGIN
RECT_P(3);
DIMGROB_P(G1,16,16,3);
FOR X FROM 1 TO 16 DO
FOR Y FROM 1 TO 16 DO
IFTE(M2[X,Y]<0 OR M2[X,Y]>3,3►M2[X,Y]);
PIXON_P(G1,X-1,Y-1,M2[X,Y]);
END;END;
FOR X FROM 0 TO 15 DO
FOR Y FROM 0 TO 7 DO
BLIT_P(G0,(X*16),(Y*16),(X*16)+16,(Y*16)+16,G1);
END;END;
FREEZE;
END;
If you get an error run the top program to create M2.
this next program is GrobEd, a 16x16 grayscale block editor, create your own block,
and then run Tile() to view it,
Code:
EXPORT GrobEd()
BEGIN
1►S;1►T;
RECT_P(3);
FOR X FROM 1 TO 16 DO
FOR Y FROM 1 TO 16 DO
IFTE(M2[X,Y]<0 OR M2[X,Y]>3,3►M2[X,Y]);
RECT_P(X*6,Y*6,(X*6)+5,(Y*6)+5,M2[X,Y]);
PIXON_P(G0,X+128,Y+16,M2[X,Y]);
END;END;
8►X;8►Y;
WHILE 1 DO
0►W;0►V;
IF ISKEYDOWN(9)==1 THEN 0►V;−1►W;END;
IF ISKEYDOWN(10)==1 THEN 0►W;1►V;END;
IF ISKEYDOWN(14)==1 THEN −1►V;0►W;END;
IF ISKEYDOWN(15)==1 THEN 1►W;0►V;END;
GETKEY►N;
X+V►X;Y+W►Y;
IFTE (X<1,1►X);
IFTE (X>16,16►X);
IFTE (Y<1,1►Y);
IFTE (Y>16,16►Y);
IF ISKEYDOWN(47)==1 THEN 0►M2[X,Y];END;
IF ISKEYDOWN(42)==1 THEN 1►M2[X,Y];END;
IF ISKEYDOWN(43)==1 THEN 2►M2[X,Y];END;
IF ISKEYDOWN(44)==1 THEN 3►M2[X,Y];END;
RECT_P(X*6,Y*6,(X*6)+5,(Y*6)+5,0);
WAIT(0.1);
IFTE(X≠S OR Y≠T,RECT_P(S*6,T*6,(S*6)+5,(T*6)+5,M2[S,T]));
PIXON_P(128+S,16+T,M2[S,T]);
X►S;Y►T;
END;
END;
use cursor keys and number keys 0,1,2,3 for different greys...
feel free to use any of this code, i dont mind...
to insert a matrix into a program go to the home screen type M2 press enter, press shift-copy, then copy the current edited line and then paste it into your program...