The Museum of HP Calculators

HP Forum Archive 20

[ Return to Index | Top of Index ]

Re: a challenge related to the 15 puzzle
Message #1 Posted by Allen on 17 Jan 2011, 10:10 a.m.

Don, That's an interesting article. It reminds me very much of a Turing state machine, whereby the numbers in each grid become a GOTO instruction. It basically counts the number of closed GOTO loops in the grid- really interesting approach!

With one register in each variable, this would be interesting to do using indirect registers. Pseudo code for 41cv/42s:

0. Enter matrix in registers 1-15
1. Format Stack, clear parity flag
2. recall register 1
3. use  -1 STO* IND ST Y to mark the register "visited"
4. indirectly recall next memory location
5. If greater than 0 goto 3, 
6. starting from beginning of matrix find first number > 0
   if == 00 (register 16) goto 9
7. Toggle parity flag
8. goto 3
9. recall parity flag (done)

[ Return to Index | Top of Index ]

Go back to the main exhibit hall