Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
30
Task/Penneys-game/MiniScript/penneys-game.mini
Normal file
30
Task/Penneys-game/MiniScript/penneys-game.mini
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
randomTorH = function()
|
||||
if rnd < 0.5 then return "T" else return "H"
|
||||
end function
|
||||
|
||||
if rnd < 0.5 then
|
||||
playerSeq = input("Input your sequence (e.g. HTH): ").upper
|
||||
if playerSeq[1] == "T" then compSeq = "H" else compSeq = "T"
|
||||
compSeq = compSeq + playerSeq[:2]
|
||||
print "I choose: " + compSeq
|
||||
else
|
||||
compSeq = randomTorH + randomTorH + randomTorH
|
||||
print "I choose: " + compSeq
|
||||
playerSeq = input("Input your sequence (e.g. HTH): ").upper
|
||||
end if
|
||||
|
||||
print "Here we go..."
|
||||
seq = ""
|
||||
while true
|
||||
flip = randomTorH
|
||||
print flip
|
||||
seq = seq + flip
|
||||
if seq[-3:] == playerSeq then
|
||||
print "You win!"
|
||||
break
|
||||
else if seq[-3:] == compSeq then
|
||||
print "I win!"
|
||||
break
|
||||
end if
|
||||
wait
|
||||
end while
|
||||
Loading…
Add table
Add a link
Reference in a new issue