コード例 #1
0
def puzzle_gen():
    global table, WORDS
    WORDS = ['cat', 'bear', 'tiger', 'lion']
    table = [['0' for i in range(10)] for i in range(10)]
    result = create_panel(height=10, width=10, words_value_list=WORDS)

    display_panel(result.get('panel'))
    #convert into 2d array
    for i in range(0, 10):
        for j in range(0, 10):
            table[i][j] = result.get('panel').cells[i, j]
コード例 #2
0
def puzzle_gen():
    global words, table
    words = ['cat', 'bear', 'tiger', 'lion']
    table = [['0' for i in range(5)] for i in range(5)]
    result = create_panel(height=5, width=5, words_value_list=words)

    display_panel(result.get('panel'))
    #convert into 2d array
    for i in range(0, 5):
        for j in range(0, 5):
            table[i][j] = result.get('panel').cells[i, j]
コード例 #3
0
ファイル: SopaLetras.py プロジェクト: SBosq/SisDev
 def crear_sopa(self):
     words = [self.entry2.get(), self.entry3.get(), self.entry4.get(), self.entry5.get(), self.entry6.get()]
     ndim = int(self.entry1.get())
     result = create_panel(height=ndim, width=ndim, words_value_list=words)
     print(display_panel(result.get('panel')))
     self.S2.config(state=DISABLED)
コード例 #4
0
ファイル: main.py プロジェクト: pasure/AI_Assignment
import time

from word_search_puzzle.utils import display_panel
from word_search_puzzle.algorithms import create_panel

words = ['cat', 'dog', 'tiger', 'lion']

table = [['0' for i in range(10)] for i in range(10)]
result = create_panel(height=10, width=10, words_value_list=words)
position = ""
import math

# print('Attempts: {}'.format(result.get('attempts')))
# print('Solution took: {} ms'.format(result.get('elapsed_time')))
display_panel(result.get('panel'))
#print(result.get('panel').cells[0,0])
#print(type(result.get('panel')))

for i in range(0, 10):
    for j in range(0, 10):
        table[i][j] = result.get('panel').cells[i, j]


#
# #print(table[0][0])
# print()
def DFS(row, column, string):
    print("NorthEast:\n", end="")
    DFSsearch(row, column, string, 'NorthEast')
    print("East:\n", end="")
    DFSsearch(row, column, string, 'East')