For those who don't know RPSLS is an expansion of rock paper scissors made popular by the T.V show The Big Bang Theory. I used Code Skulptor to write and execute my code, and it's saved through their website. To play a game of RPSLS, just scroll down to the end of the script. At the bottom there is a line that says:
rpsls("Spock")
To play the game just replace "Spock" with any of the 5 words (or just leave it as Spock). This is what you choose to throw. Then click the run button, which is a triangle shaped button in the upper left corner. The computer will randomly pick one of the five throws and show you who won.
Not the coolest thing in the world but it's a start.
Here's the link:
http://www.codeskulptor.org/#user26_SeeLm0xDrq_2.py
Not the coolest thing in the world but it's a start.
Here's the link:
http://www.codeskulptor.org/#user26_SeeLm0xDrq_2.py
No comments:
Post a Comment