forked from GDQuest/learn-gdscript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlesson-17-while-loops.pot
209 lines (187 loc) · 6.73 KB
/
lesson-17-while-loops.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
# Translations template for Learn GDScript From Zero.
# Copyright (C) 2022 GDQuest
# This file is distributed under the same license as the Learn GDScript From
# Zero project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
#, 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: 2022-02-18 15:02+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.0\n"
#: course/lesson-17-while-loops/lesson.tres:14
msgid ""
"You've seen that you can use functions to [i]reuse[/i] code. In this "
"lesson, you'll learn about [b]loops[/b]. Loops help you [i]repeat[/i] "
"code.\n"
"\n"
"To illustrate how loops work, let's take a game board split into a grid.\n"
"\n"
"Our robot can move to neighboring cells by changing a "
"[code]Vector2[/code] variable named [code]cell[/code] variable.\n"
"\n"
"When we increase [code]cell.x[/code], the robot moves to the right.\n"
"\n"
"Note that we delay the robot's movement in the app to help you visualize "
"how it moves. The following code would normally move the robot instantly."
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:42
msgid "We can move diagonally by adding adding a [code]Vector2[/code] directly."
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:62
msgid ""
"The above code works for a pre-defined board with a size of "
"[code]Vector2(3, 3)[/code], but the [code]move_to_end()[/code] function "
"wouldn't work if the size of the board was different. \n"
"\n"
"The robot would either stop before the end or go too far.\n"
"\n"
"To implement a general solution for all board sizes, we can repeat the "
"robot's movement until it gets to the end.\n"
"\n"
"For code that repeats, we can use [i]loops[/i]."
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:76
msgid "Using while loops to repeat code"
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:78
msgid ""
"While loops make the computer repeat a block of code until you meet a "
"specific condition or decide to break from the loop.\n"
"\n"
"Here's how we use a while loop."
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:100
msgid ""
"We use the variable [code]number[/code] to keep track of how many loops "
"the while loop completes.\n"
"\n"
"Each time we go through the while loop, we add [code]1[/code] to "
"[code]number[/code].\n"
"\n"
"The while loop keeps running for as long as the condition is true. In "
"this case, it keeps running while [code]number[/code] is less than "
"[code]4[/code].\n"
"\n"
"You can see the following code is executed four times in the console."
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:126
msgid ""
"Let's apply this to our [code]move_to_end()[/code] function.\n"
"\n"
"This time, we compare the number of loops to the board's width. We keep "
"looping through until we reach the width of the board.\n"
"\n"
"Note we move one less than the board width because the robot is already "
"on the first cell."
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:158
msgid "While loops can cause issues"
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:160
msgid ""
"If you're not careful, your while loop can run infinitely. In that case, "
"the application will freeze.\n"
"\n"
"Take a look at this code example."
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:180
msgid "What would happen if the computer tried to run the code above?"
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:183
msgid ""
"Because we don't increment [code]number[/code] within the while loop, it "
"always stays at [code]0[/code].\n"
"\n"
"As a result, the number is always lower than [code]10[/code], so we never"
" break out of the loop.\n"
"\n"
"Since there's no way to exit the [code]while[/code] loop, the computer "
"will attempt to draw squares infinitely, which will freeze the program.\n"
"\n"
"When programs stop responding on your computer, it's often due to an "
"infinite loop!"
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:190
#: course/lesson-17-while-loops/lesson.tres:191
msgid "It would draw squares infinitely until the program is terminated"
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:190
msgid "It would draw 10 squares"
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:190
msgid "It would draw 20 squares"
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:198
msgid "When to use while loops"
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:200
msgid ""
"At first, you will not need [code]while[/code] loops often. Even the code"
" we show here has more efficient alternatives.\n"
"\n"
"Also, there's a safer kind of loop, [code]for[/code] loops, which we'll "
"look at in the next lesson.\n"
"\n"
"Yet, [code]while[/code] loops have important intermediate to advanced-"
"level uses, so you at least need to know they exist and how to use them."
"\n"
"\n"
"We use [code]while[/code] loops every time we need to loop an unknown "
"number of times.\n"
"\n"
"For example, games run in a loop that typically generates 60 images per "
"second until the user closes the game. This is possible thanks to while "
"loops.\n"
"\n"
"There are other good uses for it:\n"
"\n"
"- Reading and processing a file, like a text file, line by line.\n"
"- Processing a constant stream of data, like someone recording audio with"
" a microphone.\n"
"- Reading code and converting it into instructions the computer "
"understands.\n"
"- Various intermediate to advanced-level algorithms like finding paths "
"around a map for AI."
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:225
msgid ""
"Let's practice while loops real quick as they're useful to know. It's "
"also an excellent opportunity to practice 2D vectors.\n"
"\n"
"Then, we'll move on to the safer [code]for[/code] loops in the following "
"lesson."
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:235
msgid "Moving to the end of a board"
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:236
msgid ""
"Our robot has decided to stand at the top of the board.\n"
"\n"
"Complete the [code]move_to_bottom()[/code] function so the robot moves to"
" the bottom of the board.\n"
"\n"
"The board size is determined by the [code]Vector2[/code] "
"[code]board_size[/code].\n"
"\n"
"The robot's current cell is [code]Vector2(2, 0)[/code]. \n"
"\n"
"Make sure to use a while loop so the function works for any board size."
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:252
msgid ""
"Use a while loop to have our robot move from the top of the board to the "
"bottom."
msgstr ""
#: course/lesson-17-while-loops/lesson.tres:256
msgid "Introduction to While Loops"
msgstr ""