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:

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...
modified the hp39gii to run two batteries in series NiMh gives 2.4v and 2 in paralell, it works fine except for normal alkaline batteries 3v is a bit too much wont switch on, screen contrast is better...
Very Happy im happy with it ... sorry about double posting .. i'll get used to it... i cant delete it .. the option has gone ...
Moderation note: Please stop double-posting. You've been asked about that before. If less than 24 hours have passed since your last post and no one has replied, please edit your previous post instead of posting again.

Also, please make sure that the topic you're posting in is actually relevant to the post you're adding. Your first post is about some command, and your second post is about batteries.
Regarding DIMGROB, DIMGROB uses graph coordinates while DIMGROB_P uses pixel coordinates. Maybe this could be your problem?

However, the data is different for the 39gII IIRC. Sprites are made of numbers from 0 to 3 for each pixel. Also I often heard that DIMGROB/DIMGROB_P was buggy on 39gII hardware, to the point it was non-functional, but I don't know if that's accurate or not.

About the batteries, the HP 39gII can run off 1 AAA battery (I tried). But I bet it drains it very fast.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement