Hp Prime Graphing Wireless Calculator Manuel d'utilisateur Page 275

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 334
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 274
Programming in HP PPL 271
RECT();
xincr := (Xmax - Xmin)/318;
yincr := (Ymax - Ymin)/218;
FOR X FROM Xmin TO Xmax STEP xincr DO
FOR Y FROM Ymin TO Ymax STEP yincr DO
color := RGB(X^3 MOD 255,Y^3 MOD 255,
TAN(0.1*(X^3+Y^3)) MOD 255);
PIXON(X,Y,color);
END;
END;
WAIT;
END;
FOR DOWN Syntax: FOR var FROM start DOWNTO finish DO commands
END;
Sets variable var to start, and for as long as this variable
is more than or equal to finish, executes the sequence of
commands, and then subtracts 1 (decrement) from var.
FOR DOWN STEP Syntax: FOR var FROM start DOWNTO finish [STEP
increment] DO commands END;
Sets variable var to start, and for as long as this variable
is more than or equal to finish, executes the sequence of
commands, and then subtracts increment from var.
WHILE Syntax: WHILE test DO commands END;
Evaluates test. If result is true (not 0), executes the
commands, and repeats.
Example: A perfect number is one that is equal to the sum
of all its proper divisors. For example, 6 is a perfect
number because 6 = 1+2+3. The example below returns
true when its argument is a perfect number.
EXPORT ISPERFECT(n)
BEGIN
LOCAL d, sum;
2 d;
1 sum;
WHILE sum <= n AND d < n DO
IF irem(n,d)==0 THEN
sum+d sum;
Vue de la page 274
1 2 ... 270 271 272 273 274 275 276 277 278 279 280 ... 333 334

Commentaires sur ces manuels

Pas de commentaire