250
Programming
Each app has one program attached to it. Initially, this
program is empty. You customize the app by entering
functions into that program.
5. Edit the program
DiceSimulation
.
Select
DiceSimulation
It is here that you enter
functions to customize the
app. At this point, you
decide how you expect the
user to interact with the
app. In this case, we will
create views to do the following:
•
START
: start the app
•
SETSIDES
: specify the number of sides (faces) on
each die
•
SETNUMROLLS
: specify number of times to roll the
dice
•
RESET
: start over
The
START
option will initialize the app and display a
note embedded in the app containing instructions for the
user. The user will also interact with the app through the
Numeric view and the Plot view. These views will be
activated by pressing
M
and
P
, but the functions
Num
and
Plot
in our app program will actually launch
those views after doing some configuration.
Recall the program to get the number of sides for a die,
presented earlier in this chapter. It is expanded here, so
that the possible sums of two such dice are stored in the
list D1. Enter the following sub-routines into the app
program for the
DiceSimulation
app.
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 ...