About
just a beginner
my python coding
from a guide
latest problem solved: ccc99s1: Card Game
code:
cards = 52
def noHigh(lst):
if 'jack' in lst:
return False
if 'queen' in lst:
return False
if 'king' in lst:
return False
if 'ace' in lst:
return False
return True
deck = []
for i in range(cards):
deck.append(input())
A = 0
B = 0
player = 'A'
for i in range(cards):
card = deck[i]
points = 0
remaining = cards - i - 1
if card == 'jack' and remaining >= 1 and noHigh(deck[i+1:i+2]):
points = 1
elif card == 'queen' and remaining >= 2 and noHigh(deck[i+1:i+3]):
points = 2
elif card == 'king' and remaining >= 3 and noHigh(deck[i+1:i+4]):
points = 3
elif card == 'ace' and remaining >= 4 and noHigh(deck[i+1:i+5]):
points = 4
if points > 0:
print(f'Player {player} scores {points} point(s).')
if player == 'A':
A = A + points
player = 'B'
else:
B = B + points
player = 'A'
print(f'Player A: {A} point(s).')
print(f'Player B: {B} point(s).')
CODE DONE NOW.
get coding already, you dmoj user
also sub to team joeri version 2 for roblox stuff and something like that