Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

1 line rock paper scissors python

winner = (3 + player1 - player2) % 3;
# Rock=0, Paper=1, Scissors=2
# 1 if player1 wins, 2 if player2 wins, 0 if draw
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #line #rock #paper #scissors #python
ADD COMMENT
Topic
Name
6+3 =