Programming
251
The program
DiceSimulation
START()
BEGIN
DICESIMVARS();
// Empty data columns D1 and D2
{} D1;
{} D2;
SETSAMPLE(H1,D1);
SETFREQ(H1,D2);
0 H1Type;
END;
VIEWS “Roll Dice”,ROLLMANY()
BEGIN
LOCAL k,roll;
MAKELIST(X+1,X,1,2*SIDES-1,1) D1;
MAKELIST(0,X,1,2*SIDES-1,1) D2;
FOR k FROM 1 TO ROLLS DO
Roll:=ROLLDIE(SIDES)+ROLLDIES(SIDES);
D2(roll-1)+1 D2(roll-1);
END;
-1 Xmin;
MAX(D1)+1 Xmax;
0 Ymin;
MAX(D2)+1 Ymax;
STARTVIEW(1,1);
END;
VIEWS "Set Sides", SETSIDES()
BEGIN
REPEAT
INPUT(SIDES,"Die Sides","N = ","Enter num
sides",2);
FLOOR(SIDES) SIDES;
Summary of Contents for 39gII
Page 1: ...HP 39gII graphing calculator user s guide Edition1 Part Number NW249 90001 ...
Page 2: ...Printing History Edition 1 November 201 1 ...
Page 32: ...22 Getting started ...
Page 58: ...48 Apps and their views ...
Page 70: ...60 Function app ...
Page 80: ...70 Solve app ...
Page 136: ...126 Polar app ...
Page 140: ...130 Sequence app ...
Page 148: ...138 Finance app ...
Page 152: ...142 Linear Solver app ...
Page 218: ...208 Matrices ...
Page 226: ...216 Notes and Info ...
Page 238: ...228 Variables and memory management ...
Page 318: ...308 Programming ...
Page 340: ...330 Reference information ...
Page 346: ...vi Product Regulatory Information ...