#Here tôi xác định chức năng người dùng và CPU
cpu_num = random.randint[1,6]
user_selection = ["Odd", "Even"]
def cpu_choice[]:
choice = random.randint[1,6]
print["The computer's choice is",choice]
return choice
def user_choice[]:
while[True]:
choice = input["Odd or Even? "]
if choice in user_selection:
print["Your choice is",choice]
return choice
else:
print["You did not write your answer correctly, please try again."]
#Trong chức năng này, tôi xác định kết quả của mỗi vòng dựa trên các công thức trước đó và hai biến mới [num_round và user_lives] và mọi thứ đều hoạt động tốt
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
#Mọi thứ hoạt động tốt cho đến khi ở đây, tôi không biết tôi đang làm gì sai trong chức năng người chiến thắng
def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
Cho ba số nguyên dương x, y và P. ở đây p biểu thị số lượt. Bất cứ khi nào rẽ là lẻ x được nhân với 2 và trong mỗi lần lượt y được nhân với 2. Tác vụ là tìm giá trị của tối đa [x, y] min [x, y] sau khi p hoàn chỉnh.
Ví dụ: & nbsp;
Đầu vào: x = 1, y = 2, p = 1Output: 1Explanation: As lượt là lẻ, x được nhân với 2 và trở thành 2. Bây giờ, x là 2 và y cũng là 2. & nbsp; do đó, 2 ÷ 2 là 1.X = 1, Y = 2, P = 1
Output : 1
Explanation: As turn is odd, X is multiplied by
2 and becomes 2. Now, X is 2 and Y is also 2.
Therefore, 2 ÷ 2 is 1.Đầu vào: x = 3, y = 7, p = 2Output: 2Explanation: & nbsp; ở đây chúng ta có 2 lượt. Trong lượt thứ nhất là lẻ được nhân với 2. và các giá trị là 6 và 7. & nbsp; trong lượt tiếp theo thậm chí y được nhân với 2. Bây giờ các giá trị cuối cùng là 6 và 14. Do đó, 14 ÷ 6 là 2.X = 3, Y = 7, p = 2
Output : 2
Explanation: Here we have 2 turns. In the 1st turn which is odd
X is multiplied by 2. And the values are 6 and 7.
In the next turn which is even Y is multiplied by 2.
Now the final values are 6 and 14. Therefore, 14 ÷ 6 is 2.
Hãy chơi trò chơi trên cho 8 lượt: & nbsp; & nbsp;
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |
Ở đây chúng ta có thể dễ dàng phát hiện ra một mẫu: & nbsp; & nbsp;
if i is even, then X[i] = z * X and Y[i] = z * Y. if i is odd, then X[i] = 2*z * X and Y[i] = z * Y.
Ở đây Z thực sự là sức mạnh của 2. Vì vậy, chúng ta có thể nói đơn giản - & nbsp; & nbsp;
If P is even output will be max[X, Y] ÷ min[X, Y] else output will be max[2*X, Y] ÷ min[2*X, Y].
Dưới đây là việc thực hiện: & NBSP;
C++
#include
using
namespace
std;
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
0 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
1def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
0 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
3__def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
8def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
0 def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
1def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
3 def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
4def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
6def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
3 def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
9| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |0
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
0 | i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |2
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
8def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
0 | i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |6
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |8
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9if i is even, then X[i] = z * X and Y[i] = z * Y. if i is odd, then X[i] = 2*z * X and Y[i] = z * Y.0
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |8
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |0
C
if i is even, then X[i] = z * X and Y[i] = z * Y. if i is odd, then X[i] = 2*z * X and Y[i] = z * Y.4
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
0 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
1def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
0 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
3__def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
8def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
0 def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
1def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
0If P is even output will be max[X, Y] ÷ min[X, Y] else output will be max[2*X, Y] ÷ min[2*X, Y].9
#include
0#include
1
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
0#include
4#include
0#include
6
def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
3 def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
4def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
0using
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
3 def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
9def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
0using
7#include
0using
9
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
0 def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
1def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
3 def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
4def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
6def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
3 def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
9| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |0
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
0 | i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |2
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
8def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
0 | i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |6
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9std;
9def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
00def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
01def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
02def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9if i is even, then X[i] = z * X and Y[i] = z * Y. if i is odd, then X[i] = 2*z * X and Y[i] = z * Y.0
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9std;
9def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
00def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
01def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
02| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |0
C
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
0 If P is even output will be max[X, Y] ÷ min[X, Y] else output will be max[2*X, Y] ÷ min[2*X, Y].6
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
0 #include
9#include
0using
4
def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
3 namespace
5def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
8def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
3 std;
0Java
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
39def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
40def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
6def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
11 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
12def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
13 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
14def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |0
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
16 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
17 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
0 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
1def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
0 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
3______ def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
23def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
8def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
24def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
0 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
7def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
71def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
63def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
74def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
69def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
77def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
78def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
69def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
81def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
32def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
69def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
85def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |0
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |0
Python3
def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
0 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
31def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
32 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
33def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
34def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
35def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
36def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
3 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
38def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
36def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
3 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
45def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
32 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
47def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
6def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
99def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
39def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
49def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
32 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
51def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
16 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
17 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
57 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
58def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
0 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
63def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
64def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
65def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
32def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
67def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
64def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
69def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
89 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
90def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
36def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
37def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
0 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
93def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
94 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
32 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
96def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
96 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
34__Các
def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2___def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
36def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
48C#
def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
27def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
96 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
64def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
30def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
96 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
32def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
8#include
0using
4
def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
3 namespace
5def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
8def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
3 std;
0Java
def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
74def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
75def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
6def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
11 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
12def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
74def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
82def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |0
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
13 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
14def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
8def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
0 | i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |6
def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
96def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
98def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |00
def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |02
def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
96def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |0
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |0
PHP
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |08
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |09
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
1| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |11
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |12
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |13
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |12
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
8def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
0 def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
00| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |15
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |22
def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
3 | i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |25
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |11
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |12
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |13
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |29
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |30
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |31
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |11
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |12
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |13
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |35
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
6def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
3 | i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |40
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |11
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |12
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |13
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |29
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |30
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |46
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |11
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |12
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |13
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |35
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |0
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |11
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |53
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |13
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |55
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |15
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |53
Is
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |11
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |69
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |13
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |71
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |15
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |55
Is
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |84
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|------|---|----|----|----|----|----|----|-----|-----|
| X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |
11 | i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|------|---|----|----|----|----|----|----|-----|-----|
| X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |
69| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|------|---|----|----|----|----|----|----|-----|-----|
| X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |
13 | i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|------|---|----|----|----|----|----|----|-----|-----|
| X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |
71| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|------|---|----|----|----|----|----|----|-----|-----|
| X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |
15 | i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|------|---|----|----|----|----|----|----|-----|-----|
| X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |
55
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |85
JavaScript
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
8def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |09
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |88
def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
0 def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
1def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
2def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
6def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
36def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
3 | i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |96
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X[i] | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y[i] | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |0
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9if i is even, then X[i] = z * X and Y[i] = z * Y. if i is odd, then X[i] = 2*z * X and Y[i] = z * Y.05
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9if i is even, then X[i] = z * X and Y[i] = z * Y. if i is odd, then X[i] = 2*z * X and Y[i] = z * Y.07
if i is even, then X[i] = z * X and Y[i] = z * Y. if i is odd, then X[i] = 2*z * X and Y[i] = z * Y.08
if i is even, then X[i] = z * X and Y[i] = z * Y. if i is odd, then X[i] = 2*z * X and Y[i] = z * Y.09
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9if i is even, then X[i] = z * X and Y[i] = z * Y. if i is odd, then X[i] = 2*z * X and Y[i] = z * Y.0
def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
9if i is even, then X[i] = z * X and Y[i] = z * Y. if i is odd, then X[i] = 2*z * X and Y[i] = z * Y.13
if i is even, then X[i] = z * X and Y[i] = z * Y. if i is odd, then X[i] = 2*z * X and Y[i] = z * Y.14
36def round_result[]:
num_rounds = 0
user_lives = 10
while num_rounds < 8 and user_lives > 0:
user_pick = user_choice[]
cpu_pick = cpu_choice[]
if [cpu_pick % 2 == 0] and [user_pick == "Even"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
if [cpu_pick % 2 == 0] and [user_pick == "Odd"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Even"]:
print [f'You have {user_lives - cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives - cpu_pick
if [cpu_pick % 2 != 0] and [user_pick == "Odd"]:
print [f'You have {user_lives + cpu_pick} lives left']
num_rounds += 1
user_lives = user_lives + cpu_pick
3 def winner[]:
user_won = user_lives > 0 and num_rounds == 8
cpu_won = user_lives < 0
game = round_result[]
while game:
if user_won is True:
print ['You won']
if cpu_won is True:
print ['Cpu won']
if i is even, then X[i] = z * X and Y[i] = z * Y.
if i is odd, then X[i] = 2*z * X and Y[i] = z * Y.
01O[1]
Auxiliary Space: O[1]