This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Written by Assil Ksiksi | |
| # Date: Thursday, December 29th, 3:12 am (GMT +4) | |
| # I basically wrote this to determine whether or not a pattern exists in the products of the digits | |
| # of all 5-digit numbers. Sadly, none exist, or at least I didn't see one. | |
| # Runtime is fairly slow. It takes 1.05916786194s for all 5-digit numbers. I don't see how it | |
| # can be optimized, so that should do the trick. | |
| # References: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Written by: Assil Ksiksi | |
| # Date: Decemeber 28th, 2011 | |
| # A simple script that "slices" a Sudoku grid into 9 3x3 boxes. A similar method | |
| # may be included in my Sudoku solver to determine whether or not a number can | |
| # be placed in a certain cell. Should also be applicable to rows and columns. | |
| from random import seed, choice | |
| def create_grid(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def parse(grid): | |
| ''' Parses a Sudoku grid by converting it from xxx...x..xx....xx format to a friendly-looking grid. | |
| Sample input: ...5.14582.14.28.1.99128.9..2....992...536..89.8....7.....1..9.93.3.9..219.....7. | |
| Sample output: | |
| . . . | 5 . 1 | 4 5 8 | |
| 2 . 1 | 4 . 2 | 8 . 1 | |
| . 9 9 | 1 2 8 | . 9 . | |
| - - - - - - - - - - - |
NewerOlder