Rock, paper, scissors tournament

In the previous chapter, we created a program for this game without using functions. We’ll implement it using functions in this lesson to show the difference between the two implementations. Ultimately, we’ll see how neat and efficient the code becomes with functions!

Previous implementation

In this game, two players individually select “rock,” “paper,” or “scissors” by typing r for rock, p for paper, or s for scissors. The winner is the one whose choice dominates the other. We won’t discuss the game’s rules because we already saw them in this lesson.

Get hands-on with 1200+ tech skills courses.