Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Rock, paper, scissors with EduBlocks, Exercises of Geology

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

2022/2023

Uploaded on 03/01/2023

sumaira
sumaira 🇺🇸

4.8

(57)

263 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Rock, paper,
scissors with
EduBlocks
Code Playground
Student workbook
Next page
pf3
pf4
pf5
pf8

Partial preview of the text

Download Rock, paper, scissors with EduBlocks and more Exercises Geology in PDF only on Docsity!

Rock, paper,

scissors with

EduBlocks

Code Playground

Student workbook

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!

Rock, paper, scissors with

EduBlocks

EduBlocks 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

Rock, paper, scissors with

EduBlocks

EduBlocks project

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

Rock, paper, scissors with

EduBlocks

EduBlocks project

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!

Rock, paper, scissors with

EduBlocks

EduBlocks project

Notes

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.

Code Playground