Rock, Paper, Scissors With Python: A Command Line Game (Summary)
Congratulations! You just finished coding a game in Python! You now know how to create rock paper scissors from scratch, and you’re able to expand the number of possible actions in your game with minimal effort.
In this course, you:
- Coded your own rock paper scissors game
- Took in user input with
input()
- Played several games in a row using a
while
loop - Cleaned up your code with
IntEnum
and functions - Described more complex rules with a dictionary
- Learned that lizards poison Spock
Congratulations, you made it to the end of the course! What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in the discussion section and let us know.
00:00
In the previous lesson, I showed you how to use IntEnum
in your code and added a lizard and Spock to your rock paper scissors game. In this lesson, I’ll wrap everything up with a quick summary.
00:13
Writing games is a fun way to get practice writing code. In this course, you implemented a text-based version of rock paper scissors. You asked a user for input and validated it, looped your code to allow repeated plays, added a show_winner()
function to determine who won, simplified your show_winner()
function by replacing some conditional logic with a data representation stored in a dict, used enumerations to help avoid spelling errors—one more time, s-c-i-s-s-o-r-s. There, I did it that time. And finally, you saw how the right choices for the structure of your code can make future changes simpler to implement and maintain.
00:56 I hope you found value in this course. Thanks for your attention. Prosper and live long… No, wait. That’s not right.
stephanduesterhoeft on March 29, 2023
Thx Chris. That was fun!
Become a Member to join the conversation.
dngrant on Sept. 29, 2021
Outstanding Chris. Thank you and the RP team for putting this together. I’ve never dealt with
IntEnums
before. I will look for ways to put this into practice.