HP Forums
Sudoku editor/Solver - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: HP Prime Software Library (/forum-15.html)
+--- Thread: Sudoku editor/Solver (/thread-2537.html)

Pages: 1 2


RE: Sudoku editor/Solver - lenborje - 12-20-2016 07:37 PM

Ooo... nice! Christmas comes early this year! :-D


RE: Sudoku editor/Solver - lenborje - 12-21-2016 02:57 PM

(12-20-2016 04:11 PM)Guenter Schink Wrote:  I see. The Sudoku_temp.txt is a version that has the proposed changes. I'll delete the file once you were able to do the corrections yourself. Not necessary to have various versions floating around.

Your version works in my HW Prime, but not in the latest Emulator. I believe there's been some changes in how lists are handled. I really wish it was easier to debug on the prime...

I shall have to compare runs on my HW Prime and the Emulator to pin down what's different.


RE: Sudoku editor/Solver - Guenter Schink - 12-21-2016 04:25 PM

(12-21-2016 02:57 PM)lenborje Wrote:  Your version works in my HW Prime, but not in the latest Emulator. I believe there's been some changes in how lists are handled. I really wish it was easier to debug on the prime...

I shall have to compare runs on my HW Prime and the Emulator to pin down what's different.

Hmm! Are you sure your emulator is firmware 11226 date: 2016-12-08? The program I posted runs fine with this firmware. Actually I used the emulator to find the error.

Debugging of course is cumbersome at times.

Here is how I found the glitch
  1. load program into the emulator
  2. copy the source code to Notepad++
  3. push "check" in the emulator
  4. see "error in line xxx"
  5. look in Notepad++, what's going on at that line number
  6. analyse what may be wrong
  7. type "Union" into the Home screen and push "help"
  8. find it is a built in function
  9. do the necessary corrections
  10. start over with the next error "DoSolve"


I know that Notepad++ is not available for Mac. But all you need is an editor that handles the various text codes (e.g. UTF-8) automatically and provides line numbers. You'll find something suitable when searching the web with "Notepad++ Mac"

Hope this helps, Günter


RE: Sudoku editor/Solver - lenborje - 12-21-2016 04:42 PM

(12-21-2016 04:25 PM)Guenter Schink Wrote:  Hmm! Are you sure your emulator is firmware 11226 date: 2016-12-08? The program I posted runs fine with this firmware. Actually I used the emulator to find the error.

It is the very same version.


RE: Sudoku editor/Solver - Guenter Schink - 12-21-2016 05:02 PM

(12-21-2016 04:42 PM)lenborje Wrote:  
(12-21-2016 04:25 PM)Guenter Schink Wrote:  Hmm! Are you sure your emulator is firmware 11226 date: 2016-12-08? The program I posted runs fine with this firmware. Actually I used the emulator to find the error.

It is the very same version.

That's strange. I just downloaded the Sudoku_temp.zip and pasted the text file into the emulator. No errors no problem! Same on three of my Android devices with various Android versions.

Perhaps you could try to uninstall the emulator, get another copy downloaded and install it again.

I don't have a real clue what could be wrong.

Günter


RE: Sudoku editor/Solver - lenborje - 12-22-2016 08:57 AM

I've upgraded my HW Prime, and the Sudoku program works very well on it.

But there's some really strange weirdness in my emulator. The built-in functions "head" and "tail" does not seem to work when the parameter is a local variable.

E.g.
Code:
RETURN head({17, 4711, 42});
returns 17, but

Code:
LOCAL elm={17, 4711, 42};
RETURN head(elm);

returns the variable itself, "elm".

Calling head on global variables works OK, e.g.
Code:
L0:={17,47111,42};
RETURN head(L0);

returns 17 as expected.


I'm going to report this on the emulator/CK thread.