You might have heard of Python, it’s a type of programming language where you get to program websites and games. Today I have made a game, rock, paper, scissors, it might be familiar to you ^__^……
When you look at the right side of the screenshot, you would see the terminal, where I play the game by calling the program and start playing. On the left side, is the behind – the – scenes of the game, where I program the game to make it work the way it works. It was a bit challenging when I started this but when I finally finished the whole program, it was fun!
Here is the rest of the code for those who would want to experiment and have fun!!!
from random import randint
moves = [‘Rock’, ‘Paper’, ‘Scissors’]
def ask_move(player = False):
return moves.index(moves[int(raw_input(“Pick a move, 1: %s, 2: %s, 3: %s”
% (moves, moves, moves))) – 1]) + 1
return randint(1, 3)
def calculate_score(p1, p2):
movescore = p1 -p2
if movescore == 0:
elif movescore in (1, -2):
if __name__ == “__main__”:
print(“Welcome to the Rock, Paper, Scissors game!”)
one = ask_move(True)
two = ask_move()
break_ = raw_input(“Would you like to play again?\nEnter  if you would like to, else press enter.”)
if 1 == int(break_):
print(“Thank you for playing!”)
print(“Ok, here we go again\n”)
You guys will need to indent most of these. Python has a sort of rule where if the indentention isn’t proper, your code will not work. Experiment. Research. Have fun!