예제 #1
0
파일: Solver.py 프로젝트: V-Neck/WordSearch
from WordSearch import WordSearch
alphabet = "ETAOINSRHDLUCMFYWGPBVKXQJZ"[::-1].lower()
clusters = ['bl', 'br', 'ch', 'cl', 'cr', 'dr', 'fl', 'fr', 'gl', 'gr', 'pl', 'pr', 'sc', 'sh', 'sk', 'sl', 'sm', 'sn', 'sp', 'st', 'sw', 'th', 'tr', 'tw', 'wh', 'wr', 'sch', 'scr', 'shr', 'sph', 'spl', 'spr', 'squ', 'str', 'thr']
cluster_1 = ['b','c','d','f','g','p','s','t','w']

def unique(seq):
    seen = set()
    seen_add = seen.add
    return [ x for x in seq if not (x in seen or seen_add(x))]

def pos(seq, n):
	return [x for x in seq if x[0] >= 0 and x[1] >= 0 and x[0] < n and x[1] < n]

n = 10
board = WordSearch(n,False)
board.fill(n)
board.print_board()

wordlist = [i.upper() for i in board.get_wordlist()]

for i in wordlist:
	print i,
print '\n'

#board length
bl = len(board.board)
# length of wordlist
wl = len(wordlist)
#first letters
fl = []
#first letter locations (row,col)
예제 #2
0
파일: game.py 프로젝트: V-Neck/TwitterWS
from WordSearch import WordSearch

board = WordSearch(5, True)
board.fill(10)
board.print_board()
print board.get_wordlist()