




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
In this project, we are going to code the classic game of Rock,. Paper, Scissors. The player will start off by typing in a choice of rock, paper or scissors ...
Typology: Exercises
1 / 8
This page cannot be seen from the preview
Don't miss anything!
Next page
Previous | 2 | Next page EduBlocks is a free tool that helps anyone learn how to code with text-based languages like Python, using familiar block coding as used in Scratch. In this project, we are going to code the classic game of Rock, Paper, Scissors. The player will start off by typing in a choice of rock, paper or scissors, then the computer will also make a selection at random, displaying whether you have won, tied or lost that round and you will be able to see what block coding looks like in Python coding language.. This project is designed for EduBlocks 4.0. Hope you enjoy the project!
Previous | 4 | Next page Step 2 For the next part, we use statements and variables to show what the outcome will print during the game. Remember, all of the code we are adding is still contained inside the while true: loop. Block code Python code
Previous | 5 | Next page Step 3 As both the player and computer have now made their choices, we need to code the different possible outcomes of the game to decide who the winner is using the if, elif and else blocks. The first if block covers the outcome for a draw, if both the player and computer chose the same object then we can declare a draw. The next elif and else blocks show the possible outcomes if the player chooses rock and we can compare against the different variations of the computers choice. Remember, all of the code we are adding is still contained inside the loop. Block code Python code
Previous | 7 | Next page Step 5 This is then the end of your code and you are then ready to play your Rock, Paper, Scissors game!
Previous | 8 | Barclays Bank UK PLC is authorised by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and the Prudential Regulation Authority (Financial Services Register No. 759676).Registered in England, Registered No.9740322. Registered Office 1 Churchill Place, London E145HP.