Share your repls and programming experiences

← Back to all posts
Rock! Paper! Scissors!
Lost0Soul

Test your Rock-Paper-Scissor skill against the all-knowing random library.

All feedbacks welcome!

Please sugget me more programs to make so i can improve and you can keep enjoying!

Note:
For rock you can use either "r" or "rock"
For paper you can use either "p" or "paper"
For scissor you can use either "s" or "scissor" and if you are dumb, you can also use "ScIsSoR"
Made in collab with- https://repl.it/@sanduioan2

Voters
Ishaant1
HamzaAkhtar2
narutouxumaki
Wilke000
LIAMKRUEGER
Pythonier
Roar123
BlueComet
sanduioan2
BilalAslam1
Comments
hotnewtop
Roar123

The graphics are really good! Here's an idea: assign consecutive numbers to each option, example rock : 1,paper : 2, scissors : 3. To avoid using an if statement for each possibility, you can compare the numerical difference between your guess and the computer guess. If it is either 1 or -2, then you win (with this list). 0 is tie and the computer wins the rest. Try it out!

shaunakg2011

there's a error on line 66: TabError: inconsistent use of tabs and spaces in indentation

Lost0Soul

I never saw it but i reindented the whole file

Imthebestthe

sorry, but looking at the code and the comments, It looks like you had a lot of potential in this piece of work. could you please just fix the IndentationError plz. thx

Lost0Soul

@Imthebestthe Can you tell where you are getting indentation error?

Imthebestthe

@Tanishqq
this is the new error I'm getting
File "main.py", line 66
elif cont == "n":
^
TabError: inconsistent use of tabs and spaces in indentation

Wilke000

There is an error on line 71, i think u need : after () @Tanishqq

Wilke000

But don't trust me, @IndyCarter is not expert

Lost0Soul

You're wrong. sys.exit() is a function and not a loop or something that i need ":" after @IndyCarter

Wilke000

Ok but remember I said don't trust me! @Tanishqq

Lost0Soul
Wilke000
RITIKSONI

great buddy

Lost0Soul

@RITIKSONI Thanks!

PravinPK

why doesn't the program terminates after entering n

Lost0Soul

@PravinPK Should from now

Lost0Soul

@Tanishqq turns out i had forgot to put in sys.exit()

PAYTONPERKINS

I lost because i put scissors instead of scissor lol

Lost0Soul

Oof

BlueComet

If anyone doesn't want to play Rock Paper Scissors with me I know where to look

Lost0Soul
Pythonier

Looks great!

BlueComet

Great job this is so cool keep up the good work! :D

Lost0Soul

@iterate Thanks!