How do I reset my code?

Sometimes, you just want to start a problem from the beginning. You might have made a mistake in your code, or you might have completed the problem a long time ago and want to try it again. 

For most problems, you can simply to delete the code in the window manually. Just highlight the code and delete! This way, you'll still keep the history of your code, and your past submissions, which you can load at any time in the Submissions window (the bottom right section of your screen). 

What if the problem included prefilled code? 

Some of the problems on Grok include prefilled code or data files. In this case, deleting the code in your code editor won't help, because then you'll be missing the prefilled information!

In this case, use the Reset button. This will reset all files back to the original state:

If you're working with multiple files and you only want to reset one, you can do this by clicking the '>' icon next to the filename and selecting 'Reset':

Note that neither of these will cause you to lose your history, so if you do make a mistake just 'Load' an old submission or saved code from the 'Submissions' tab down the bottom.

I'm a teacher and want to demo a problem to students

We often get questions from teachers about demonstrating a problem to students. You want to start from a blank code editor for your demo, but if you've already completed the problem, your saved code is in the code editor.

To do this, the easiest way is to use the large 'Reset' button on the top-bar as described above. At any time you'll be able to load a previous submission or save you've made from the Submissions tab.

Still need help? Contact Us Contact Us