aroberge / reeborg

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

Recursive puzzles #411

Open aroberge opened 6 years ago

aroberge commented 6 years ago

Introduce recursive puzzles, similar to those found on http://www.robozzle.com and other similar sites.

Number collections based on the number of recursive functions; thus something like

etc.

The first few puzzles should have some somewhat detailed explanation in the Description editor; thus they would need to be replicated for each human language. Afterwards, the description should be reduced to the desired "optimal" solution; something like:

def f1():
   # 1
   # 2
   # 3

def f2():
   # 1
   # 2

indicating how many lines of code need to be written (in the optimal case) ... and nothing else.

Introduce a global function, something like RUR.set_logic_globals() that could put in the window namespace the required functions, since turn_right() is not defined. Have this function be called in the Onload part of the editor. This function could then be updated, when needed, to add languages other then French and English when they become available - all this, without having to edit every single world (only the tutorial ones).

Plan to have the code run in the Post editor via the line

f1()

and have worlds marked with "badges" when successful.