Rock-paper-scissors: Difference between revisions

Content added Content deleted
(computer, operator and opponent)
Line 235: Line 235:
end.
end.
smoutput ' I choose ',choice {::;:'. Rock Paper Scissors'
smoutput ' I choose ',choice {::;:'. Rock Paper Scissors'
smoutput (r=. 3 | choice-playerchoice) {:: 'Draw';'I win';'You win'
smoutput (wintype=. 3 | choice-playerchoice) {:: 'Draw';'I win';'You win'
outcomes=. outcomes+0 1 2 = r
outcomes=. outcomes+0 1 2 = wintype
rps=. rps+1 2 3=playerchoice
rps=. rps+1 2 3=playerchoice
choice=. 1+3|(?0) I.~ (}:%{:)+/\ 0, rps
choice=. 1+3|(?0) I.~ (}:%{:)+/\ 0, rps
Line 265: Line 265:
My wins: 4
My wins: 4
Your wins: 1</lang>
Your wins: 1</lang>



=={{header|Java}}==
=={{header|Java}}==