예제 #1
0
def gen_known_points_from_sample(sample):
    # def append_point(result,cur_point):
    #     row_index, col_index = cur_point
    #     value = sample[row_index][col_index]
    #     if value > 0:
    #         result.append(point.gen_point(row_index,col_index,value))
    #     return result
    # return reduce(append_point, gen_99(), [])
    return [point.gen_point(row_index,col_index,sample[row_index][col_index]) 
        for row_index, col_index in gen_99() 
        if sample[row_index][col_index] > 0]
예제 #2
0
파일: sudoku.py 프로젝트: RobLeggett/codes
	def append_number(result, cur_point):
		map(lambda name, index: result.update({(name, index):range(1,10)}),
			point.NAMES, point.gen_point(cur_point))
		return result
예제 #3
0
파일: sudoku.py 프로젝트: RobLeggett/codes
	def append_point(result,cur_point):
		row_index, col_index = cur_point
		value = sample[row_index][col_index]
		if value > 0:
			result.append(point.gen_point(row_index,col_index,value))
		return result