Program crashes G2
|
09-25-2019, 10:33 PM
Post: #1
|
|||
|
|||
Program crashes G2
I wrote the following program for the HHC programming contest. I didn't submit it because it frequently (but not always) crashed my Prime G2. I just verified that it crashes the virtual calculator also.
If I debug the program, press STEP a few times and CONT, it will run until the last statement (RETURN L1 and pause there. Pressing STEP causes it to crash. Both the physical and virtual calcs are running the 20181016 version. I tried reformatting the C drive on the physical calculator but that didn't help. Any thoughts? The program finds 3-digit numbers that are equal to the sum of the cubes of their digits. Thanks, Dave Code: EXPORT CUBES() |
|||
09-25-2019, 11:15 PM
Post: #2
|
|||
|
|||
RE: Program crashes G2
(09-25-2019 10:33 PM)David Hayden Wrote: I wrote the following program for the HHC programming contest. I didn't submit it because it frequently (but not always) crashed my Prime G2. I just verified that it crashes the virtual calculator also. Tried it on XCas. It crashes too. My guess the problem is this line Code: LOCAL L1 := {}; On XCas, it seems impossible to create an empty list. So, I go around the bug, and set L1 = [0] XCas> CUBES() → [0,153,370,371,407] |
|||
09-26-2019, 02:18 AM
(This post was last modified: 09-26-2019 02:21 AM by Gene222.)
Post: #3
|
|||
|
|||
RE: Program crashes G2
(09-25-2019 11:15 PM)Albert Chan Wrote: My guess the problem is this line The program works on my Prime version A in both Home and CAS. Haden might want to step through the program with debug and watch variables L1, X, Y, and Z to confirm L1 is not being defined on the G2. Maybe it is related to the problems with BREAK. |
|||
09-26-2019, 07:00 AM
(This post was last modified: 09-27-2019 04:40 AM by toml_12953.)
Post: #4
|
|||
|
|||
RE: Program crashes G2
(09-25-2019 10:33 PM)David Hayden Wrote: If I debug the program, press STEP a few times and CONT, it will run until the last statement (RETURN L1 and pause there. Pressing STEP causes it to crash. I press STEP a few times then CONT and my G2 doesn't halt on the RETURN L1. It just displays the list and ends. Tom L Cui bono? |
|||
09-26-2019, 11:36 AM
Post: #5
|
|||
|
|||
RE: Program crashes G2
Albert Chan Wrote:My guess the problem is this lineThanks Albert. WHen I change {} to {0} it runs fine. Curiously, if I change it back to {} and then back to {0} again, it crashes. Perhaps running it with {} corrupts something. But then again, it was crashing in earlier versions that PRINTed the results to the terminal instead of putting them in a list. Gene222 Wrote:Maybe it is related to the problems with BREAKI wasn't aware of BREAK problems. Stranger and stranger! |
|||
09-26-2019, 01:18 PM
Post: #6
|
|||
|
|||
RE: Program crashes G2
(09-26-2019 11:36 AM)David Hayden Wrote: I wasn't aware of BREAK problems. Stranger and stranger! There was a thread about it a while back: https://hpmuseum.org/forum/thread-13566.html There are only 10 types of people in this world. Those who understand binary and those who don't. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)