Spaces:
Sleeping
Sleeping
Update blocks/c_blocks.json
Browse files- blocks/c_blocks.json +105 -105
blocks/c_blocks.json
CHANGED
@@ -1,105 +1,105 @@
|
|
1 |
-
{
|
2 |
-
"block_category": "C Blocks",
|
3 |
-
"description": "C blocks are shaped like the letter 'C'. They are used to loop or conditionally execute blocks that are placed within their opening, managing the flow of scripts.",
|
4 |
-
"blocks": [
|
5 |
-
{
|
6 |
-
"block_name": "repeat ()",
|
7 |
-
"block_type": "Control",
|
8 |
-
"block_shape": "C-Block",
|
9 |
-
"op_code": "control_repeat",
|
10 |
-
"functionality": "Repeats the blocks inside it a specified number of times.",
|
11 |
-
"inputs": [
|
12 |
-
{
|
13 |
-
"name": "times",
|
14 |
-
"type": "number"
|
15 |
-
}
|
16 |
-
],
|
17 |
-
"example_standalone": "repeat (10)",
|
18 |
-
"example_with_other_blocks": [
|
19 |
-
{
|
20 |
-
"script": "when [space v] key pressed\n repeat (10)\n move (10) steps\n wait (0.1) seconds\n end",
|
21 |
-
"explanation": "This script makes the sprite move 10 steps Ten times, with a short pause after each movement on spacebar pressed."
|
22 |
-
},
|
23 |
-
{
|
24 |
-
"script": "when [up arrow v] key pressed\n repeat (10)\n change y by (10)\n wait (0.1) seconds\n change y by (10)\n end",
|
25 |
-
"explanation": "This script makes the sprite jump, with a short pause after each movement on up arrow pressed."
|
26 |
-
}
|
27 |
-
]
|
28 |
-
},
|
29 |
-
{
|
30 |
-
"block_name": "forever",
|
31 |
-
"block_type": "Control",
|
32 |
-
"block_shape": "C-Block",
|
33 |
-
"op_code": "control_forever",
|
34 |
-
"functionality": "Continuously runs the blocks inside it.",
|
35 |
-
"inputs": null,
|
36 |
-
"example_standalone": "forever",
|
37 |
-
"example_with_other_blocks": [
|
38 |
-
{
|
39 |
-
"script": "when green flag clicked\n forever\n move (5) steps\n if on edge, bounce\n end",
|
40 |
-
"explanation": "This script makes the sprite move endlessly and bounce off the edges of the stage, creating continuous motion."
|
41 |
-
}
|
42 |
-
]
|
43 |
-
},
|
44 |
-
{
|
45 |
-
"block_name": "if <> then",
|
46 |
-
"block_type": "Control",
|
47 |
-
"block_shape": "C-Block",
|
48 |
-
"op_code": "control_if",
|
49 |
-
"functionality": "Executes the blocks inside it only if the specified boolean condition is true. [NOTE: it takes boolean blocks as input]",
|
50 |
-
"inputs": [
|
51 |
-
{
|
52 |
-
"name": "condition",
|
53 |
-
"type": "boolean"
|
54 |
-
}
|
55 |
-
],
|
56 |
-
"example_standalone": "if <touching [mouse-pointer v]?> then",
|
57 |
-
"example_with_other_blocks": [
|
58 |
-
{
|
59 |
-
"script": "forever\n if <touching [color (red) v]?> then\n stop [this script v]\n end",
|
60 |
-
"explanation": "This script continuously checks if the sprite is touching a red color, and if so, it stops the current script."
|
61 |
-
}
|
62 |
-
]
|
63 |
-
},
|
64 |
-
{
|
65 |
-
"block_name": "if <> then else",
|
66 |
-
"block_type": "Control",
|
67 |
-
"block_shape": "C-Block",
|
68 |
-
"op_code": "control_if_else",
|
69 |
-
"functionality": "Executes one set of blocks if the specified boolean condition is true, and a different set of blocks if the condition is false. [NOTE: it takes boolean blocks as input]",
|
70 |
-
"inputs": [
|
71 |
-
{
|
72 |
-
"name": "condition",
|
73 |
-
"type": "boolean"
|
74 |
-
}
|
75 |
-
],
|
76 |
-
"example_standalone": "if <score > (10)> then
|
77 |
-
"example_with_other_blocks": [
|
78 |
-
{
|
79 |
-
"script": "if <(score) > (10)> then\n say [You win!] for (2) seconds\nelse\n say [Keep trying!] for (2) seconds\nend",
|
80 |
-
"explanation": "This script checks the 'score'. If the score is greater than 10, it says 'You win!'; otherwise, it says 'Keep trying!'."
|
81 |
-
}
|
82 |
-
]
|
83 |
-
},
|
84 |
-
{
|
85 |
-
"block_name": "repeat until <>",
|
86 |
-
"block_type": "Control",
|
87 |
-
"block_shape": "C-Block",
|
88 |
-
"op_code": "control_repeat_until",
|
89 |
-
"functionality": "Repeats the blocks inside it until the specified boolean condition becomes true. [NOTE: it takes boolean blocks as input]",
|
90 |
-
"inputs": [
|
91 |
-
{
|
92 |
-
"name": "condition",
|
93 |
-
"type": "boolean"
|
94 |
-
}
|
95 |
-
],
|
96 |
-
"example_standalone": "repeat until <touching [edge v]?>",
|
97 |
-
"example_with_other_blocks": [
|
98 |
-
{
|
99 |
-
"script": "repeat until <touching [edge v]?>\n move (5) steps\nend",
|
100 |
-
"explanation": "This script makes the sprite move 5 steps repeatedly until it touches the edge of the stage."
|
101 |
-
}
|
102 |
-
]
|
103 |
-
}
|
104 |
-
]
|
105 |
-
}
|
|
|
1 |
+
{
|
2 |
+
"block_category": "C Blocks",
|
3 |
+
"description": "C blocks are shaped like the letter 'C'. They are used to loop or conditionally execute blocks that are placed within their opening, managing the flow of scripts.",
|
4 |
+
"blocks": [
|
5 |
+
{
|
6 |
+
"block_name": "repeat ()",
|
7 |
+
"block_type": "Control",
|
8 |
+
"block_shape": "C-Block",
|
9 |
+
"op_code": "control_repeat",
|
10 |
+
"functionality": "Repeats the blocks inside it a specified number of times.",
|
11 |
+
"inputs": [
|
12 |
+
{
|
13 |
+
"name": "times",
|
14 |
+
"type": "number"
|
15 |
+
}
|
16 |
+
],
|
17 |
+
"example_standalone": "repeat (10)",
|
18 |
+
"example_with_other_blocks": [
|
19 |
+
{
|
20 |
+
"script": "when [space v] key pressed\n repeat (10)\n move (10) steps\n wait (0.1) seconds\n end",
|
21 |
+
"explanation": "This script makes the sprite move 10 steps Ten times, with a short pause after each movement on spacebar pressed."
|
22 |
+
},
|
23 |
+
{
|
24 |
+
"script": "when [up arrow v] key pressed\n repeat (10)\n change y by (10)\n wait (0.1) seconds\n change y by (10)\n end",
|
25 |
+
"explanation": "This script makes the sprite jump, with a short pause after each movement on up arrow pressed."
|
26 |
+
}
|
27 |
+
]
|
28 |
+
},
|
29 |
+
{
|
30 |
+
"block_name": "forever",
|
31 |
+
"block_type": "Control",
|
32 |
+
"block_shape": "C-Block",
|
33 |
+
"op_code": "control_forever",
|
34 |
+
"functionality": "Continuously runs the blocks inside it.",
|
35 |
+
"inputs": null,
|
36 |
+
"example_standalone": "forever",
|
37 |
+
"example_with_other_blocks": [
|
38 |
+
{
|
39 |
+
"script": "when green flag clicked\n forever\n move (5) steps\n if on edge, bounce\n end",
|
40 |
+
"explanation": "This script makes the sprite move endlessly and bounce off the edges of the stage, creating continuous motion."
|
41 |
+
}
|
42 |
+
]
|
43 |
+
},
|
44 |
+
{
|
45 |
+
"block_name": "if <> then",
|
46 |
+
"block_type": "Control",
|
47 |
+
"block_shape": "C-Block",
|
48 |
+
"op_code": "control_if",
|
49 |
+
"functionality": "Executes the blocks inside it only if the specified boolean condition is true. [NOTE: it takes boolean blocks as input]",
|
50 |
+
"inputs": [
|
51 |
+
{
|
52 |
+
"name": "condition",
|
53 |
+
"type": "boolean"
|
54 |
+
}
|
55 |
+
],
|
56 |
+
"example_standalone": "if <touching [mouse-pointer v]?> then",
|
57 |
+
"example_with_other_blocks": [
|
58 |
+
{
|
59 |
+
"script": "forever\n if <touching [color (red) v]?> then\n stop [this script v]\n end",
|
60 |
+
"explanation": "This script continuously checks if the sprite is touching a red color, and if so, it stops the current script."
|
61 |
+
}
|
62 |
+
]
|
63 |
+
},
|
64 |
+
{
|
65 |
+
"block_name": "if <> then go else",
|
66 |
+
"block_type": "Control",
|
67 |
+
"block_shape": "C-Block",
|
68 |
+
"op_code": "control_if_else",
|
69 |
+
"functionality": "Executes one set of blocks if the specified boolean condition is true, and a different set of blocks if the condition is false. [NOTE: it takes boolean blocks as input]",
|
70 |
+
"inputs": [
|
71 |
+
{
|
72 |
+
"name": "condition",
|
73 |
+
"type": "boolean"
|
74 |
+
}
|
75 |
+
],
|
76 |
+
"example_standalone": "if <(score) > (10)> then go\n say [You win!]\nelse\n say [Keep trying!]\nend",
|
77 |
+
"example_with_other_blocks": [
|
78 |
+
{
|
79 |
+
"script": "if <(score) > (10)> then\n say [You win!] for (2) seconds\nelse\n say [Keep trying!] for (2) seconds\nend",
|
80 |
+
"explanation": "This script checks the 'score'. If the score is greater than 10, it says 'You win!'; otherwise, it says 'Keep trying!'."
|
81 |
+
}
|
82 |
+
]
|
83 |
+
},
|
84 |
+
{
|
85 |
+
"block_name": "repeat until <>",
|
86 |
+
"block_type": "Control",
|
87 |
+
"block_shape": "C-Block",
|
88 |
+
"op_code": "control_repeat_until",
|
89 |
+
"functionality": "Repeats the blocks inside it until the specified boolean condition becomes true. [NOTE: it takes boolean blocks as input]",
|
90 |
+
"inputs": [
|
91 |
+
{
|
92 |
+
"name": "condition",
|
93 |
+
"type": "boolean"
|
94 |
+
}
|
95 |
+
],
|
96 |
+
"example_standalone": "repeat until <touching [edge v]?>",
|
97 |
+
"example_with_other_blocks": [
|
98 |
+
{
|
99 |
+
"script": "repeat until <touching [edge v]?>\n move (5) steps\nend",
|
100 |
+
"explanation": "This script makes the sprite move 5 steps repeatedly until it touches the edge of the stage."
|
101 |
+
}
|
102 |
+
]
|
103 |
+
}
|
104 |
+
]
|
105 |
+
}
|