The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
HP Prime: BLOTCH (Drawing Program)
04-20-2014, 03:41 PM
Post: #1
HP Prime: BLOTCH (Drawing Program)
Blotch Drawing Program

S = size of the square blotch
D = size of each box in the blotch. Each box is a randomized color.

To draw a square blotch, just touch the screen outside the menu.


Code:
 Program:
EXPORT BLOTCH( )
BEGIN
// EWS 04-20-2014

// Initialize
LOCAL m,m1,mx,my,j,k,r;
WHILE MOUSE(1)≥0 DO END;

// Clear Canvas
RECT;
LOCAL s:=50, d:=4;

// Menu - to be redrawn
DRAWMENU("Clear","S+5","S-5","D+2","D-2","Exit");

// Start main loop
REPEAT

// Get mouse data
REPEAT
m:=MOUSE; m1:=m(1);
UNTIL SIZE(m1)>0;
mx:=m1(1); my:=m1(2);

DRAWMENU("Clear","S+5","S-5","D+2","D-2","Exit");

// Clear Screen
IF (my≥220 AND my≤319) AND (mx≥0 AND mx≤51) THEN
RECT;
END;

// Change Size
IF (my≥220 AND my≤319) AND (mx≥53 AND mx≤104) THEN
IF s<80 THEN s:=s+5; END;
END;

IF (my≥220 AND my≤319) AND (mx≥106 AND mx≤157) THEN
IF s>5 THEN s:=s-5; END;
END;

// Change Depth
IF (my≥220 AND my≤319) AND (mx≥159 AND mx≤210) THEN
IF d<8 THEN d:=d+2; END;
END;

IF (my≥220 AND my≤319) AND (mx≥212 AND mx≤263) THEN
IF d>2 THEN d:=d-2; END;
END;

// Exit Key
IF (my≥220 AND my≤319) AND (mx≥256 AND mx≤319) THEN
BREAK;
END;

// Draw Blotch
FOR j FROM mx-s/2 TO mx+s/2 STEP d DO
FOR k FROM my-s/2 TO my+s/2 STEP d DO
r:=RANDINT(1677215);
RECT_P(j,k,j+d-1,k+d-1,r);
END; END;

// Close main loop
UNTIL (my≥220 AND my≤319) AND (mx≥256 AND mx≤319);

RECT_P(0,220,319,239);
TEXTOUT_P("DONE!",146,220,4,#FF0000h);
WAIT(-1);
END;
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP Prime: BLOTCH (Drawing Program) - Eddie W. Shore - 04-20-2014 03:41 PM



User(s) browsing this thread: 1 Guest(s)