-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuscas.py
1499 lines (1161 loc) · 46.6 KB
/
buscas.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
'''
*******************Developed by********************************
Alfredo Albélis Batista Filho - https://github.com/AlfredoFilho
Pedro Henrique Bernini Silva - https://github.com/PedroBernini
***************************************************************
'''
import tkinter as tk
from tkinter import messagebox
from Cats.Cat_aStar import aStar
from Cats.Cat_BestFirst import bestFirst
from Cats.Cat_DepthFirst import depthFirst
from Cats.Cat_BreadthFirstSearch import breadthFirstSearch
from GifMaker.GifShow import Gif
from threading import Thread
gato = []
saida = []
bloqueados = []
SELECTED = "GATO"
delayGif = 200
# Colors
backgroundColor = '#2C2F33'
backgroundTabuleiroColor = '#597e8d'
foregroundColor = 'white'
selectedColor = '#7289da'
unselectedColor = '#a1a1a3'
catSelectColor = 'orange'
blockSelectColor = 'red'
exitSelectColor = '#456fb2'
btnLimparColor = '#ff4646'
btnAlgorithmColor = '#43b581'
txtBtnColor = 'white'
catPositionColor = '#61b76b'
nodeOpenedColor = 'gray'
nodeClosedColor = 'black'
#ffe36c amarelo
#a1a1a3 cinza
#43b581 verde
#7289da azul
#faa61a laranja
# CONFIGURAÇÕES DA JANELA
root = tk.Tk()
root.geometry("1335x640+0+0")
root.resizable(0,0)
try:
root.tk.call('wm', 'iconphoto', root._w, tk.Image('photo', file='favicon.png'))
except:
print('Ícone não encontrado!')
root.title("Visualização de Buscas Cegas e Heurísticas - By Alfredo Albélis; Pedro Bernini. (2020)")
root.configure(background=backgroundColor)
w = 1335
h = 640
ws = root.winfo_screenwidth()
hs = root.winfo_screenheight()
x = (ws/2) - (w/2)
y = (hs/2) - (h/2)
root.geometry('+%d+%d' % (x, y))
class Animation(Thread):
def __init__ (self, algoritmo):
Thread.__init__(self)
self.algoritmo = algoritmo
def run(self):
gifWindow = tk.Toplevel()
gifWindow.resizable(0,0)
gifWindow.title("Aguarde")
w = 633
h = 545
ws = gifWindow.winfo_screenwidth()
hs = gifWindow.winfo_screenheight()
x = (ws/2) - (w/2)
y = (hs/2) - (h/2)
gifWindow.geometry('+%d+%d' % (x, y))
texto = tk.Label(gifWindow, font=("Helvetica", 12), text="Gerando animação, aguarde...")
texto.pack()
if self.algoritmo == 'breadthFirstSearch':
breadthFirstSearch(gato[0], saida[0], bloqueados)
gifWindow.title("Animação - Busca Cega: Amplitude")
gif = Gif(gifWindow, gif="Gifs/Gif_Amplitude.gif")
elif self.algoritmo == 'depthFirst':
depthFirst(gato[0], saida[0], bloqueados)
gifWindow.title("Animação - Busca Cega: Profundidade")
gif = Gif(gifWindow, gif="Gifs/Gif_Profundidade.gif")
elif self.algoritmo == 'bestFirst':
bestFirst(gato[0], saida[0], bloqueados)
gifWindow.title("Animação - Busca Heurística: Melhor-Primeiro")
gif = Gif(gifWindow, gif="Gifs/Gif_Melhor-Primeiro.gif")
elif self.algoritmo == 'aStar':
aStar(gato[0], saida[0], bloqueados)
gifWindow.title("Animação - Busca Heurística: A*")
gif = Gif(gifWindow, gif="Gifs/Gif_aStar.gif")
texto.destroy()
gif.pack()
gif.run(interval = delayGif, n_repeats=-1)
# CLASSE BOTÃO
class CustomButton(tk.Canvas) :
def __init__(self, parent, width, height, color, command = None, padding = 4):
tk.Canvas.__init__(self, parent, borderwidth = 0,
relief="raised", highlightthickness = 0)
self.command = command
self.padding = padding
self.create_oval((padding,padding,
width+padding, height+padding), outline="black", fill=color)
(x0,y0,x1,y1) = self.bbox("all")
width = (x1-x0) + padding
height = (y1-y0) + padding
self.configure(width=width, height = height)
self.bind("<ButtonPress-1>", self._on_press)
self.bind("<ButtonRelease-1>", self._on_release)
def paint(self, color) :
width,height = 35,35
padding = self.padding
self.configure(relief="raised")
self.create_oval((padding,padding,
width+padding, height+padding), outline="black", fill=color)
def _on_press(self, event) :
if SELECTED == "GATO" :
self.paint(catSelectColor)
elif SELECTED == "SAIDA" :
self.paint(exitSelectColor)
elif SELECTED == "BLOQUEIOS" :
self.paint(blockSelectColor)
def _on_release(self, event) :
self.configure(relief="raised")
if self.command is not None :
self.command()
# FUNÇÕES DE SELEÇÃO
def selectGato(casa, botao) :
if casa in bloqueados :
bloqueados.remove(casa)
if saida != [] and casa == saida[0] :
saida.clear()
if gato == [] :
gato.append(casa)
gato.append(botao)
else :
gato[0] = casa
gato[1].paint("white")
gato[1] = botao
gato[1].paint(catSelectColor)
def selectSaida(casa, botao) :
if casa in bloqueados :
bloqueados.remove(casa)
if gato != [] and casa == gato[0] :
gato.clear()
if saida == [] :
saida.append(casa)
saida.append(botao)
else :
saida[0] = casa
saida[1].paint("white")
saida[1] = botao
saida[1].paint(exitSelectColor)
def selectBloqueio(casa, botao) :
if gato != [] and casa == gato[0] :
gato.clear()
if saida != [] and casa == saida[0] :
saida.clear()
if casa not in bloqueados :
bloqueados.append(casa)
else :
bloqueados.remove(casa)
botao.paint("white")
def select(component) :
global SELECTED
global btnSelectGato
global btnSelectSaida
global btnSelectGato
if component == "GATO" :
SELECTED = "GATO"
btnSelectGato["bg"] = selectedColor
btnSelectSaida["bg"] = unselectedColor
btnSelectBloqueios["bg"] = unselectedColor
elif component == "SAIDA" :
SELECTED = "SAIDA"
btnSelectGato["bg"] = unselectedColor
btnSelectSaida["bg"] = selectedColor
btnSelectBloqueios["bg"] = unselectedColor
elif component == "BLOQUEIOS" :
SELECTED = "BLOQUEIOS"
btnSelectGato["bg"] = unselectedColor
btnSelectSaida["bg"] = unselectedColor
btnSelectBloqueios["bg"] = selectedColor
def btnSelectGato_click() :
select("GATO")
def btnSelectSaida_click() :
select("SAIDA")
def btnSelectBloqueios_click() :
select("BLOQUEIOS")
def btnLimpar() :
global gato
global saida
global bloqueados
gato = []
saida = []
bloqueados = []
#limpar botões acessando por string
for i in range(110):
if(i <= 10):
eval('btn0' + str(i) + '.paint("white")')
else:
if((i % 10 ) == 0):
eval('btn' + str(i-9) + '0.paint("white")')
eval('btn' + str(i) + '.paint("white")')
btn10.paint("white")
btn1010.paint("white")
# FUNCOES BOTÕES TABULEIRO
def selectCasa(casa, botao) :
global SELECTED
if SELECTED == "GATO" :
selectGato(casa, botao)
elif SELECTED == "SAIDA" :
selectSaida(casa, botao)
elif SELECTED == "BLOQUEIOS" :
selectBloqueio(casa, botao)
# LINHA 0
def btn00_click() :
selectCasa((0, 0), btn00)
def btn01_click() :
selectCasa((0, 1), btn01)
def btn02_click() :
selectCasa((0, 2), btn02)
def btn03_click() :
selectCasa((0, 3), btn03)
def btn04_click() :
selectCasa((0, 4), btn04)
def btn05_click() :
selectCasa((0, 5), btn05)
def btn06_click() :
selectCasa((0, 6), btn06)
def btn07_click() :
selectCasa((0, 7), btn07)
def btn08_click() :
selectCasa((0, 8), btn08)
def btn09_click() :
selectCasa((0, 9), btn09)
def btn010_click() :
selectCasa((0, 10), btn010)
# LINHA 1
def btn10_click() :
selectCasa((1, 0), btn10)
def btn11_click() :
selectCasa((1, 1), btn11)
def btn12_click() :
selectCasa((1, 2), btn12)
def btn13_click() :
selectCasa((1, 3), btn13)
def btn14_click() :
selectCasa((1, 4), btn14)
def btn15_click() :
selectCasa((1, 5), btn15)
def btn16_click() :
selectCasa((1, 6), btn16)
def btn17_click() :
selectCasa((1, 7), btn17)
def btn18_click() :
selectCasa((1, 8), btn18)
def btn19_click() :
selectCasa((1, 9), btn19)
def btn110_click() :
selectCasa((1, 10), btn110)
# LINHA 2
def btn20_click() :
selectCasa((2, 0), btn20)
def btn21_click() :
selectCasa((2, 1), btn21)
def btn22_click() :
selectCasa((2, 2), btn22)
def btn23_click() :
selectCasa((2, 3), btn23)
def btn24_click() :
selectCasa((2, 4), btn24)
def btn25_click() :
selectCasa((2, 5), btn25)
def btn26_click() :
selectCasa((2, 6), btn26)
def btn27_click() :
selectCasa((2, 7), btn27)
def btn28_click() :
selectCasa((2, 8), btn28)
def btn29_click() :
selectCasa((2, 9), btn29)
def btn210_click() :
selectCasa((2, 10), btn210)
# LINHA 3
def btn30_click() :
selectCasa((3, 0), btn30)
def btn31_click() :
selectCasa((3, 1), btn31)
def btn32_click() :
selectCasa((3, 2), btn32)
def btn33_click() :
selectCasa((3, 3), btn33)
def btn34_click() :
selectCasa((3, 4), btn34)
def btn35_click() :
selectCasa((3, 5), btn35)
def btn36_click() :
selectCasa((3, 6), btn36)
def btn37_click() :
selectCasa((3, 7), btn37)
def btn38_click() :
selectCasa((3, 8), btn38)
def btn39_click() :
selectCasa((3, 9), btn39)
def btn310_click() :
selectCasa((3, 10), btn310)
# LINHA 4
def btn40_click() :
selectCasa((4, 0), btn40)
def btn41_click() :
selectCasa((4, 1), btn41)
def btn42_click() :
selectCasa((4, 2), btn42)
def btn43_click() :
selectCasa((4, 3), btn43)
def btn44_click() :
selectCasa((4, 4), btn44)
def btn45_click() :
selectCasa((4, 5), btn45)
def btn46_click() :
selectCasa((4, 6), btn46)
def btn47_click() :
selectCasa((4, 7), btn47)
def btn48_click() :
selectCasa((4, 8), btn48)
def btn49_click() :
selectCasa((4, 9), btn49)
def btn410_click() :
selectCasa((4, 10), btn410)
# LINHA 5
def btn50_click() :
selectCasa((5, 0), btn50)
def btn51_click() :
selectCasa((5, 1), btn51)
def btn52_click() :
selectCasa((5, 2), btn52)
def btn53_click() :
selectCasa((5, 3), btn53)
def btn54_click() :
selectCasa((5, 4), btn54)
def btn55_click() :
selectCasa((5, 5), btn55)
def btn56_click() :
selectCasa((5, 6), btn56)
def btn57_click() :
selectCasa((5, 7), btn57)
def btn58_click() :
selectCasa((5, 8), btn58)
def btn59_click() :
selectCasa((5, 9), btn59)
def btn510_click() :
selectCasa((5, 10), btn510)
# LINHA 6
def btn60_click() :
selectCasa((6, 0), btn60)
def btn61_click() :
selectCasa((6, 1), btn61)
def btn62_click() :
selectCasa((6, 2), btn62)
def btn63_click() :
selectCasa((6, 3), btn63)
def btn64_click() :
selectCasa((6, 4), btn64)
def btn65_click() :
selectCasa((6, 5), btn65)
def btn66_click() :
selectCasa((6, 6), btn66)
def btn67_click() :
selectCasa((6, 7), btn67)
def btn68_click() :
selectCasa((6, 8), btn68)
def btn69_click() :
selectCasa((6, 9), btn69)
def btn610_click() :
selectCasa((6, 10), btn610)
# LINHA 7
def btn70_click() :
selectCasa((7, 0), btn70)
def btn71_click() :
selectCasa((7, 1), btn71)
def btn72_click() :
selectCasa((7, 2), btn72)
def btn73_click() :
selectCasa((7, 3), btn73)
def btn74_click() :
selectCasa((7, 4), btn74)
def btn75_click() :
selectCasa((7, 5), btn75)
def btn76_click() :
selectCasa((7, 6), btn76)
def btn77_click() :
selectCasa((7, 7), btn77)
def btn78_click() :
selectCasa((7, 8), btn78)
def btn79_click() :
selectCasa((7, 9), btn79)
def btn710_click() :
selectCasa((7, 10), btn710)
# LINHA 8
def btn80_click() :
selectCasa((8, 0), btn80)
def btn81_click() :
selectCasa((8, 1), btn81)
def btn82_click() :
selectCasa((8, 2), btn82)
def btn83_click() :
selectCasa((8, 3), btn83)
def btn84_click() :
selectCasa((8, 4), btn84)
def btn85_click() :
selectCasa((8, 5), btn85)
def btn86_click() :
selectCasa((8, 6), btn86)
def btn87_click() :
selectCasa((8, 7), btn87)
def btn88_click() :
selectCasa((8, 8), btn88)
def btn89_click() :
selectCasa((8, 9), btn89)
def btn810_click() :
selectCasa((8, 10), btn810)
# LINHA 9
def btn90_click() :
selectCasa((9, 0), btn90)
def btn91_click() :
selectCasa((9, 1), btn91)
def btn92_click() :
selectCasa((9, 2), btn92)
def btn93_click() :
selectCasa((9, 3), btn93)
def btn94_click() :
selectCasa((9, 4), btn94)
def btn95_click() :
selectCasa((9, 5), btn95)
def btn96_click() :
selectCasa((9, 6), btn96)
def btn97_click() :
selectCasa((9, 7), btn97)
def btn98_click() :
selectCasa((9, 8), btn98)
def btn99_click() :
selectCasa((9, 9), btn99)
def btn910_click() :
selectCasa((9, 10), btn910)
# LINHA 9
def btn100_click() :
selectCasa((10, 0), btn100)
def btn101_click() :
selectCasa((10, 1), btn101)
def btn102_click() :
selectCasa((10, 2), btn102)
def btn103_click() :
selectCasa((10, 3), btn103)
def btn104_click() :
selectCasa((10, 4), btn104)
def btn105_click() :
selectCasa((10, 5), btn105)
def btn106_click() :
selectCasa((10, 6), btn106)
def btn107_click() :
selectCasa((10, 7), btn107)
def btn108_click() :
selectCasa((10, 8), btn108)
def btn109_click() :
selectCasa((10, 9), btn109)
def btn1010_click() :
selectCasa((10, 10), btn1010)
# FUNCOES BOTÕES ALGORITMOS
def existeVazio() :
if gato == [] and saida != [] :
gatoVazio()
return True
elif gato != [] and saida == [] :
saidaVazio()
return True
elif gato == [] and saida == [] :
ambosVazio()
return True
else :
return False
def gatoVazio() :
messagebox.showinfo("Parâmetros de busca", "Para realizar a busca, escolha uma posição para o início.")
def saidaVazio() :
messagebox.showinfo("Parâmetros de busca", "Para realizar a busca, escolha uma posição para a saída.")
def ambosVazio() :
messagebox.showinfo("Parâmetros de busca", "Para realizar a busca, escolha uma posição para o início e para saída.")
def btnAstar_click() :
if existeVazio() is not True:
Animation('aStar').start()
def btnBestFirst_click() :
if existeVazio() is not True:
Animation('bestFirst').start()
def btnAmplitude_click() :
if existeVazio() is not True:
Animation('breadthFirstSearch').start()
def btnProfundidade_click() :
if existeVazio() is not True:
Animation('depthFirst').start()
# FUNÇÕES DE DELAY
def paintBtnDelay(botao):
global btnMtLento
global btnLento
global btnNormal
global btnRapido
global btnMtRapido
btnMtLento["bg"] = unselectedColor
btnLento["bg"] = unselectedColor
btnNormal["bg"] = unselectedColor
btnRapido["bg"] = unselectedColor
btnMtRapido["bg"] = unselectedColor
if botao == "Muito Lento":
btnMtLento["bg"] = selectedColor
elif botao == "Lento":
btnLento["bg"] = selectedColor
elif botao == "Normal":
btnNormal["bg"] = selectedColor
elif botao == "Rapido":
btnRapido["bg"] = selectedColor
elif botao == "Muito Rapido":
btnMtRapido["bg"] = selectedColor
def setDelayGif(delay):
global delayGif
delayGif = delay
def btnMtLento_Click():
setDelayGif(1000)
paintBtnDelay("Muito Lento")
def btnLento_Click():
setDelayGif(500)
paintBtnDelay("Lento")
def btnNormal_Click():
setDelayGif(200)
paintBtnDelay("Normal")
def btnRapido_Click():
setDelayGif(100)
paintBtnDelay("Rapido")
def btnMtRapido_Click():
setDelayGif(30)
paintBtnDelay("Muito Rapido")
# FRAME DE SELEÇÃO
frameSelection = tk.LabelFrame(root, text="Seleção de Parâmetros", borderwidth=2, foreground=foregroundColor,relief=tk.RAISED, bg=backgroundColor, width=540, height=75, padx=20, pady=15)
frameSelection.place(x=20, y=20)
#BOTÕES DE SELEÇÃO
btnSelectGato = tk.Button(frameSelection, width=16, text="Selecionar Início", foreground=txtBtnColor, command=btnSelectGato_click)
btnSelectGato["cursor"] = "hand2"
btnSelectGato["bg"] = selectedColor
btnSelectGato.place(x=0,y=0)
btnSelectBloqueios = tk.Button(frameSelection, width=16,text="Selecionar Bloqueios", foreground=txtBtnColor, command=btnSelectBloqueios_click)
btnSelectBloqueios["cursor"] = "hand2"
btnSelectBloqueios["bg"] = unselectedColor
btnSelectBloqueios.place(x=143,y=0)
btnSelectSaida = tk.Button(frameSelection, width=16,text="Selecionar Saída", foreground=txtBtnColor, command=btnSelectSaida_click)
btnSelectSaida["cursor"] = "hand2"
btnSelectSaida["bg"] = unselectedColor
btnSelectSaida.place(x=286,y=0)
btnLimpar = tk.Button(frameSelection, width=8,text="Limpar", foreground=txtBtnColor, command=btnLimpar)
btnLimpar["cursor"] = "hand2"
btnLimpar["bg"] = btnLimparColor
btnLimpar.place(x=429,y=0)
# FRAME DE TABULEIRO
frameTabuleiro = tk.LabelFrame(root, text="Tabuleiro", borderwidth=2, foreground=foregroundColor, relief=tk.RAISED, bg=backgroundColor, width=540, height=512)
frameTabuleiro.place(x=20, y=100)
# TABULEIRO
Tabuleiro = tk.Frame(frameTabuleiro, bg=backgroundTabuleiroColor, width=537, height=493)
Tabuleiro.place(x=-1, y=0)
#BOTÕES TABULEIRO - LINHA 0
btn00 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn00_click, padding=4)
btn00["cursor"] = "hand2"
btn00["bg"] = backgroundTabuleiroColor
btn00.place(x=10,y=10)
btn01 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn01_click, padding=4)
btn01["cursor"] = "hand2"
btn01["bg"] = backgroundTabuleiroColor
btn01.place(x=55,y=10)
btn02 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn02_click, padding=4)
btn02["cursor"] = "hand2"
btn02["bg"] = backgroundTabuleiroColor
btn02.place(x=100,y=10)
btn03 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn03_click, padding=4)
btn03["cursor"] = "hand2"
btn03["bg"] = backgroundTabuleiroColor
btn03.place(x=145,y=10)
btn04 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn04_click, padding=4)
btn04["cursor"] = "hand2"
btn04["bg"] = backgroundTabuleiroColor
btn04.place(x=190,y=10)
btn05 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn05_click, padding=4)
btn05["cursor"] = "hand2"
btn05["bg"] = backgroundTabuleiroColor
btn05.place(x=235,y=10)
btn06 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn06_click, padding=4)
btn06["cursor"] = "hand2"
btn06["bg"] = backgroundTabuleiroColor
btn06.place(x=280,y=10)
btn07 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn07_click, padding=4)
btn07["cursor"] = "hand2"
btn07["bg"] = backgroundTabuleiroColor
btn07.place(x=325,y=10)
btn08 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn08_click, padding=4)
btn08["cursor"] = "hand2"
btn08["bg"] = backgroundTabuleiroColor
btn08.place(x=370,y=10)
btn09 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn09_click, padding=4)
btn09["cursor"] = "hand2"
btn09["bg"] = backgroundTabuleiroColor
btn09.place(x=415,y=10)
btn010 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn010_click, padding=4)
btn010["cursor"] = "hand2"
btn010["bg"] = backgroundTabuleiroColor
btn010.place(x=460,y=10)
#BOTÕES TABULEIRO - LINHA 1
btn10 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn10_click, padding=4)
btn10["cursor"] = "hand2"
btn10["bg"] = backgroundTabuleiroColor
btn10.place(x=32,y=53)
btn11 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn11_click, padding=4)
btn11["cursor"] = "hand2"
btn11["bg"] = backgroundTabuleiroColor
btn11.place(x=77,y=53)
btn12 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn12_click, padding=4)
btn12["cursor"] = "hand2"
btn12["bg"] = backgroundTabuleiroColor
btn12.place(x=122,y=53)
btn13 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn13_click, padding=4)
btn13["cursor"] = "hand2"
btn13["bg"] = backgroundTabuleiroColor
btn13.place(x=167,y=53)
btn14 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn14_click, padding=4)
btn14["cursor"] = "hand2"
btn14["bg"] = backgroundTabuleiroColor
btn14.place(x=212,y=53)
btn15 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn15_click, padding=4)
btn15["cursor"] = "hand2"
btn15["bg"] = backgroundTabuleiroColor
btn15.place(x=257,y=53)
btn16 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn16_click, padding=4)
btn16["cursor"] = "hand2"
btn16["bg"] = backgroundTabuleiroColor
btn16.place(x=302,y=53)
btn17 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn17_click, padding=4)
btn17["cursor"] = "hand2"
btn17["bg"] = backgroundTabuleiroColor
btn17.place(x=347,y=53)
btn18 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn18_click, padding=4)
btn18["cursor"] = "hand2"
btn18["bg"] = backgroundTabuleiroColor
btn18.place(x=392,y=53)
btn19 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn19_click, padding=4)
btn19["cursor"] = "hand2"
btn19["bg"] = backgroundTabuleiroColor
btn19.place(x=437,y=53)
btn110 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn110_click, padding=4)
btn110["cursor"] = "hand2"
btn110["bg"] = backgroundTabuleiroColor
btn110.place(x=482,y=53)
#BOTÕES TABULEIRO - LINHA 2
btn20 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn20_click, padding=4)
btn20["cursor"] = "hand2"
btn20["bg"] = backgroundTabuleiroColor
btn20.place(x=10,y=96)
btn21 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn21_click, padding=4)
btn21["cursor"] = "hand2"
btn21["bg"] = backgroundTabuleiroColor
btn21.place(x=55,y=96)
btn22 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn22_click, padding=4)
btn22["cursor"] = "hand2"
btn22["bg"] = backgroundTabuleiroColor
btn22.place(x=100,y=96)
btn23 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn23_click, padding=4)
btn23["cursor"] = "hand2"
btn23["bg"] = backgroundTabuleiroColor
btn23.place(x=145,y=96)
btn24 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn24_click, padding=4)
btn24["cursor"] = "hand2"
btn24["bg"] = backgroundTabuleiroColor
btn24.place(x=190,y=96)
btn25 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn25_click, padding=4)
btn25["cursor"] = "hand2"
btn25["bg"] = backgroundTabuleiroColor
btn25.place(x=235,y=96)
btn26 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn26_click, padding=4)
btn26["cursor"] = "hand2"
btn26["bg"] = backgroundTabuleiroColor
btn26.place(x=280,y=96)
btn27 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn27_click, padding=4)
btn27["cursor"] = "hand2"
btn27["bg"] = backgroundTabuleiroColor
btn27.place(x=325,y=96)
btn28 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn28_click, padding=4)
btn28["cursor"] = "hand2"
btn28["bg"] = backgroundTabuleiroColor
btn28.place(x=370,y=96)
btn29 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn29_click, padding=4)
btn29["cursor"] = "hand2"
btn29["bg"] = backgroundTabuleiroColor
btn29.place(x=415,y=96)
btn210 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn210_click, padding=4)
btn210["cursor"] = "hand2"
btn210["bg"] = backgroundTabuleiroColor
btn210.place(x=460,y=96)
#BOTÕES TABULEIRO - LINHA 3
btn30 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn30_click, padding=4)
btn30["cursor"] = "hand2"
btn30["bg"] = backgroundTabuleiroColor
btn30.place(x=32,y=139)
btn31 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn31_click, padding=4)
btn31["cursor"] = "hand2"
btn31["bg"] = backgroundTabuleiroColor
btn31.place(x=77,y=139)
btn32 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn32_click, padding=4)
btn32["cursor"] = "hand2"
btn32["bg"] = backgroundTabuleiroColor
btn32.place(x=122,y=139)
btn33 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn33_click, padding=4)
btn33["cursor"] = "hand2"
btn33["bg"] = backgroundTabuleiroColor
btn33.place(x=167,y=139)
btn34 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn34_click, padding=4)
btn34["cursor"] = "hand2"
btn34["bg"] = backgroundTabuleiroColor
btn34.place(x=212,y=139)
btn35 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn35_click, padding=4)
btn35["cursor"] = "hand2"
btn35["bg"] = backgroundTabuleiroColor
btn35.place(x=257,y=139)
btn36 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn36_click, padding=4)
btn36["cursor"] = "hand2"
btn36["bg"] = backgroundTabuleiroColor
btn36.place(x=302,y=139)
btn37 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn37_click, padding=4)
btn37["cursor"] = "hand2"
btn37["bg"] = backgroundTabuleiroColor
btn37.place(x=347,y=139)
btn38 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn38_click, padding=4)
btn38["cursor"] = "hand2"
btn38["bg"] = backgroundTabuleiroColor
btn38.place(x=392,y=139)
btn39 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn39_click, padding=4)
btn39["cursor"] = "hand2"
btn39["bg"] = backgroundTabuleiroColor
btn39.place(x=437,y=139)
btn310 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn310_click, padding=4)
btn310["cursor"] = "hand2"
btn310["bg"] = backgroundTabuleiroColor
btn310.place(x=482,y=139)
#BOTÕES TABULEIRO - LINHA 4
btn40 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn40_click, padding=4)
btn40["cursor"] = "hand2"
btn40["bg"] = backgroundTabuleiroColor
btn40.place(x=10,y=182)
btn41 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn41_click, padding=4)
btn41["cursor"] = "hand2"
btn41["bg"] = backgroundTabuleiroColor
btn41.place(x=55,y=182)
btn42 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn42_click, padding=4)
btn42["cursor"] = "hand2"
btn42["bg"] = backgroundTabuleiroColor
btn42.place(x=100,y=182)
btn43 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn43_click, padding=4)
btn43["cursor"] = "hand2"
btn43["bg"] = backgroundTabuleiroColor
btn43.place(x=145,y=182)
btn44 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn44_click, padding=4)
btn44["cursor"] = "hand2"
btn44["bg"] = backgroundTabuleiroColor
btn44.place(x=190,y=182)
btn45 = CustomButton(Tabuleiro, width=35, height=35, color="white", command=btn45_click, padding=4)
btn45["cursor"] = "hand2"