diff --git a/levels/0.json b/levels/0.json new file mode 100644 index 0000000..5dd43c7 --- /dev/null +++ b/levels/0.json @@ -0,0 +1,22 @@ +{ + "field": [ + " _________________ ", + "| |", + "| |", + "| |", + "| $ |", + "| |", + "| |", + "| |", + "| |", + " ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ " + ], + "start position": [ 4, 4], + "start heading": "east", + "text": "→ This should show up as a roughly square box with a cursor and a $ inside it.\n→ The cursor is indicated by one of these: Λ V > <\n'#' represents a wall, 'ó' represents an apple and '$' represents the goal\nthat is to be reached.\n→ With every level, there is a list of available commands and conditions\nwhich can be used in that level.\n→ Step onto the goal to continue.", + "allowed commands": [ + "step" + ], + "allowed conditions": [ + ] +} diff --git a/levels/1.json b/levels/1.json new file mode 100644 index 0000000..7baec84 --- /dev/null +++ b/levels/1.json @@ -0,0 +1,24 @@ +{ + "field": [ + " _________________ ", + "| |", + "| ### |", + "| #$# |", + "| #### # |", + "| # # |", + "| ###### |", + "| |", + "| |", + " ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ " + ], + "start position": [ 4, 5], + "start heading": "east", + "text": "[Level 1]\n\nΛV has three commands to control movement:\n→ The `step` command moves the cursor one step in the direction it is pointing.\n→ The `left` and `right` commands turn the cursor 90° in that direction.", + "allowed commands": [ + "step", + "left", + "right" + ], + "allowed conditions": [ + ] +} diff --git a/levels/2.json b/levels/2.json new file mode 100644 index 0000000..236d81a --- /dev/null +++ b/levels/2.json @@ -0,0 +1,24 @@ +{ + "field": [ + " _________________ ", + "| $ |", + "|#################|", + "| |", + "| |", + "| |", + "| |", + "| |", + "| |", + " ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ " + ], + "start position": [ 1, 1], + "start heading": "east", + "text": "[Level 2]\n\nThat's quite simple but it can get tedious really quickly.", + "allowed commands": [ + "step", + "left", + "right" + ], + "allowed conditions": [ + ] +} diff --git a/levels/3.json b/levels/3.json new file mode 100644 index 0000000..d641b48 --- /dev/null +++ b/levels/3.json @@ -0,0 +1,25 @@ +{ + "field": [ + " _________________ ", + "| $ |", + "|#################|", + "| |", + "| |", + "| |", + "| |", + "| |", + "| |", + " ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ " + ], + "start position": [ 1, 1], + "start heading": "east", + "text": "[Level 3]\n\nInstead, we can use a loop to repeat things.\n\nΛV has a simplified \"repeat\" loop for demonstration purposes.\nHere is an example of how to use it: repeat<6>(left)", + "allowed commands": [ + "step", + "left", + "right", + "repeat" + ], + "allowed conditions": [ + ] +} diff --git a/levels/4.json b/levels/4.json new file mode 100644 index 0000000..7947fb4 --- /dev/null +++ b/levels/4.json @@ -0,0 +1,25 @@ +{ + "field": [ + " _________________ ", + "| # |", + "| # |", + "|# # |", + "| # # |", + "| # # |", + "| # # |", + "| # # |", + "| # $# |", + " ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ " + ], + "start position": [ 1, 1], + "start heading": "east", + "text": "[Level 4]\n\nYou can put multiple commands inside a loop.\nThis can be used to repeat a sequence of commands.\n\nExample: repeat<10>(left step left)", + "allowed commands": [ + "step", + "left", + "right", + "repeat" + ], + "allowed conditions": [ + ] +} diff --git a/levels/5.json b/levels/5.json new file mode 100644 index 0000000..c128de4 --- /dev/null +++ b/levels/5.json @@ -0,0 +1,25 @@ +{ + "field": [ + " _________________ ", + "| # #$# |", + "| # # # |", + "| # # # |", + "| # # # |", + "| # # # |", + "| # # # |", + "| ###### # |", + "| # |", + " ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ " + ], + "start position": [ 1, 1], + "start heading": "south", + "text": "[Level 5]\n\nYou can even put loops inside other loops.\n\nExample: repeat<10>(step repeat<3>(left))", + "allowed commands": [ + "step", + "left", + "right", + "repeat" + ], + "allowed conditions": [ + ] +} diff --git a/levels/6.json b/levels/6.json new file mode 100644 index 0000000..c4c9858 --- /dev/null +++ b/levels/6.json @@ -0,0 +1,25 @@ +{ + "field": [ + " _________________ ", + "| # # # # $|", + "| # # # # # # # ##|", + "| # # # # # # # # |", + "| # # # # # # # # |", + "| # # # # # # # # |", + "| # # # # # # # # |", + "| # # # # # # # # |", + "| # # # # |", + " ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ " + ], + "start position": [ 1, 1], + "start heading": "east", + "text": "[Level 6]\n\nLet's do that again but bigger...", + "allowed commands": [ + "step", + "left", + "right", + "repeat" + ], + "allowed conditions": [ + ] +} diff --git a/levels/7.json b/levels/7.json new file mode 100644 index 0000000..f1818ab --- /dev/null +++ b/levels/7.json @@ -0,0 +1,24 @@ +{ + "field": [ + " _________________ ", + "| $ |", + "| |", + "| |", + "| |", + "| |", + "| |", + "| |", + "| |", + " ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ " + ], + "start position": [ 6, 8], + "start heading": "north", + "text": "[Level 7]\n\nNow in the real world, loops usually don't run a predefined number of times.\nOne type of loops found in most programming languages is the \"while loop\".\nIt runs while a given condition is true. Conditions can be negated by adding !\nin front of them.\nExample: while(fix_that)", + "allowed commands": [ + "step", + "while" + ], + "allowed conditions": [ + "in front of wall" + ] +} diff --git a/levels/8.json b/levels/8.json new file mode 100644 index 0000000..016dd3f --- /dev/null +++ b/levels/8.json @@ -0,0 +1,27 @@ +{ + "field": [ + " _________________ ", + "| # |", + "| # ############# |", + "| # # # |", + "| # #$ # # |", + "| # ########### # |", + "| # # |", + "| ############### |", + "| |", + " ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ " + ], + "start position": [ 1, 1], + "start heading": "south", + "text": "Let's do the same thing but more complex...", + "allowed commands": [ + "step", + "left", + "right", + "while" + ], + "allowed conditions": [ + "in front of wall", + "goal reached" + ] +} diff --git a/levels/9.json b/levels/9.json new file mode 100644 index 0000000..d3acc37 --- /dev/null +++ b/levels/9.json @@ -0,0 +1,35 @@ +{ + "field": [ + " _________________ ", + "| |", + "| |", + "| |", + "| |", + "| |", + "| |", + "| |", + "| |", + " ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ " + ], + "start position": [ 1, 1], + "start heading": "east", + "text": "TODO: Tell the player that loops will only check their condition at the start of the loop", + "allowed commands": [ + "step", + "left", + "right", + "take", + "repeat", + "while", + "if" + ], + "allowed conditions": [ + "facing north", + "facing south", + "facing east", + "facing west", + "in front of wall", + "goal reached", + "on apple" + ] +} diff --git a/levels/default.json b/levels/default.json new file mode 100644 index 0000000..2146a64 --- /dev/null +++ b/levels/default.json @@ -0,0 +1,35 @@ +{ + "field": [ + " _________________ ", + "| |", + "| |", + "| |", + "| |", + "| |", + "| |", + "| |", + "| |", + " ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ " + ], + "start position": [ 1, 1], + "start heading": "east", + "text": "", + "allowed commands": [ + "step", + "left", + "right", + "take", + "repeat", + "while", + "if" + ], + "allowed conditions": [ + "facing north", + "facing south", + "facing east", + "facing west", + "in front of wall", + "goal reached", + "on apple" + ] +}