Anonymous user
Rock-paper-scissors: Difference between revisions
m
no edit summary
mNo edit summary |
mNo edit summary |
||
Line 4,825:
Red [Purpose: "Implement a rock-paper-scissors game with weighted probability"]
prior: rejoin choices: ["r" "p" "s"]
] [
print ["AI Draws:" cchoice: random/only prior]▼
cwin: select "rpsr" pchoice
close: select "rspr" pchoice
print case [▼
▲ cchoice: random/only prior
▲ case [
▲ pchoice = cchoice [print "tie"]
▲ pindex = cindex [print "you lose"]
▲ true [print "you win"]
]
append prior
▲ unless lx = none [remove skip prior lx] ;removes what would have lost to player
]
</lang>
|