michellesun / roshambo Goto Github PK
View Code? Open in Web Editor NEWThree ways to do roshambo
Three ways to do roshambo
Exercise 09: More practice! ======= Introduction ------- Practice needs no introduction! Description ------- Here are some fairly standard programs every programmer must write in the process of learning. You've already written the guessing game and the temperature converter. Try to do the others: http://mypythonquiz.com/list.php http://people.csail.mit.edu/pgbovine/python/question.html?remove-dups#mode=edit http://people.csail.mit.edu/pgbovine/python/question.html?two-sum#mode=edit http://www.openbookproject.net/pybiblio/practice/wilson/ All of them are doable with your current skillset, but some will require more complex composition of everything you know. Try to get as far as you can! Rock, Paper, Scissors Description Rock, paper, scissors, also know as roshambo, is a simple child's game that is frequently used to settle disputes. In the game, a rock breaks the scissors, the scissors cut the paper, and the paper covers the rock. Each option is equally likely to prevail over another. If the players choose the same object a draw is declared and the game is repeated until someone prevails. For more information than you ever thought it was possible to collect about rock, paper, scissors, check out the Web page of the World RPS Society. In this computerized version the human player competes against the computer which chooses a rock, paper, or scissors randomly. The game proceeds until the human player quits the game or until a predetermined score is reached (e.g., 11 pts.) at which time the final tally is displayed. Solutions with fewer numbers of if statements are considered more elegant. Input The human player enters the number of points required for a win. During the play of the game the human player selects whether to play a rock, paper, or scissors by using the keyboard. The human player may also end the game by pressing the Control-D sequence at any time. (Ending the game early does not allow a winner to be determined if the human player is ahead.) Output The program will display the winner of each roshambo round along with the running score. At the conclusion of the game, the computer will display the overall winner and the final score. Sample session Welcome to Rock, Paper, Scissors! How many points are required for a win? 3 Choose (R)ock, (P)aper, or (S)cissors? r Human: rock Computer: paper Computer wins! Score: Human 0 Computer 1 Choose (R)ock, (P)aper, or (S)cissors? r Human: rock Computer: scissors Human wins! Score: Human 1 Computer 1 Choose (R)ock, (P)aper, or (S)cissors? p Human: paper Computer: paper A draw Score: Human 1 Computer 1 Choose (R)ock, (P)aper, or (S)cissors? s Human: scissors Computer: paper Human wins! Score: Human 2 Computer 1 Choose (R)ock, (P)aper, or (S)cissors? r Human: rock Computer: scissors Human wins! Final Score: Human 3 Computer 1 Going further Ask the user for his or her name and use the name while the game is playing. Display randomly chosen taunts when the computer wins. Consult the World RPS Society Web page and try to program the computer to use some strategy.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.