-
Notifications
You must be signed in to change notification settings - Fork 480
/
CSD U3 - Simple Counter Predict.level
89 lines (89 loc) · 3.64 KB
/
CSD U3 - Simple Counter Predict.level
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<Gamelab>
<config><![CDATA[{
"game_id": 50,
"created_at": "2017-04-10T21:11:38.000Z",
"level_num": "custom",
"user_id": 106,
"properties": {
"skin": "gamelab",
"code_functions": {
"color": null,
"fill": null,
"noFill": null,
"stroke": null,
"strokeWeight": null,
"noStroke": null,
"ellipse": null,
"rect": null,
"regularPolygon": null,
"line": null,
"arc": null,
"shape": null,
"point": null,
"text": null,
"textAlign": null,
"textFont": null,
"textSize": null,
"comment": null,
"draw": null,
"frameRate": null,
"randomNumber_min_max": null,
"background": null,
"console.log": null,
"declareAssign_x": null,
"declareNoAssign_x": null,
"assign_x": null,
"addOperator": null,
"subtractOperator": null,
"multiplyOperator": null,
"divideOperator": null
},
"show_d_pad": "true",
"edit_code": true,
"embed": "false",
"markdown_instructions": "# The Counter Pattern\r\n\r\nThis pattern is one of the most important ones in all of programming. \r\n\r\n![](https://images.code.org/83af2e40443ab294ba635f2a01a48ac7-image-1465506512065.06.56 PM.png)\r\n \r\nIt is used to increase the value of a variable by 1. You might call it the **counter pattern** since it can be used to make a variable that counts up. You'll use this pattern a lot, especially with the draw loop. Let's see what that looks like.\r\n\r\n# Do This\r\n\r\nThis program creates a variable `counter` and then uses the **counter pattern** to make it count up. When you run the program what do you think you'll see on the screen?\r\n\r\n* **Read the program** and make a prediction of what the output will be.\r\n* **Run the program** to check your prediction.\r\n* **Discuss with a neighbor**. Can you explain what you observed?\r\n\r\n",
"start_blocks": "var counter = 0;\r\n\r\nfunction draw(){\r\n background(\"white\");\r\n textSize(counter);\r\n text(counter, 0, 400);\r\n counter = counter + 1;\r\n}",
"is_k1": "false",
"skip_instructions_popup": "false",
"never_autoplay_video": "false",
"disable_param_editing": "true",
"disable_variable_editing": "false",
"use_modal_function_editor": "false",
"use_contract_editor": "false",
"contract_highlight": "false",
"contract_collapse": "false",
"examples_highlight": "false",
"examples_collapse": "false",
"examples_required": "false",
"definition_highlight": "false",
"definition_collapse": "false",
"disable_examples": "false",
"droplet_tooltips_disabled": "false",
"lock_zero_param_functions": "false",
"free_play": "true",
"text_mode_at_start": "false",
"submittable": "false",
"hide_view_data_button": "false",
"debugger_disabled": "true",
"encrypted_examples": "rjxT6iF5KjqBHXf413tzznDDpJVGWcEND3LaKri4GpvMPkbfhUl54EVvy/a7\nAgj1\n",
"instructions_important": "false",
"hide_animation_mode": "true",
"start_in_animation_tab": "false",
"all_animations_single_frame": "false",
"pause_animations_by_default": "false",
"show_debug_watch": "false",
"contained_level_names": [
"CSD U3 Counters explaining counters contained 2"
],
"hide_share_and_remix": "false",
"disable_if_else_editing": "false",
"expand_debugger": "false"
},
"published": true,
"notes": "",
"audit_log": "[{\"changed_at\":\"2017-06-13 20:46:27 +0000\",\"changed\":[\"code_functions\",\"encrypted_examples\",\"show_debug_watch\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"}]",
"level_concept_difficulty": {
}
}]]></config>
<blocks/>
</Gamelab>