HP Forums

Full Version: Sudoku 50G
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

The topic "Sudoku solver" of Marcel Samek for the 33S & 15C ( bravo !), gave me the idea to see what is possible with a 50G

I found this program which seems perfect :

Sudoku solver HP50G

But it does not work with my calc. SLV result in nothing on the stack in place of the solution.

Is this a problem of ROM version or other ?

And of course there exists a Sudoku solver for the HP-48: SDK48 :-)

Very fast, solves nearly every solvable 9x9 sudoku within a few seconds, only 3.5KiB in size, will run on SX, too.

Hi Gilles.

I'm the author of the program. I just downloaded it again to make sure I can still run it. I'm using ROM 2.15.

Does it run if you use one of the provided puzzles? For excample, if you press EASY and then SLV?

How exactly are you running it?

Dave

Hi David

I tried with emu48, 2.09 ROM version

- I clic for example EASY

- The matrice is on the stack

- I clic SLV


-> I get no result at all (the initial matrice is dropped but no result appears)

I will try on my real calc 2.15

EDIT :it works fine with my real HP50G ROM 2.15 :D Less than 0.1 sec

Re-EDIT : LOL I just realise I'm stupid, it s an ARM prog so can't work with EMU48 !


Edited: 12 May 2012, 11:17 a.m.

Yes, the program is written in C and C++ and runs directly on the ARM CPU. I'm biased of course, but I think it demonstrates several things:

  • The raw speed of the ARM processor and the potential for very fast programs on the 50g.
  • The HPGCC compiler.
  • C++ with HPGCC.
  • The HPObjects library that lets C programs read and write calculator objects.
  • The sudoku solving algorithms are written to be fast, but also clear. The program demonstrates bit manipulations, a fast algorithm for counting the bits in a word, recursion and several other programming concepts. Source code is included.
Dave

Very interesting !

The speed is really impressive

Quote:
only 3.5KiB in size

For your entertainment, here's a 77-byte Sudoku solver in GolfScript:

{9/[n]*puts}:p;~]{:@0?:^~!{@p}*10,@9/^9/=-@^9%>9%-@3/^9%3/>3%3/^27/={+}*-{@^<\+@1^+>+}/1}do

http://www.golfscript.com/golfscript/examples.html

(note the comment claiming "lots of room for improvement")


Edited: 15 May 2012, 3:32 a.m.