aroberge / reeborg

Enhanced Karel-the-robot clone
http://reeborg.ca/reeborg.html
Other
47 stars 36 forks source link

Click "run" at end of program reloads the world but does not run the Onload code. #415

Closed aroberge closed 6 years ago

aroberge commented 6 years ago

Like the subject says. This is important for worlds that are initialized with random values in the Onload code.

aroberge commented 6 years ago

After exploring this, it's actually a feature, not a bug! ;-)

Clicking run, instead of reload, after a program has ended allows to change the program but have it run in the exact same world. This could be useful when trying to figure out a special case for which a program is failing in a world that is randomly set.

I should document this as a feature.

aroberge commented 6 years ago

Upon further investigation, I've concluded that this would enable students to "cheat" by making it possible to write a custom solution to a specific world instance, bypassing the random choices made in the Onload code. With the recent addition of "badges", students might be tempted to cheat to show off their skills on some challenging program.

This behaviour came as being able to bypass clicking the reload button followed by the run button and simply clicking the run button was seen as something desirable from a user experience point of view. With the need to dynamically create a different world each time, it makes sense to reinstate the old behaviour and require a click on reload (to reinitialize the world), giving a good chance to look at the new configuration before clicking on run.