repl.it
@DARKLORD6474/

fixing player count

Python

No description

fork
loading
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
from random import randint
def deal(playernumb,player1cards,player2cards):
  l = ['red','black','yellow']
  
  for i in range(30):
    result = l[randint(0,2)]
    print('')
    if result == 'red':
      l3=['1','2','3','4','5','6','7','8','9','10']
      result2 = l3[randint(0,len(l3)-1)]
      print('Player',playernumb,'Picked a',result,result2 )
      if playernumb == 1:
        player1cards.append('red' + result2)
      elif playernumb != 1:
        player2cards.append('red' + result2)
      l3.remove(result2)
      
      



    if result == 'black':
      l4=['1','2','3','4','5','6','7','8','9','10']
      result3 = l4[randint(0,len(l4)-1)]
      print('Player',playernumb,'Picked a',result,result3)
      if playernumb == 1:
        player1cards.append('black ' + result3)
      elif playernumb != 1:
        player2cards.append('black ' + result3)
      l4.remove(result3)
      


    if result == 'yellow':
      l2=['1','2','3','4','5','6','7','8','9','10']
      result4 = l2[randint(0,len(l2)-1)]
      print('Player',playernumb,'Picked a',result,result4)
      if playernumb == 1:
        player1cards.append('yellow' + result4)
      elif playernumb != 1:
        player2cards.append('yellow' + result4)
      l2.remove(result4)
  return player1cards,player2cards

username= ('Paul Kaye')
password1=('PLAYER1')
password2=('PLAYER2')
print('Authtorised Entry Only')

while True:
    counter=5
    while(counter >0):
        counter=counter-1
        passwordenter=input('Enter Password Here,Player 1')
        
        if passwordenter==password1:
            print('Welcome PLAYER1')
            break
        if passwordenter!= password1:
            if counter == 0:
                print ('you have exceeded ur chances, please try again in 30 seconds')
                from time import sleep
                for i in range(5):
                    print(5-i, 'secs left')
                    sleep(1)


    while(counter >0):
        counter=counter-1
        passwordenter2=input('Enter Password Here,Player 2') 

        if passwordenter2==password2:
            print('Welcome PLAYER2')
            break
        if passwordenter2!= password2:
            if counter == 0:
                print ('you have exceeded ur chances, please try again in 30 seconds')
                from time import sleep
                for i in range(5):
                    print(5-i, 'secs left')
                    sleep(1)
        
                
            else:
                print('please try again, you have',counter,'times left')
  
    if passwordenter==password1:
        break
p1cards = []
p2cards = []
for count in range(30):
  if count % 2 == 0:
    p1cards,p2cards = deal(1,p1cards,p2cards)
    
  else:
    p1cards,p2cards = deal(2,p1cards,p2cards)




  
print('')



?