Start adding levels

master
BodgeMaster 2023-01-06 15:11:30 +01:00
parent ab0912b968
commit c59f7d7e39
11 changed files with 291 additions and 0 deletions

22
levels/0.json Normal file
View File

@ -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": [
]
}

24
levels/1.json Normal file
View File

@ -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": [
]
}

24
levels/2.json Normal file
View File

@ -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": [
]
}

25
levels/3.json Normal file
View File

@ -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": [
]
}

25
levels/4.json Normal file
View File

@ -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": [
]
}

25
levels/5.json Normal file
View File

@ -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": [
]
}

25
levels/6.json Normal file
View File

@ -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": [
]
}

24
levels/7.json Normal file
View File

@ -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<!I have cookie>(fix_that)",
"allowed commands": [
"step",
"while"
],
"allowed conditions": [
"in front of wall"
]
}

27
levels/8.json Normal file
View File

@ -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"
]
}

35
levels/9.json Normal file
View File

@ -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"
]
}

35
levels/default.json Normal file
View File

@ -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"
]
}