Programming in HP PPL 525
FOR k FROM 1 TO ROLLS DO
roll:=ROLLDIE(SIDES)+ROLLDIE
(SIDES);
D2(roll-1):= D2(roll-1)+1;
END;
Xmin:= -0.1;
Xmax:= MAX(D1)+1;
Ymin:= −0.1;
Ymax:= MAX(D2)+1;
STARTVIEW(1,1);
END;
VIEW "Set Sides",SETSIDES()
BEGIN
REPEAT
INPUT(SIDES,"Die
Sides","N=","Enter# of sides",2);
SIDES:= FLOOR(SIDES);
IF SIDES<2 THEN
MSGBOX("# of sides must be >= 4");
END;
UNTIL SIDES >=4;
STARTVIEW(7,1);
END;
VIEW "Set Rolls",SETROLLS()
BEGIN
REPEAT
INPUT(ROLLS,"Num of
rolls","N=","Enter# of rolls",25);
ROLLS:= FLOOR(ROLLS);
IF ROLLS<1 THEN
MSGBOX("You must enter a num
>=1");
END;
UNTIL ROLLS>=1;
STARTVIEW(7,1);
END;
Plot()