Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

Forum Contest: Create a rock-paper-scissors game in Python

After you've watched the video, please read the details below carefully. I'm can't wait for your entries!

How to Enter: Create a game using Python that let's players play a game of rock-paper-scissors. The exact elements are up to you (rock-paper-scissors-lizard-spock anyone?) as are the play mechanics, but it should be runnable in the terminal using Python 3. Entries will be judged based on code and design.

Post your entries as either a GitHub repo or a gist.

Due Date: All entries must be submitted by September 21st at 11:45pm EST. Here's a timezone chart so you can see what time that is for your locale.

Prize: One winner will receive a free month of Treehouse Pro on us! :) We'll announce the winner on September 22nd and reveal the next contest.

Can't wait!!! I just started Sublime!! Getting HYPED for it!!! AHHHHHHHHH Sorry for my excitement.

Good luck everybody. Wish I could submit an entry for this contest but unfortunately I am not ready at this time. Cheers everybody!

Samuel Webb
Samuel Webb
25,370 Points

Interesting. This should be fun.

I'll try to make an entry, i'm totally new to these contests.

it's only in python 3, or can do it in python 2.7.x

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

Walter Cordero when I test these I'll be running it against Python 3.4.1. So you'll probably want to write it with Python 3 in mind.

thank you Kenneth Love

Never coded a line of Python in my life, but I'm going to give this a try.

Here is my submission. A basic rock, paper, scissor, lizard, spock game.
https://gist.github.com/robboggs/2f85dd29512075bd9a27

18 Answers

Simon Klit
Simon Klit
1,686 Points

Introducing: RopasciRPG!

Rock-paper-scissors meet role-playing game in the Python console! Try it out now!

EDIT: For those of you who tried it out, and thought it too hard: I have lowered the difficulty to bring balance to the lands of Ropasci. Also, everyone starts with a Health Potion now!

RopasciRPG features:

  • Levels and experience points
  • Currency and shops
  • 3 weapon tiers
  • 30 personal and unique mobs with slight weapon preferences and unique taunts!
  • Saving and loading
  • 4 different player races to choose from
  • 2 different player genders (whaat!?) to choose from
  • A kingdom with a king, lordlings and lords

Enjoy this revolutionary game, which uses some of the old and reknowned Pokémon text in the fighting sequences.

And, here's the link: https://github.com/simonklit/RopasciRPG

I hope you enjoy!

Hey Simon, I tested it out, it doesn't work!

Simon Klit
Simon Klit
1,686 Points

Hey Max,

I noticed that you said the same to Juan above. I suspect that you running Python 2.

Please note that this game is only Python 3 compatible. You can download it right here: https://www.python.org/downloads/

Juan Martin
Juan Martin
14,335 Points

Hahaha real nice work man! Awesome! Great structure! And let me tell you, using Pokémon-style text for the fighting sequences is totally a GREAT idea haha! Congrats :)

Simon Klit
Simon Klit
1,686 Points

Hahah, many thanks Juan! I did hope people would like it. :)

Reuben Varzea
Reuben Varzea
23,182 Points

You're insane! :) Love the "company" version. lol

Juan Martin
Juan Martin
14,335 Points

Hahahaha thanks my friend :)

Samuel Webb
Samuel Webb
25,370 Points

Wow! I would happily take a loss to this. You're amazing :)

Juan Martin
Juan Martin
14,335 Points

Thanks my friend! I hope everyone enjoys playing my game hehe :)

I tryed this, and it didn't work.

Juan Martin
Juan Martin
14,335 Points

Hello Max Ungless !

I think you're doing something wrong. It has worked for everybody (the code works lol) :)

This code works on python 3.x. If you need any help, please let me know.

Regards.

Simon Klit
Simon Klit
1,686 Points

Haha, love the company version!

Beat it first try by going Google all the way. Obviously reflects the real world ;)

Juan Martin
Juan Martin
14,335 Points

Hahaha thanks, yes it is. All real world based facts :D!

Well in my PATH I have Python34, yet it is still running Python27.

I made a post on StackOverFlow http://stackoverflow.com/questions/25919985/how-do-i-update-the-path-to-be-python-3-4-when-python-2-7-is-still-showing-up-w

Samuel Webb
Samuel Webb
25,370 Points

Here is my entry. Gun Laser Lightsaber. I think this is my first time actually participating in one of these. https://github.com/salexzee/Gun-Laser-Lightsaber

Here's my entry: https://gist.github.com/anonymous/b86a7af2c38c85dbc7a0

V2: https://gist.github.com/anonymous/367b2b344221c9d08d5e

I hope it's not too far past Rock Paper Scissors :P Either way, I learned a lot building it. Play with 2 people :)

Here's an updated version, if that's allowed: https://gist.github.com/anonymous/367b2b344221c9d08d5e

Now includes scores, option to exit at any point, and option to replay.

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

Wow! Thanks for all of the submissions, everyone! I didn't expect to get this many at all!

With so many submissions, it was really hard to pick, but, in the end, Simon Klit's RPG won the contest! Congrats, Simon and keep an eye out for more Python contests in the future.

Chris McKnight
Chris McKnight
11,045 Points

I love that the winning entry was marked as the best answer for this contest.

Simon Klit
Simon Klit
1,686 Points

Hooray! Thanks a lot!

Juan Martin
Juan Martin
14,335 Points

Congrats my friend Simon Klit ! You did G-R-E-A-T! You deserved it! Excellent and very creative way to do a Rock-Paper-Scissors based Game :) I hope to see you again in the next contest hehe :D

Here's my entry all set up on github for anyone to play!

Rock, Paper, Scissors, Lizard, Spock!

https://github.com/thenetimp/rpsls

Chris McKnight
Chris McKnight
11,045 Points

Rock, Paper, Scissors, Lizard, Spock with scoring

https://github.com/cmckni3/rpsls

Marko Koron
Marko Koron
20,658 Points

Here it is RPS_1983. Download the txt files in the same folder of the .py file as well.

David Bouchare
David Bouchare
9,224 Points

Not fully functional at all (turns don't work and other issues) but here it is: https://gist.github.com/dabcoder/dbb9325301ff911598f1. Feedback always welcome.

K.D. Harris
K.D. Harris
11,223 Points

Here is my entry: https://gist.github.com/kd-harris/165305df32504df07c31

I haven't done anything in Python in a long time, but had a good time creating this! :)

Even though this entry has nothing to do with Rock Paper Scissors, I thought I might as well post this project. https://gist.github.com/anonymous/899cfd1a5b1d31aa040b