forked from GDQuest/learn-gdscript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlesson-15-modulo.pot
236 lines (207 loc) · 7.25 KB
/
lesson-15-modulo.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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# 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-15-modulo/lesson.tres:14
msgid ""
"The modulo operation ([code]%[/code]) calculates the remainder of a whole"
" number division.\n"
"\n"
"For example, the modulo of [code]5[/code] by [code]3[/code] ([code]5 % "
"3[/code]) is [code]2[/code].\n"
"\n"
"We typically use this operation to tell if a number is odd or even or to "
"produce a random number within a particular range (like a dice roll).\n"
"\n"
"Play around with the modulo widget on the right to see how modulo works "
"visually."
msgstr ""
#: course/lesson-15-modulo/lesson.tres:28
msgid "What's the result of this modulo operation?"
msgstr ""
#: course/lesson-15-modulo/lesson.tres:29
msgid "[code]11 % 4[/code]"
msgstr ""
#: course/lesson-15-modulo/lesson.tres:31
msgid ""
"[code]11[/code] divided by [code]4[/code] is [code]2[/code], and the "
"[b]remainder[/b] of the division is [code]3[/code].\n"
"\n"
"So [code]11 % 4[/code] is [code]3[/code]."
msgstr ""
#: course/lesson-15-modulo/lesson.tres:34
#: course/lesson-15-modulo/lesson.tres:35
msgid "3"
msgstr ""
#: course/lesson-15-modulo/lesson.tres:34
msgid "2"
msgstr ""
#: course/lesson-15-modulo/lesson.tres:34
msgid "7"
msgstr ""
#: course/lesson-15-modulo/lesson.tres:44
msgid ""
"The modulo operation only works on [b]whole numbers[/b]; Not decimal "
"numbers.\n"
"\n"
"Also, just like in regular divisions, the divisor can't be zero.\n"
"\n"
"All three examples below will cause an error in your code."
msgstr ""
#: course/lesson-15-modulo/lesson.tres:66
msgid "Three ways we use the modulo operation"
msgstr ""
#: course/lesson-15-modulo/lesson.tres:68
msgid ""
"The modulo operation has important uses in programming, like making a "
"number cycle.\n"
"\n"
"Take a traffic light, for example."
msgstr ""
#: course/lesson-15-modulo/lesson.tres:90
msgid ""
"We use the number [code]light_index[/code] to represent the traffic "
"light's current state.\n"
"\n"
"The lights always cycle in the same way: first, we have the red light, "
"then the yellow, then the green.\n"
"\n"
"To represent that cycle, you can periodically add one to the number and "
"use the modulo operator to wrap back to [code]0[/code].\n"
"\n"
"Instead, you could use a condition; In this case, we use the modulo as a "
"shortcut."
msgstr ""
#: course/lesson-15-modulo/lesson.tres:116
msgid ""
"In computer code, we very often count from [code]0[/code].\n"
"\n"
"Every number translates to a precise combination of bits in the machine, "
"starting from [code]0[/code].\n"
"\n"
"We don't want to waste any number, and as the first number the computer "
"knows about is [code]0[/code], we start counting from [code]0[/code]."
msgstr ""
#: course/lesson-15-modulo/lesson.tres:128
msgid "Using modulo to find even and odd numbers"
msgstr ""
#: course/lesson-15-modulo/lesson.tres:130
msgid ""
"We can also use a modulo to check if a number is even or odd. If we "
"divide a number by [code]2[/code] and there's no remainder, then the "
"number is [b]even[/b]."
msgstr ""
#: course/lesson-15-modulo/lesson.tres:150
msgid ""
"Notice how the modulo can be larger than the number it affects. For "
"example, [code]1 % 2[/code] gives you [code]1[/code]. That's because "
"[code]1[/code] divided by [code]2[/code] equals [code]0[/code], and the "
"remainder is [code]1[/code].\n"
"\n"
"Like with divisions, the only case you can't use modulo is with a divisor"
" of [code]0[/code]."
msgstr ""
#: course/lesson-15-modulo/lesson.tres:170
msgid "Calculating a random number within a range"
msgstr ""
#: course/lesson-15-modulo/lesson.tres:172
msgid ""
"We can use the modulo to simulate dice rolls. To do so, we generate a "
"large random number and use the modulo operator to limit the number's "
"range.\n"
"\n"
"To generate a random whole number, you can call the [code]randi()[/code] "
"function. The name stands for random integer.\n"
"\n"
"The number the function generates can be huge: roughly up to 2 billion on"
" an Android device and around 10^18 on a 64-bit computer.\n"
"\n"
"You can use the modulo operation to limit the random number's range."
msgstr ""
#: course/lesson-15-modulo/lesson.tres:198
msgid ""
"The result is also random because we use the modulo operation on a random"
" number.\n"
"\n"
"In the following practices, you'll use a modulo to advance traffic "
"lights, add maximum health to the robot on every odd level, and learn how"
" to code dice rolls."
msgstr ""
#: course/lesson-15-modulo/lesson.tres:208
msgid "Advancing Traffic Lights"
msgstr ""
#: course/lesson-15-modulo/lesson.tres:209
msgid ""
"Add to the [code]advance_traffic_light()[/code] function so the "
"[code]light_index[/code] variable increments by one, then wraps back to "
"[code]0[/code] if it gets too high.\n"
"\n"
"Use the modulo operator [code]%[/code] to make sure the value of "
"[code]light_index[/code] wraps back to [code]0[/code].\n"
"\n"
"The value of [code]light_index[/code] should only ever be [code]0[/code],"
" [code]1[/code], or [code]2[/code]."
msgstr ""
#: course/lesson-15-modulo/lesson.tres:221
msgid ""
"Learn how to use modulo to wrap a number back to zero using traffic "
"lights."
msgstr ""
#: course/lesson-15-modulo/lesson.tres:226
msgid "Rolling Dice"
msgstr ""
#: course/lesson-15-modulo/lesson.tres:227
msgid ""
"Our dice rolling function doesn't work! Right now, it always gives the "
"result of how many sides the dice has: 20.\n"
"\n"
"Use [code]randi()[/code] to generate a random number and the modulo "
"operation [code]%[/code]. \n"
"\n"
"Using the [code]return[/code] keyword inside the function, return a "
"random number between [code]1[/code] and [code]sides[/code]."
msgstr ""
#: course/lesson-15-modulo/lesson.tres:239
msgid ""
"Whether in a board game or video game, getting a random number is always "
"useful. Here, we create a function that simulates a dice roll."
msgstr ""
#: course/lesson-15-modulo/lesson.tres:244
msgid "Bonus Health Every Other Level"
msgstr ""
#: course/lesson-15-modulo/lesson.tres:245
msgid ""
"Change the [code]level_up()[/code] function so it does the following:\n"
"\n"
"1) Increment [code]level[/code] by [code]1[/code]\n"
"2) Increase [code]max_health[/code] by [code]5[/code]\n"
"3) If [code]level[/code] is [b]even[/b], increase [code]max_health[/code]"
" by an additional [code]5[/code]\n"
"\n"
"The robot starts with [code]100[/code] maximum health. It will gain three"
" levels when you run the code. At level 4, the robot should have "
"[code]125[/code] maximum health."
msgstr ""
#: course/lesson-15-modulo/lesson.tres:259
msgid ""
"There are other ways to increase maximum health. You could use a modulo "
"to give a bonus every even level. Learn how here!"
msgstr ""
#: course/lesson-15-modulo/lesson.tres:263
msgid "Modulo"
msgstr ""