KS4 Puzzle 6 Python – subroutines

Code / algorithm aim

The program should declare a subroutine that rolls a dice. If the dice rolls a 6 the user should be told that they win. If the user rolls a 5 the user should be told that they were close. If the user rolls anything else they should be told the number rolled and that they have lost.

The user should also be asked if they want to roll again – if they do the dice should be rolled again if they do not the game should end.

WAIT! You aren’t logged in.
By logging in you can earn CS points and keep track of what you have done. Do you want to:

Login    

Join Now



Instructions (click to view)

All the code that you need has been given below. Simply organise the code blocks into the correct order so that the code follows the algorithm aim above.

You can organise the blocks by clicking on the arrows on the right hand side to place them above or below the other blocks.