This file contains 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
#!/usr/bin/env python3 | |
# First install selenium: | |
# pip3 install selenium | |
# If you don't have pip, consult here: | |
# https://pip.pypa.io/en/stable/installing/ | |
# Install Google Chrome. | |
# Install ChromeWebdriver (and put it on your PATH environment variable): | |
# https://sites.google.com/a/chromium.org/chromedriver/downloads | |
# To use: | |
# Run "python3 crawl.py" |
This file contains 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
#!/usr/bin/env python3 | |
# By Philip Arthur | |
# This program is intended to solve sudoku problem with a complete search. | |
# It simulates human's way to solve sudoku problem with following steps: | |
# 1. Forward Inference: Try to look at every column, row, and box; if there is only 1 possible cell for a particular number, set it. | |
# 2. Invalidate board: For every number that is set, we need to remove the possibility of other cells being that number in the same row, column and box. | |
# 3. Assign value: if there is a cell contains only 1 possible number, set it. | |
# | |
# If solution is not found, then trial and error approach is done by greedy best first search with assigning some value to the cells with less candidates. | |
# |
This file contains 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
#!/usr/bin/python | |
import sys | |
import argparse | |
def main(): | |
for line in sys.stdin: | |
line = line.strip() | |
output = breduct(line) | |
print output |