group levels into chapters

This commit is contained in:
Crispy 2024-12-22 16:39:40 +01:00
parent ff69b967dd
commit 42dfe4fac7
22 changed files with 236 additions and 210 deletions

View file

@ -1,11 +0,0 @@
{
"id": "output",
"sort_order": 11,
"name": "Zero",
"description": "learn how to output data",
"init_board": "\n o \n\n I\n\n",
"stages": [{
"input": [],
"output": [0]
}]
}

View file

@ -1,10 +0,0 @@
{
"id": "digits",
"sort_order": 12,
"name": "Digits",
"description": "place digits and use number keys to assign them values",
"stages": [{
"input": [],
"output": [4, 8, 16]
}]
}

View file

@ -1,11 +0,0 @@
{
"id": "loop",
"sort_order": 13,
"name": "Loop",
"description": "repeated output",
"init_board": "\n \n o\n\n\n\n ^ \n\n",
"stages": [{
"input": [],
"output": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}]
}

View file

@ -1,16 +0,0 @@
{
"id": "copy_input",
"sort_order": 14,
"name": "Copy Cat",
"description": "read input and output the same thing",
"stages": [{
"input": "Hello, world!",
"output": "Hello, world!"
},{
"input": "Meow!",
"output": "Meow!"
},{
"input": "there really isn't much point to more than 2 stages, but here we are",
"output": "there really isn't much point to more than 2 stages, but here we are"
}]
}

View file

@ -1,13 +0,0 @@
{
"id": "copy_odd",
"sort_order": 15,
"name": "Odd Cat",
"description": "copy only the odd numbers from the input",
"stages": [{
"input": [1, 2, 3, 4, 5, 6, 7],
"output": [1, 3, 5, 7]
},{
"input": [112, 92, 51, 79, 112, 96, 84, 59, 195, 208, 137, 196, 68, 204, 82, 148, 251, 56, 105, 38, 63, 204, 240, 220, 180, 54, 211, 17, 82, 17, 181, 43],
"output": [51, 79, 59, 195, 137, 251, 105, 63, 211, 17, 17, 181, 43]
}]
}

View file

@ -1,13 +0,0 @@
{
"id": "count_fives",
"sort_order": 23,
"name": "Fives",
"description": "count how many fives are in the input",
"stages": [{
"input": [6, 5, 5, 3, 5, 0],
"output": [3]
},{
"input": [182, 236, 71, 5, 5, 242, 29, 99, 19, 230, 217, 5, 67, 5, 223, 224, 70, 243, 3, 74, 242, 5, 171, 31, 96, 5, 169, 70, 5, 163, 72, 5, 172, 148, 5, 208, 28, 220, 17, 184, 172, 238, 5, 105, 119, 5, 106, 100, 73, 53, 42, 221, 155, 5, 74, 100, 161, 36, 16, 239, 193, 164, 64, 162, 222, 155, 107, 14, 45, 52, 159, 31, 199, 124, 129, 0],
"output": [12]
}]
}

View file

@ -1,13 +0,0 @@
{
"id": "list_length",
"sort_order": 22,
"name": "Length",
"description": "count how many numbers are in the input, until the first zero",
"stages": [{
"input": [1, 87, 9, 0],
"output": [3]
},{
"input": [182, 236, 71, 5, 5, 242, 29, 99, 19, 230, 217, 5, 67, 5, 223, 224, 70, 243, 3, 74, 242, 5, 171, 31, 96, 5, 169, 70, 5, 163, 72, 5, 172, 148, 5, 208, 28, 220, 17, 184, 172, 0],
"output": [41]
}]
}

View file

@ -1,13 +0,0 @@
{
"id": "null_separation",
"sort_order": 21,
"name": "Null Separation",
"description": "output everything after the first zero in the input data",
"stages": [{
"input": "9834726\u0000Hello, worlg!",
"output": "Hello, worlg!"
},{
"input": "aonmbgoirf\u0000this is just to make sure you don't hardcode the output for a better score",
"output": "this is just to make sure you don't hardcode the output for a better score"
}]
}

View file

@ -1,13 +0,0 @@
{
"id": "reverse_input",
"sort_order": 24,
"name": "Reverse",
"description": "read input until zero and output the same thing in reverse",
"stages": [{
"input": "woem\u0000",
"output": "meow"
},{
"input": "tnropmi yrev\u0000",
"output": "very impornt"
}]
}

View file

@ -1,13 +0,0 @@
{
"id": "ascii_to_lower",
"sort_order": 35,
"name": "Lowercase",
"description": "Convert text to lowercase",
"stages": [{
"input": "FROM THE MOMENT I UNDERSTOOD THE WEAKNESS OF MY FLESH, IT DISGUSTED ME",
"output": "from the moment i understood the weakness of my flesh, it disgusted me"
},{
"input": "I CraVeD tHE strEnGTH AND CerTAinTy oF STeeL",
"output": "i craved the strength and certainty of steel"
}]
}

View file

@ -1,13 +0,0 @@
{
"id": "output_decimal",
"sort_order": 31,
"name": "Numbers",
"description": "Convert input numbers to text, separated by spaces (32)\n'0' = 48, '1' = 49, '2' = 50, and so on",
"stages": [{
"input": [8, 7, 1],
"output": "8 7 1"
},{
"input": [85, 114, 32, 103, 97, 121, 58, 51],
"output": "85 114 32 103 97 121 58 51"
}]
}

View file

@ -1,13 +0,0 @@
{
"id": "parse_decimal",
"sort_order": 33,
"name": "Numbers 2",
"description": "Convert input numbers from text, separated by spaces (32)\n'0' = 48, '1' = 49, '2' = 50, and so on",
"stages": [{
"input": "1 2 3",
"output": [1, 2, 3]
},{
"input": "85 114 32 103 97 121 58 51",
"output": [85, 114, 32, 103, 97, 121, 58, 51]
}]
}

62
levels/chapter_01.json Normal file
View file

@ -0,0 +1,62 @@
{
"title": "1. Introduction",
"levels": [
{
"id": "output",
"name": "Zero",
"description": "learn how to output data",
"init_board": "\n o \n\n I\n\n",
"stages": [{
"input": [],
"output": [0]
}]
},
{
"id": "digits",
"name": "Digits",
"description": "place digits and use number keys to assign them values",
"stages": [{
"input": [],
"output": [4, 8, 16]
}]
},
{
"id": "loop",
"name": "Loop",
"description": "repeated output",
"init_board": "\n \n o\n\n\n\n ^ \n\n",
"stages": [{
"input": [],
"output": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}]
},
{
"id": "copy_input",
"name": "Copy Cat",
"description": "read input and output the same thing",
"stages": [{
"input": "Hello, world!",
"output": "Hello, world!"
},{
"input": "Meow!",
"output": "Meow!"
},{
"input": "there really isn't much point to more than 2 stages, but here we are",
"output": "there really isn't much point to more than 2 stages, but here we are"
}]
},
{
"id": "copy_odd",
"sort_order": 15,
"name": "Odd Cat",
"description": "copy only the odd numbers from the input",
"stages": [{
"input": [1, 2, 3, 4, 5, 6, 7],
"output": [1, 3, 5, 7]
},{
"input": [112, 92, 51, 79, 112, 96, 84, 59, 195, 208, 137, 196, 68, 204, 82, 148, 251, 56, 105, 38, 63, 204, 240, 220, 180, 54, 211, 17, 82, 17, 181, 43],
"output": [51, 79, 59, 195, 137, 251, 105, 63, 211, 17, 17, 181, 43]
}]
}
]
}

53
levels/chapter_02.json Normal file
View file

@ -0,0 +1,53 @@
{
"title": "2. List machines",
"levels": [
{
"id": "null_separation",
"name": "Null Separation",
"description": "output everything after the first zero in the input data",
"stages": [{
"input": "9834726\u0000Hello, worlg!",
"output": "Hello, worlg!"
},{
"input": "aonmbgoirf\u0000this is just to make sure you don't hardcode the output for a better score",
"output": "this is just to make sure you don't hardcode the output for a better score"
}]
},
{
"id": "count_fives",
"name": "Fives",
"description": "count how many fives are in the input",
"stages": [{
"input": [6, 5, 5, 3, 5, 0],
"output": [3]
},{
"input": [182, 236, 71, 5, 5, 242, 29, 99, 19, 230, 217, 5, 67, 5, 223, 224, 70, 243, 3, 74, 242, 5, 171, 31, 96, 5, 169, 70, 5, 163, 72, 5, 172, 148, 5, 208, 28, 220, 17, 184, 172, 238, 5, 105, 119, 5, 106, 100, 73, 53, 42, 221, 155, 5, 74, 100, 161, 36, 16, 239, 193, 164, 64, 162, 222, 155, 107, 14, 45, 52, 159, 31, 199, 124, 129, 0],
"output": [12]
}]
},
{
"id": "list_length",
"name": "Length",
"description": "count how many numbers are in the input, until the first zero",
"stages": [{
"input": [1, 87, 9, 0],
"output": [3]
},{
"input": [182, 236, 71, 5, 5, 242, 29, 99, 19, 230, 217, 5, 67, 5, 223, 224, 70, 243, 3, 74, 242, 5, 171, 31, 96, 5, 169, 70, 5, 163, 72, 5, 172, 148, 5, 208, 28, 220, 17, 184, 172, 0],
"output": [41]
}]
},
{
"id": "reverse_input",
"name": "Reverse",
"description": "read input until zero and output the same thing in reverse",
"stages": [{
"input": "woem\u0000",
"output": "meow"
},{
"input": "tnropmi yrev\u0000",
"output": "very impornt"
}]
}
]
}

41
levels/chapter_03.json Normal file
View file

@ -0,0 +1,41 @@
{
"title": "3. Text processing",
"levels": [
{
"id": "ascii_to_lower",
"name": "Lowercase",
"description": "Convert text to lowercase",
"stages": [{
"input": "FROM THE MOMENT I UNDERSTOOD THE WEAKNESS OF MY FLESH, IT DISGUSTED ME",
"output": "from the moment i understood the weakness of my flesh, it disgusted me"
},{
"input": "I CraVeD tHE strEnGTH AND CerTAinTy oF STeeL",
"output": "i craved the strength and certainty of steel"
}]
},
{
"id": "output_decimal",
"name": "Numbers",
"description": "Convert input numbers to text, separated by spaces (32)\n'0' = 48, '1' = 49, '2' = 50, and so on",
"stages": [{
"input": [8, 7, 1],
"output": "8 7 1"
},{
"input": [85, 114, 32, 103, 97, 121, 58, 51],
"output": "85 114 32 103 97 121 58 51"
}]
},
{
"id": "parse_decimal",
"name": "Numbers 2",
"description": "Convert input numbers from text, separated by spaces (32)\n'0' = 48, '1' = 49, '2' = 50, and so on",
"stages": [{
"input": "1 2 3",
"output": [1, 2, 3]
},{
"input": "85 114 32 103 97 121 58 51",
"output": [85, 114, 32, 103, 97, 121, 58, 51]
}]
}
]
}

View file

@ -1,6 +1,10 @@
{
"id": "sandbox",
"sort_order": 100000,
"name": "Sandbox",
"description": "make whatever you want here"
"title": "Sandbox",
"levels": [
{
"id": "sandbox",
"name": "Sandbox",
"description": "make whatever you want here"
}
]
}