Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

start

Make new list


(1,2,3,4,5,6,7,8,9,10)

Make new list colour


(red, black, yellow) 

Create variable loop1


=1

player1card=
ranint(0,10)

player1color=
ranplace from list()

player2card=
ranint(0,10)

player2color=
ranplace from
listcolor()

yes
are the colours and numbers both matching 

no

are the numbers and colours both yes


different 

no

yes
are the numbers the same 

Text

ranquestion=
ran(1,20) ranquestion=
ran(1,20)
open txt file (qna) to
line( ranquestion) open txt file (qna) to
line( ranquestion)

does player2
input=txt(20+ranquestion) does player1
input=txt(20+ranquestion)

player2score=
player2score+1 player1score=
player2score+1

print("player 2 score
is now ", print("player 1 score
player2score) is now ",
player1score)

no

is loop1 = 10 print "skip turn"

print("all cards now


drawn")

print("player 1score
is", player1score)

print("player 2score
is", player2score)

no
is player1score > player2score

yes

print("PLAYER ONE print("PLAYER TWO


IS THE WINNER") IS THE WINNER")

open file (scores.txt) open file (scores.txt)

print new line of print new line of


scores.txt ("Player 1 won scores.txt ("Player 2 won
with ",player1score, with ",player2score,
points ) points )

close scores.txt
close scores.txt

terminate

You might also like