-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
lesson-20-looping-over-arrays.pot
210 lines (186 loc) · 6.89 KB
/
lesson-20-looping-over-arrays.pot
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# Translations template for Learn GDScript From Zero.
# Copyright (C) 2024 GDQuest
# This file is distributed under the same license as the Learn GDScript From
# Zero project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Learn GDScript From Zero \n"
"Report-Msgid-Bugs-To: https://github.com/GDQuest/learn-gdscript\n"
"POT-Creation-Date: 2024-12-12 14:39+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.10.1\n"
#: course/lesson-20-looping-over-arrays/lesson.tres:14
msgid ""
"We used the [code]range()[/code] function in combination with "
"[code]for[/code] loops."
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:34
msgid ""
"The [code]range()[/code] function produced an array that the "
"[code]for[/code] keyword could loop over.\n"
"\n"
"We can give [code]for[/code] loops [i]any[/i] array, and they will loop "
"over them just the same.\n"
"\n"
"Instead of using the [code]range()[/code] function, we could manually "
"write the numbers and get the same result."
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:58
msgid ""
"For each element inside the array, the [code]for[/code] loop extracts it,"
" stores it in the temporary variable named [code]number[/code], and "
"executes the loop's code once.\n"
"\n"
"Inside the loop, you can access the [code]number[/code] variable, which "
"changes on each [i]iteration[/i].\n"
"\n"
"The code works regardless of the array or where you store it. Often, you "
"will store arrays in variables for easy access."
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:80
msgid "What will this code print?"
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:81
msgid ""
"[code]var numbers = [0, 1, 2]\n"
"for number in numbers:\n"
" print(number)\n"
"[/code]"
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:86
msgid ""
"Compared to previous examples, we store the array in the "
"[code]numbers[/code] variable. Using the [code]numbers[/code] variable in"
" our [code]for[/code] loop allows the computer to access the array of "
"numbers like before.\n"
"\n"
"We have three numbers in the array: [code]0[/code], [code]1[/code], and "
"[code]2[/code].\n"
"\n"
"The loop extracts each of them sequentially and assigns it to the "
"[code]number[/code] temporary variable. As the loop processes each "
"number, the output will print [code]0[/code], then [code]1[/code], then "
"[code]2[/code], each on a separate line."
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:91
#: course/lesson-20-looping-over-arrays/lesson.tres:92
msgid "0, 1, and 2"
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:91
msgid "1, 2, and 3"
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:91
msgid "0, 0, and 0"
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:99
msgid "Making the turtle walk, with a loop"
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:101
msgid ""
"In the previous lesson, you made a turtle walk along a path by writing "
"[code]Vector2[/code] coordinates in an array."
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:121
msgid ""
"It's a [code]for[/code] loop that makes the turtle walk along the path.\n"
"\n"
"The loop works like this: for each coordinate in the array, it moves the "
"turtle once to that cell."
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:143
msgid "It's the same principle with unit selection."
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:163
msgid ""
"For each coordinate in an array named [code]selected_units[/code], we "
"check if there is a unit in that cell. If so, we select it. \n"
"\n"
"In that case, we use an array, a loop, and a condition together."
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:185
msgid ""
"The code above uses several features you haven't learned yet:\n"
"\n"
"- In a condition, the [code]in[/code] keyword allows you to check if a "
"value exists [i]in[/i] an array.\n"
"- The array's [code]append()[/code] function appends a new value at the "
"end of the array.\n"
"\n"
"Notice the use of a period after the [code]selected_units[/code] "
"variable, to call the [code]append()[/code] function. It's because this "
"function exists only on arrays.\n"
"\n"
"When functions exist only on a specific value type, you write a dot after"
" the value to call the function on it.\n"
"\n"
"We'll revisit those two features again in the following lessons."
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:204
msgid ""
"The beauty of loops is that they work regardless of the size of your "
"arrays. \n"
"\n"
"The code just works whether you have one or ten thousand units to select."
" It is all accomplished with only a couple lines of code.\n"
"\n"
"That's the power of computer programming.\n"
"\n"
"In the following practices, you will use arrays combined with "
"[code]for[/code] loops to achieve similar results."
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:218
msgid "Move the robot along the path"
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:219
msgid ""
"Our AI pathfinding algorithm provided a path for the robot to move to the"
" right edge of the grid. Your task is to use a [code]for[/code] loop to "
"make the robot move.\n"
"\n"
"To move the robot, call [i]its[/i] [code]move_to()[/code] function, like "
"so: [code]robot.move_to()[/code].\n"
"\n"
"The [code]move_to()[/code] function only exists on the robot, which is "
"why you need to access it this way."
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:235
msgid ""
"Our AI pathfinding algorithm is giving us a path to move the robot. Now, "
"you need to make the turtle move along the path."
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:240
msgid "Back to the drawing board"
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:241
msgid ""
"We want to draw many rectangles, something surprisingly common in games.\n"
"\n"
"However, writing this code by hand can get tedious. Instead, you could "
"store the size of your shapes in arrays and use a loop to draw them all "
"in batches.\n"
"\n"
"That's what you'll do in this practice.\n"
"\n"
"Use a [code]for[/code] loop to draw every rectangle in the "
"[code]rectangle_sizes[/code] array with the [code]draw_rectangle()[/code]"
" function.\n"
"\n"
"The rectangles shouldn't overlap or cross each other. To avoid that, "
"you'll need to call the [code]jump()[/code] function."
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:261
msgid ""
"The drawing turtle makes its comeback. Fear not! Armed with loops, you'll"
" make it draw faster than ever before."
msgstr ""
#: course/lesson-20-looping-over-arrays/lesson.tres:265
msgid "Looping over arrays"
msgstr ""