DiceSimulation
|
06-21-2017, 10:23 AM
Post: #1
|
|||
|
|||
DiceSimulation
I'am trying to understand how to create your own apps. I look at the DiceSimulation example but I do not get to let this work properly. I know that the H1Type command is no longer valid but I can't figure out how to use the alternative H1(#):=# Is there documentation available about this function?
Can someone give me advise please? Best regards, Pieter |
|||
01-19-2020, 07:39 PM
(This post was last modified: 01-20-2020 04:27 PM by Gene222.)
Post: #2
|
|||
|
|||
RE: DiceSimulation
This is a reply to a long dead post, but I was also struggling with the Dice Simulation Custom App example in the HP User Guide, 2017, page 621-627.
Both of the H1 variable definitions were missing a semi-colon at the end of the line. The function DICESIMVARS on page 626 is not used in the program and should be deleted. Also delete the DICESIMVARS function declaration at the beginning of the program. Insert the ROLLDIE function (page 623) at the end of the program. The histogram on page 627 is for 7 rolls of the dice. If you use 100 rolls as noted in the program, the histogram will be more shaped like a bell curve. A corrected program code is shown below. Annotations were added. Some minor changes to the program code were made for clarity. [1/20/2020 The program was revised to include the Info text. The program does not work quite well without the text. The Start function was moved out of the View (menu) functions, and the order of the remaining View functions were reorganized. These changes seem to make the program work as intended by the User Manual and as described in the Info instructions. The app files are attached in the following post.] PHP Code: // custom app examaple, dice simulation |
|||
01-19-2020, 08:49 PM
Post: #3
|
|||
|
|||
RE: DiceSimulation
Thanks for these corrections and sharing this here, this is useful for folks learning PPL programming.
However, it still gets a syntax error on the first H1 assignment, although that could be due to some obscure (as most are) setting. I simply copied the code above, pasted into the virtual Prime (running the latest 20200116 f/w) and hit Check. --Bob Prosperi |
|||
01-19-2020, 09:20 PM
(This post was last modified: 01-20-2020 04:26 PM by Gene222.)
Post: #4
|
|||
|
|||
RE: DiceSimulation
I ran the app on software version 2.1.14181 (2018 10 16) and hardware version A, although I ran the program on the virtual calculator. You have to create a copy of the 1 variable statistics app and copy the program to that app. Attached is the app file. {1/20/2020 The program was revised to include the Info text. The program does not work quite well without the text. The Start function was moved out of the View (menu) functions, and the order of the remaining View functions were reorganized. These changes seem to make the program work as intended by the User Manual and as described in the Info instructions.}
|
|||
01-20-2020, 02:00 AM
Post: #5
|
|||
|
|||
RE: DiceSimulation
Ahh, ok, thanks for explaining; I should have read the OP and the manual section more closely. I'll download the modified App and check it out this week.
Thanks. --Bob Prosperi |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)