-
-
Save nextacademy-private/d889f107d1d34b5b8d44 to your computer and use it in GitHub Desktop.
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
| 096040001100060004504810390007950043030080000405023018010630059059070830003590007 | |
| 302609005500730000000000900000940000000000109000057060008500006000000003019082040 | |
| 000075400000000008080190000300001060000000034000068170204000603900000020530200000 | |
| 300000000050703008000028070700000043000000000003904105400300800100040000968000200 | |
| 290500007700000400004738012902003064800050070500067200309004005000080700087005109 | |
| 080020000040500320020309046600090004000640501134050700360004002407230600000700450 | |
| 608730000200000460000064820080005701900618004031000080860200039050000100100456200 | |
| 370000001000700005408061090000010000050090460086002030000000000694005203800149500 | |
| 030500804504200010008009000790806103000005400050000007800000702000704600610300500 | |
| 000689100800000029150000008403000050200005000090240801084700910500000060060410000 |
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
| class Sudoku | |
| def initialize(board_string) | |
| end | |
| def solve! | |
| end | |
| # Returns a string representing the current state of the board | |
| # Don't spend too much time on this method; flag someone from staff | |
| # if you are. | |
| def board | |
| end | |
| end | |
| # The file has newlines at the end of each line, so we call | |
| # String#chomp to remove them. | |
| board_string = File.readlines('sample.unsolved.txt').first.chomp | |
| game = Sudoku.new(board_string) | |
| # Remember: this will just fill out what it can and not "guess" | |
| game.solve! | |
| puts game.board |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment