Ask coding questions

← Back to all posts
How do you restart your game???
LeoeE

Pleas someone help me!!!
I cant figureout how to make my game stat over again. Can someone show me a code i can use?

Answered by Vandesm14 [earned 5 cycles]
View Answer
Voters
LeoeE
Comments
hotnewtop
Vandesm14

Can you send me the link to your repl? I can't help you if you don't provide any code!

LeoeE
Vandesm14

@callmebk Add def start(): to the beginning of your code, and indent the entire file except for the first line by 1 tab. Then, add start() the end of the file twice and indent the first start() by 1 tab.

This will create a function around your game and run it when the repl starts and when the function ends.

LeoeE

@Vandesm14 I CANT MAKE IT WOOOOORK

Vandesm14

@callmebk You didn't add the start function anywhere. Please share the proper repl so I know what you have tried.

Vandesm14

@callmebk You there?