HP 39gII User Manual page 279

Graphing calculator
Hide thumbs Also See for 39gII:
Table of Contents

Advertisement

REPEAT...UNTIL...
WHILE...DO...END
Programming
EXPORT DRAWPATTERN()
BEGIN
LOCAL xinc,yinc,color;
STARTAPP("Function");
RECT();
xincr := (Xmax - Xmin)/254;
yincr := (Ymax - Ymin)/110;
FOR X FROM Xmin TO Xmax STEP xincr DO
FOR Y FROM Ymin TO Ymax STEP yincr DO
color := FLOOR(X^2+Y^2) MOD 4;
PIXON(X,Y,color);
END;
END;
FREEZE;
END;
Syntax: REPEAT commands UNTIL test;
Repeats the sequence of commands until test is true (non
0).
This code prompts for a positive value for SIDES,
modifying an earlier program in this chapter.
Example:
EXPORT SIDES;
EXPORT GETSIDES()
BEGIN
REPEAT
INPUT(SIDES,"Die Sides","N = ","Enter
num sides",2);
UNTIL SIDES>0;
END;
Syntax: WHILE test DO commands END;
269

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents