Skip to content

Instantly share code, notes, and snippets.

View michaelarnauts's full-sized avatar

Michaël Arnauts michaelarnauts

View GitHub Profile
@adrian17
adrian17 / kakuro.py
Created February 23, 2015 14:40
Kakuro solver in Python
import itertools
from copy import deepcopy
def possible_combinations(values, n, total):
# generate all combinations of given values with given sum
return [combination for combination in itertools.combinations(values, n) if sum(combination) == total]
def make_aval(board, clues):
"""
Generates a set of all digits you can use in each cell, just like you do in sudoku board