All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Games
There is something missing (Posted on 2005-05-13) Difficulty: 3 of 5
This popular Japanese number puzzle has just one easy rule: In every Row, every Column and every 3x3 sub-grid, all the numbers from 1 to 9 should appear, but only once in each row, column and sub-grid.
+------+-------+------+
| 0 0 0 | 7 0 0 | 4 0 0 |
| 0 3 0 | 0 9 0 | 0 2 0 |
| 4 0 0 | 0 0 5 | 0 0 0 |
+------+-------+------+
| 0 0 8 | 0 0 0 | 0 0 5 |
| 0 9 0 | 0 3 0 | 0 7 0 |
| 6 0 0 | 0 0 0 | 3 0 0 |
+------+-------+------+
| 0 0 0 | 4 0 0 | 0 0 6 |
| 0 7 0 | 0 2 0 | 0 9 0 |
| 0 0 5 | 0 0 8 | 0 0 0 |
+------+-------+------+

Replace the 0's with the digits required to satisfy the rule.

See The Solution Submitted by Hugo    
Rating: 4.4000 (10 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Program execution in less than a minute | Comment 25 of 29 |
(In reply to re(3): Haley's Comet vrs. Penny's Loafer: And the winner is.... by Ken Haley)

Ken, did you mean to say that your program ran in 1 minute 3 seconds ? Because I don't see how it could have exhausted all the possibilities in 1.03 seconds.

I managed to get my program under a minute, by discarding any attempts at recursive logic (I got tired of seeing that "stack" error), and instead going after the 81 "cells" in an optimized "3 x 3 subgrid" order.

If the subgrids are:

A B C
D E F
G H I

...then going at them in order B-E-D-F-H-A-C-G-I (the idea being to vary the middle subgrid E, which only has one initial nonzero number, a relatively few times) is done by my program in less than one minute (1:40:43 - 1:41:25).

If anyone is interested, the modified program has been replaced in my original post titled "A popular game in my neighborhood..."

 

 

 


  Posted by Penny on 2005-05-18 19:53:41
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (7)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information