Programming 525
The program
DICESIMVARS
EXPORT ROLLS,SIDES;
EXPORT DICESIMVARS()
BEGIN
10
ROLLS;
6 SIDES;
END;
Press
V to see the
custom app menu. Here
you can set the number
of sides of the dice, the
number of rolls, and
execute a simulation.
After running a
simulation, press
P to
see a histogram of your simulation results.
Program commands
This section describes each program command. The
commands under the menu are described first. The
commands under the menu are described in
“Commands under the Cmds menu” on page 531.
Commands under the Tmplt menu
Block
The block commands determine the beginning and end of
a sub-routine or function. There is also a Return
command to recall results from sub-routines or functions.
BEGIN END Syntax: BEGIN stmt1;stm2;…stmtN; END;
Defines a command or set of commands to be executed
together. In the simple program:
EXPORT SQM1(X)
BEGIN
RETURN X^2-1;
END;
the block is the single RETURN command.