Files
  • main.py
main.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
#By: Peter Zakariya

#54
#imports
import time
import random
from termcolor import colored

#variables
sen = 1
points = 0
first = 0
global check
check = 0
bots = 0
global turn
turn = 0
global turnafter
turnafter = 0
global place
place = 0
global direction
direction = 1
numberb = 0
done = 0
read = 0
global color
color = 0

#lists
unocolors = ["Blue", "Yellow", "Red", "Green"]
unonumbers = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+2", "Reverse", "Skip"]
usercards = []
botcards = []
bot2cards = []
bot3cards = []
comments = ["", "you", "bot 1", "bot 2", "bot 3"]
order1 = ["you", "bot 1", "bot 2", "bot 3"]

#is number function
def is_number(s):
    try:
      float(s)
      return True
    except ValueError:
      return False

#random uno function
#26
#13
randomcardcol = ""
randomcardnum = ""
def rancard(who):
  randomcardcol = unocolors[random.randint(0,3)]
  randomcardnum = unonumbers[random.randint(0,12)]
  if who == "first":
    randomcardnum = unonumbers[random.randint(0,9)]
  if random.randint(1, 26) == 1 and who != "first":
    randomcardcol = "Any!"
    if random.randint(1, 2) == 1:
      randomcardnum = "+4"
    else:
      randomcardnum = "+0"
  if who == "you":
    usercards.append(randomcardcol)
    usercards.append(randomcardnum)
  elif who == "bot 1":
    botcards.append(randomcardcol)
    botcards.append(randomcardnum)
  elif who == "bot 2":
    bot2cards.append(randomcardcol)
    bot2cards.append(randomcardnum)
  elif who == "bot 3":
    bot3cards.append(randomcardcol)
    bot3cards.append(randomcardnum)
  elif who == "first":
    global firstcol
    global firstnum
    firstcol = ""
    firstnum = ""
    firstcol = randomcardcol
    firstnum = randomcardnum
    return first

#give cards function
#number, who
def give(num, who):
  number = 0
  while number != num:
    number += 1
    rancard(who)

#delete card function
def delete(num, who):
  if who == "me":
    del(usercards[((userinput - 1) * 2)])
    del(usercards[((userinput - 1) * 2)])
  if who == "bot":
    del(botcards[((num - 1) * 2)])
    del(botcards[((num - 1) * 2)])
  if who == "bot2":
    del(bot2cards[((num - 1) * 2)])
    del(bot2cards[((num - 1) * 2)])
  if who == "bot3":
    del(bot3cards[((num - 1) * 2)])
    del(bot3cards[((num - 1) * 2)])
  global check
  check = 1

#reset function
def reset(number):
  number1 = 0
  while number1 != number:
    number1+= 1
    print("")

#sentence function
def sentence(word):
  number = -1
  wordlist = []
  for letter in word:
    wordlist.append(letter)
  complete = ""
  while number != len(word) - 1:
    number += 1
    reset(25)
    complete += complete.join(wordlist[number])
    print(complete)
    reset(26)
    if sen != 3:
     time.sleep(0.04)
  if sen != 1 and sen != 3:
    input()

#show everything function
def show():
  reset(100)
  if len(usercards) // 2 == 0 or len(botcards) // 2 == 0 or len(bot2cards) // 2 == 0 or len(bot3cards) // 2 == 0:
    game = 1
  if just == 0:
    number = 0
  else:
    number = 1
  order = ""
  after = 0
  if direction == 1:
    while number != bots + 1:
      number += 1
      order = order + order1[number - 1]
      if turn == number:
        order = order + " -->> "
        after = number + 1
        if after > bots + 1:
          after = 1
      else:
        order = order + " --> "
  elif direction == -1:
    while number != bots + 1:
      number += 1
      if turn == number:
        order = order + " <<-- "
        after = number - 1
        if after < 1:
          after = bots + 1
      else:
        order = order + " <-- "
      order = order + order1[number - 1]
  print(order)
  print("-------")
  sho = len(usercards) // 2
  if just == 0:
    if (len(usercards)) == 2:
      print(colored("your cards: %s" % sho, "white", "on_cyan"))
    else:
      print("your cards: %s" % sho)
  sho = len(botcards) // 2
  if int(turn) == 2 and place == 2:
    print("bot 1's cards: %s <---" % sho)
  else:
    if len(botcards) == 2:
      print(colored("bot 1's cards: %s" % sho, "white", "on_red"))
    else:
      print("bot 1's cards: %s" % sho)
  if bots >= 2:
    sho = len(bot2cards) // 2
    if int(turn) == 3 and place == 2:
      print("bot 2's cards: %s <---" % sho)
    else:
      if len(bot2cards) == 2:
        print(colored("bot 2's cards: %s" % sho, "white", "on_red"))
      else:
        print("bot 2's cards: %s" % sho)
  if bots >= 3:
    sho = len(bot3cards) // 2
    if int(turn) == 4 and place == 2:
      print("bot 3's cards: %s <---" % sho)
    else:
      if len(bot3cards) == 2:
        print(colored("bot 3's cards: %s" % sho, "white", "on_red"))
      else:
        print("bot 3's cards: %s" % sho)
  number = 0
  num = 0
  print("-------")
  while number != len(usercards) and just == 0:
    number += 2
    num += 1
    if usercards[number - 2] == "Blue":
      color = "cyan"
    elif usercards[number - 2] == "Yellow":
      color = "yellow"
    elif usercards[number - 2] == "Red":
      color = "red"
    elif usercards[number - 2] == "Green":
      color = "green"
    else:
      color = "white"
    if currentcol == usercards[number - 2] or currentnum == usercards[number - 1] or usercards[number - 2] == "Any!":
      if number >= 20:
        print(str(num) + " | " + colored(usercards[number - 2], color) + " " + colored(usercards[number - 1], color) + " <---")
      else:
        print(str(num) + "  | " + colored(usercards[number - 2], color) + " " + colored(usercards[number - 1], color) + " <---")
    else:
      if number >= 20:
        print(str(num) + " | " + colored(usercards[number - 2], color) + " " + colored(usercards[number - 1], color))
      else:
        print(str(num) + "  | " + colored(usercards[number - 2], color) + " " + colored(usercards[number - 1], color))
  if just == 0:
    print("-------")
  reset(1)
  if turn == 1:
    print("It is currently: your turn")
  if turn == 2:
    print("It is currently: bot 1's turn")
  if turn == 3:
    print("It is currently: bot 2's turn")
  if turn == 4:
    print("It is currently: bot 3's turn")
  reset(1)
  print("-------")
  reset(1)
  read = 0
  if currentcol == "Blue":
    color = "cyan"
  elif currentcol == "Yellow":
    color = "yellow"
  elif currentcol == "Red":
    color = "red"
  elif currentcol == "Green":
    color = "green"
  else:
    color = "white"
  current = colored(currentcol, color) + " " + colored(currentnum, color)
  if place == 1:
    if currentnum == "+2":
      print(comments[turn] + " made the next player draw 2 cards")
      read = 1
    elif currentnum == "+4":
      print(comments[turn] + " made the next player draw 4 cards")
      read = 1
    elif currentnum == "Skip":
      print(comments[turn] + " skipped the next player")
      read = 1
    else:
      print(comments[turn] + " placed " + current)
  elif place == 2:
    if comments[turn] == "you":
      game = 1
    else:
      print(comments[turn] + " drew a card")
  else:
    print("")
  if place == 0 or place == 2:
    print("The current card is: %s" % current)
  else:
    print("The current card is: %s <---" % current)
  reset(1)
  print("-------")
  reset(1)
  if int(place) == 1:
    time.sleep(2)
  if read == 1:
    time.sleep(1)
    read = 0
  global userinput
  userinput = ""
  if check == 0 and int(turn) == 1:
    userinput = input("Say \"draw\" or type a card number:")
    if is_number(userinput) == True:
      userinput = int(userinput)

#introduction
print("The game of Uno:")
print("")
print("-To win you need to be the first player to use up all of your cards until you have 0 cards.")
print("")
print("-The cards that you can use are determined by the current card.")
print("Your card must either have the same color or number or be a \"Any!\" card.")
print("Example:")
print("-------")
print("If the current card is Red 5, the only cards that I can play are any of my cards that have \"Red\" or \"5\" or \"Any!\"")
print("-------")
print("")
print("Special cards:")
print("")
print("-\"Skip\"")
print("If this card is played, it skips the next player's turn.")
print("")
print("-\"Reverse\"")
print("If this card is played, the order of turns reverses.")
print("Example:")
print("-------")
print("The order is")
print("\"player -->> bot 1 --> bot 2 -->\"")
print("")
print("If player uses a reverse then the order becomes")
print("\"<-- player <-- bot 1 <<-- bot 2\"")
print("")
print("(the longer arrow indicates the player after the current player's turn)")
print("-------")
print("If it is a 1vs1 then \"Reverse\" is used as a \"Skip\" instead.")
print("")
print("-\"+2\" or \"+4\"")
print("When this card is played then the person after them get +2 or +4 cards and their turn is skipped.")
print("")
print("-\"Any!\"")
print("This card alows whoever used it to choose the color of the current card.")
print("")
print("                v")
print("IMPORTANT ---> How to play:")
print("                ^")
print("")
print("-Type the number of the card that you want to use.")
print("Example:")
print("-------")
print("1  | Green 2 <---")
print("2  | Yellow 4")
print("-------")
print("If you wanted to play the card Green 2, then you would type \"1\" and then press Enter.")
print("")
print("-Any arrow pointing towards your card means that, that card is playable.")
print("Example:")
print("-------")
print("1  | Green 2 <---")
print("2  | Green Skip <---")
print("3  | Yellow 8")
print("4  | Any! +0 <---")
print("5  | Red Skip")
print("6  | Yellow 2")
print("-------")
print("This means that the cards Green 2, Green Skip, Any! +0 are playable.")
print("")
print("-If you run out of playable cards or if you want to have another card")
print("type \"draw\" and press Enter")
print("This wil give you a random card.")
print("")
print("Scroll up")
input("Press Enter when you have read all of the instructions")
sentence("hello! welcome to \"Uno\" By: Peter Zakariya")
time.sleep(2)
#name
sentence("type your name:")
name = input()
sentence("your name is \"%s\"" % name)
time.sleep(1)
sentence("hello %s! welcome to uno." % name)
time.sleep(2)
order1 = [name, "bot 1", "bot 2", "bot 3"]
#game
while 0 == 0:
  direction = 1
  check = 0
  bots = 0
  usercards = []
  botcards = []
  bot2cards = []
  bot3cards = []
  sen = 3
  just = 0
  while bots != 1 and bots != 2 and bots != 3 and just != 1:
    sentence("(\"just bots\" or \"1\" or \"2\" or \"3\") how many bots?")
    bots = input()
    if bots == "just bots" or bots == "Just bots" or bots == "bots":
      just = 1
      bots = 3
      turn = random.randint(2,4)
    if is_number(bots):
      bots = int(bots)
      if just == 0:
        turn = 1
    else:
      bots = 0
  sen = 1
  sentence("shuffling...")
  time.sleep(2)
  sentence("dealing...")
  time.sleep(1)
  give(7, "you")
  give(7, "bot 1")
  give(7, "bot 2")
  give(7, "bot 3")
  rancard("first")
  currentcol = firstcol
  currentnum = firstnum
  game = 0
  while game == 0:
    while check == 0 and int(turn) == 1 and game == 0 and just == 0:
      show()
      if is_number(userinput) == True and userinput <   len(usercards) / 2 + 1 and int(turn) == 1:
        if usercards[(userinput - 1) * 2] == str(currentcol) or usercards[userinput * 2 - 1] == currentnum or usercards[(userinput - 1) * 2] == "Any!":
          if usercards[(userinput - 1) * 2] == "Any!":
            while usercards[(userinput - 1) * 2] != "Blue" and usercards[(userinput - 1) * 2] != "Red" and usercards[(userinput - 1) * 2] != "Green" and usercards[(userinput - 1) * 2] != "Yellow" and usercards[(userinput - 1) * 2] != "blue" and usercards[(userinput - 1) * 2] != "red" and usercards[(userinput - 1) * 2] != "green" and usercards[(userinput - 1) * 2] != "yellow":
              usercards[(userinput - 1) * 2] = input("(\"Blue\" \"Green\" \"Red\" \"Yellow\") Which color:") 
              if usercards[(userinput - 1) * 2] == "blue" or usercards[(userinput - 1) * 2] == "Blue":
                usercards[(userinput - 1) * 2] = "Blue"
                check = 0
              elif usercards[(userinput - 1) * 2] == "green" or usercards[(userinput - 1) * 2] == "Green":
                usercards[(userinput - 1) * 2] = "Green"
                check = 0
              elif usercards[(userinput - 1) * 2] == "red" or usercards[(userinput - 1) * 2] == "Red":
                usercards[(userinput - 1) * 2] = "Red"
                check = 0
              elif usercards[(userinput - 1) * 2] == "yellow" or usercards[(userinput - 1) * 2] == "Yellow":
                usercards[(userinput - 1) * 2] = "Yellow"
                check = 0
              else:
                usercards[(userinput - 1) * 2] = input("(\"Blue\" \"Green\" \"Red\" \"Yellow\") Which color:")
          currentcol = usercards[(userinput - 1) * 2]
          currentnum = usercards[userinput * 2 - 1]
          delete(int(userinput), "me")
          show()
          if len(usercards) == 0:
            game = 1
          if currentnum == "Reverse" and bots != 1:
            direction *= -1
          turn += direction
          if turn > bots + 1:
            turn = 1
          if turn < 1:
            turn = bots + 1
          turnafter = turn + direction
          if turnafter > bots + 1:
            turnafter = 1
          if turnafter < 1:
            turnafter = bots + 1
          if currentnum == "Skip" or currentnum == '+2' or currentnum == '+4' or (bots == 1 and currentnum == "Reverse"):
            if currentnum == '+2' or currentnum == '+4':
              if currentnum == '+2':
                give(2, comments[turn])
              else:
                give(4, comments[turn])
            turn = turnafter
            turnafter = turn + direction
            if turnafter > bots + 1:
              turnafter = 1
            if turnafter < 1:
              turnafter = bots + 1
            check = 0
          else:
            check = 1
        else:
          show()
      else:
        if str(userinput) == "draw":
          give(1, "you")
          turn += direction
          if turn > bots + 1:
            turn = 1
          if turn < 1:
            turn = bots + 1
            turnafter = turn + direction
          if turnafter > bots + 1:
            turnafter = 1
          if turnafter < 1:
            turnafter = bots + 1
          check = 1
    if just == 1 and turn == 1:
      turn += direction
      if turn > bots + 1:
        turn = 1
      if turn < 1:
        turn = bots + 1
    show()
    if len(usercards) == 0:
      game = 1
#bot1
    if int(turn) == 2 and game == 0:
      numberb = 0
      done = 0
      check = 1
      show()
      time.sleep(0.5)
      check = 0
    while int(numberb) != len(botcards) / 2 and done != 1 and int(turn) == 2 and game == 0:
      check = 0
      numberb += 1
      if currentcol == botcards[(numberb - 1) * 2] or currentnum == botcards[numberb * 2 - 1] or botcards[(numberb - 1) * 2] == "Any!":
        if botcards[(numberb - 1) * 2] == "Any!":
          currentcol = botcards[(numberb - 1) * 2]
          currentnum = botcards[(numberb * 2 - 1)]
          check = 1
          place = 1
          show()
          place = 0
          check = 0
          time.sleep(1)
          randomnum = random.randint(1,4)
          if int(randomnum) == 1:
            currentcol = "Blue"
          elif int(randomnum) == 2:
            currentcol = "Green"
          elif int(randomnum) == 3:
            currentcol = "Red"
          elif int(randomnum) == 4:
            currentcol = "Yellow"
        if botcards[(numberb - 1) * 2] != "Any!":
          currentcol = botcards[(numberb - 1) * 2]
        currentnum = botcards[numberb * 2 - 1]
        delete(int(numberb), "bot")
        if len(botcards) == 0:
          game = 1
        if currentnum == "Reverse" and bots != 1:
          direction *= -1
        done = 1
        check = 1
        place = 1
        show()
        place = 0
        check = 0
        numberb = 0
        turn += direction
        if turn > bots + 1:
          turn = 1
        if turn < 1:
          turn = bots + 1
        turnafter = turn + direction
        if turnafter > bots + 1:
          turnafter = 1
        if turnafter < 1:
          turnafter = bots + 1
        if currentnum == "Skip" or currentnum == '+2' or currentnum == '+4' or (bots == 1 and currentnum == "Reverse"):
          if currentnum == '+2' or currentnum == '+4':
            if currentnum == '+2':
              if just == 1 and direction == -1:
                give(2, "bot 3")
              else:
                give(2, comments[turn])
            else:
              if just == 1 and direction == -1:
                give(4, "bot 3")
              else:
                give(4, comments[turn])
          if just == 1 and direction == -1:
            turnafter = 3
          turn = turnafter
      if numberb == len(botcards) / 2 and game == 0:
        give(1, "bot 1")
        done = 1
        check = 1
        place = 2
        show()
        place = 0
        check = 0
        time.sleep(0.2)
        turn += direction
        if turn > bots + 1:
          turn = 1
        if turn < 1:
          turn = bots + 1
        turnafter = turn + direction
      if turnafter > bots + 1:
          turnafter = 1
      if turnafter < 1:
          turnafter = bots + 1
      check = 0
      if done == 1:
        time.sleep(0.5)
    if len(botcards) == 0:
      game = 1
#bot2
    if int(turn) == 3 and game == 0:
      numberb = 0
      done = 0
      check = 1
      show()
      time.sleep(0.5)
      check = 0
    while int(numberb) != len(bot2cards) / 2 and done != 1 and int(turn) == 3 and game == 0:
      check = 0
      numberb += 1
      if currentcol == bot2cards[(numberb - 1) * 2] or currentnum == bot2cards[numberb * 2 - 1] or bot2cards[(numberb - 1) * 2] == "Any!":
        if bot2cards[(numberb - 1) * 2] == "Any!":
          currentcol = bot2cards[(numberb - 1) * 2]
          currentnum = bot2cards[(numberb * 2 - 1)]
          check = 1
          place = 1
          show()
          place = 0
          check = 0
          time.sleep(1)
          randomnum = random.randint(1,4)
          if int(randomnum) == 1:
            currentcol = "Blue"
          elif int(randomnum) == 2:
            currentcol = "Green"
          elif int(randomnum) == 3:
            currentcol = "Red"
          elif int(randomnum) == 4:
            currentcol = "Yellow"
        if bot2cards[(numberb - 1) * 2] != "Any!":
          currentcol = bot2cards[(numberb - 1) * 2]
        currentnum = bot2cards[numberb * 2 - 1]
        delete(int(numberb), "bot2")
        if len(bot2cards) == 0:
          game = 1
        if currentnum == "Reverse" and bots != 1:
          direction *= -1
        done = 1
        check = 1
        place = 1
        show()
        place = 0
        check = 0
        numberb = 0
        turn += direction
        if turn > bots + 1:
          turn = 1
        if turn < 1:
          turn = bots + 1
        turnafter = turn + direction
        if turnafter > bots + 1:
          turnafter = 1
        if turnafter < 1:
          turnafter = bots + 1
        if currentnum == "Skip" or currentnum == '+2' or currentnum == '+4' or (bots == 1 and currentnum == "Reverse"):
          if currentnum == '+2' or currentnum == '+4':
            if currentnum == '+2':
              give(2, comments[turn])
            else:
              give(4, comments[turn])
          turn = turnafter
      if numberb == len(bot2cards) / 2 and game == 0:
        give(1, "bot 2")
        done = 1
        check = 1
        place = 2
        show()
        place = 0
        check = 0
        time.sleep(0.2)
        turn += direction
        if turn > bots + 1:
          turn = 1
        if turn < 1:
          turn = bots + 1
        turnafter = turn + direction
      if turnafter > bots + 1:
          turnafter = 1
      if turnafter < 1:
          turnafter = bots + 1
      check = 0
      if done == 1:
        time.sleep(0.5)
    if len(bot2cards) == 0:
      game = 1
#bot3
    if int(turn) == 4 and game == 0:
      numberb = 0
      done = 0
      check = 1
      show()
      time.sleep(0.5)
      check = 0
    while int(numberb) != len(bot3cards) / 2 and done != 1 and int(turn) == 4 and game == 0:
      check = 0
      numberb += 1
      if currentcol == bot3cards[(numberb - 1) * 2] or currentnum == bot3cards[numberb * 2 - 1] or bot3cards[(numberb - 1) * 2] == "Any!":
        if bot3cards[(numberb - 1) * 2] == "Any!":
          currentcol = bot3cards[(numberb - 1) * 2]
          currentnum = bot3cards[(numberb * 2 - 1)]
          check = 1
          place = 1
          show()
          place = 0
          check = 0
          time.sleep(1)
          randomnum = random.randint(1,4)
          if int(randomnum) == 1:
            currentcol = "Blue"
          elif int(randomnum) == 2:
            currentcol = "Green"
          elif int(randomnum) == 3:
            currentcol = "Red"
          elif int(randomnum) == 4:
            currentcol = "Yellow"
        if bot3cards[(numberb - 1) * 2] != "Any!":
          currentcol = bot3cards[(numberb - 1) * 2]
        currentnum = bot3cards[numberb * 2 - 1]
        delete(int(numberb), "bot3")
        if len(bot3cards) == 0:
          game = 1
        if currentnum == "Reverse" and bots != 1:
          direction *= -1
        done = 1
        check = 1
        place = 1
        show()
        place = 0
        check = 0
        numberb = 0
        turn += direction
        if turn > bots + 1:
          turn = 1
        if turn < 1:
          turn = bots + 1
        turnafter = turn + direction
        if turnafter > bots + 1:
          turnafter = 1
        if turnafter < 1:
          turnafter = bots + 1
        if currentnum == "Skip" or currentnum == '+2' or currentnum == '+4' or (bots == 1 and currentnum == "Reverse"):
          if currentnum == '+2' or currentnum == '+4':
            if currentnum == '+2':
              if just == 1 and direction == 1:
                give(2, "bot 1")
              else:
                give(2, comments[turn])
            else:
              if just == 1 and direction == 1:
                give(4, "bot 1")
              else:
                give(4, comments[turn])
          if just == 1 and direction == 1:
            turnafter = 3
          turn = turnafter
      if numberb == len(bot3cards) / 2 and game == 0:
        give(1, "bot 3")
        done = 1
        check = 1
        place = 2
        show()
        place = 0
        check = 0
        time.sleep(0.2)
        turn += direction
        if turn > bots + 1:
          turn = 1
        if turn < 1:
          turn = bots + 1
        turnafter = turn + direction
      if turnafter > bots + 1:
          turnafter = 1
      if turnafter < 1:
          turnafter = bots + 1
      check = 0
      if done == 1:
        time.sleep(1)
    if len(bot3cards) == 0:
      game = 1
  time.sleep(0.5)
  sen = 1
  if len(usercards) == 0:
    sentence("Congratulations! You won!")
  else:
    if len(botcards) == 0:
      sentence("Bot 1 won!")
    if len(bot2cards) == 0:
      sentence("Bot 2 won!")
    if len(bot3cards) == 0:
      sentence("Bot 3 won!")
  input()

  # 1 = 0, 1
  # 2 = 2, 3
  # 3 = 4, 5
  # 4 = 6, 7 
  # 5 = 8, 9
Python 3.6.1 (default, Dec 2015, 13:05:11) [GCC 4.8.2] on linux