-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathlesson-6-multiple-function-parameters.pot
381 lines (330 loc) · 12.8 KB
/
lesson-6-multiple-function-parameters.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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# 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-6-multiple-function-parameters/lesson.tres:14
msgid ""
"In the previous part, you created a function to draw a square of a fixed "
"size.\n"
"\n"
"This function is a bit limiting. Instead, it would be much better if we "
"had a function to draw a square of [i]any[/i] size. Or better: any kind "
"of rectangle (a square is a specific kind of rectangle).\n"
"\n"
"In previous lessons, you used the [code]rotate()[/code] function and gave"
" it an [i]argument[/i]."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:38
msgid ""
"Just like [code]rotate()[/code], we can also give our function "
"[i]parameters[/i]. Parameters are labels you give to values passed to the"
" function."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:46
msgid "Can I rotate in both directions?"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:48
msgid ""
"The [code]radians[/code] can be a positive or negative number, which "
"allows you to rotate both clockwise and counter-clockwise."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:58
msgid ""
"For now, please focus on the first line: [code]func "
"rotate(radians)[/code].\n"
"\n"
"When you call [code]rotate(0.5)[/code], the computer binds the value "
"[code]0.5[/code] to the label [code]radians[/code].\n"
"\n"
"Wherever the computer sees the identifier [code]radians[/code] inside the"
" function, it replaces it with the [code]0.5[/code] value.\n"
"\n"
"The parameter name is always a label you use to refer to a [i]value[/i]. "
"The value in question can be a number, text, or anything else.\n"
"\n"
"For now, we'll stick to numbers as we have yet to see other value types."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:74
msgid "What is a function parameter?"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:77
msgid ""
"A parameter is a label that represents a value.\n"
"\n"
"The value in question can change: it depends on what you put in "
"parentheses when calling a function."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:80
#: course/lesson-6-multiple-function-parameters/lesson.tres:81
msgid "A label you give to a value the function receives."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:80
msgid "A number you use to make calculations."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:80
msgid "The name of a function."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:88
msgid "How to create functions with parameters"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:90
msgid ""
"You can give your function parameters when writing its [i]definition[/i] "
"(the line starting with the [code]func[/code] keyword).\n"
"\n"
"To do so, you add a name inside of the parentheses."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:112
msgid ""
"You can give parameters any name. How you name functions and parameters "
"is up to you. \n"
"\n"
"Just remember that names cannot contain spaces. To write parameter names "
"with multiple words, you need to use underscores.\n"
"\n"
"The following function definition is exactly equivalent to the previous "
"one."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:136
msgid ""
"Parameters make your code easier to reuse.\n"
"\n"
"Here's an example with a function to draw any square. Use the slider to "
"change the value passed to the function and draw squares of different "
"sizes."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:156
msgid "Which is the correct syntax for a function definition?"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:159
msgid ""
"To define a function, you need to start with the [code]func[/code] "
"keyword followed by a space, the [code]function_name[/code], and optional"
" parameters inside parentheses.\n"
"\n"
"You must end the line with a colon, which defines a new code block. We'll"
" see moving forward that keywords other than [code]func[/code] require a "
"colon at the end of the line."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:162
#: course/lesson-6-multiple-function-parameters/lesson.tres:163
msgid "func function_name(parameter_name):"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:162
msgid "func (function_name): parameter_name"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:162
msgid "func function_name(parameter_name)"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:162
msgid "function_name(parameter_name):"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:170
msgid "Functions can have multiple parameters"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:172
msgid ""
"You can use multiple parameters in a function. In fact, you can use as "
"many as you [i]need[/i].\n"
"\n"
"To separate the function parameters, you need to write a comma between "
"them."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:192
msgid "Must I write spaces between function parameters?"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:194
msgid ""
"In a function definition, you must have a space between the "
"[code]func[/code] keyword and the function name.\n"
"\n"
"However, because we use the comma to separate parameters, it doesn't "
"matter if you use spaces between parameters. As long as you have the "
"comma, either syntax is correct.\n"
"\n"
"We often use spaces after the comma for readability."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:208
msgid ""
"The following example defines a function that uses two parameters to move"
" an entity on both the X and Y axes."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:226
msgid "How should I name my functions and parameters?"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:228
msgid ""
"The names of functions, parameters, or other things in your code are "
"entirely up to you.\n"
"\n"
"They are written by us programmers for other programmers. You want to use"
" the names that make the most sense to you and fellow programmers.\n"
"\n"
"You could absolutely write single-letter names like in maths classes: "
"[code]a[/code], [code]b[/code], [code]f[/code].\n"
"\n"
"You can also write abbreviated names like [code]pos[/code] for position, "
"[code]bg[/code] for background, and so on.\n"
"\n"
"Many programmers do either or both of the above.\n"
"\n"
"At GDQuest, we favor complete and explicit names.\n"
"\n"
"We generally try to write code that is explicit and relatively easy to "
"read.\n"
"\n"
"Right now, you have to enter every letter when you code, so long names "
"may feel inconvenient.\n"
"\n"
"However, this is good for learning: it trains your fingers to "
"[ignore]type precisely.\n"
"\n"
"Then, after you finish this course, you will see that the computer "
"assists you a lot when you code real games with a feature called auto-"
"completion.\n"
"\n"
"Based on a few characters you [ignore]type, it will offer you to complete"
" long names."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:256
msgid "When defining a function, parameters are..."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:259
msgid ""
"You can define functions with or without parameters, depending on your "
"needs."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:260
#: course/lesson-6-multiple-function-parameters/lesson.tres:261
msgid "Optional"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:260
msgid "Mandatory"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:268
msgid "What's the correct syntax to define a function with multiple parameters?"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:271
msgid ""
"You always write the function parameters inside of the parentheses. To "
"define multiple parameters, you separate them with a comma."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:272
#: course/lesson-6-multiple-function-parameters/lesson.tres:273
msgid "func function_name(parameter_1, parameter_2, ...):"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:272
msgid "func function_name(parameter_1 parameter_2 ...):"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:272
msgid "func function_name(): parameter_1, parameter_2, ..."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:282
msgid ""
"Now it's your turn to create a function with multiple parameters: a "
"function to draw rectangles of any size."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:290
msgid "Drawing corners of different sizes"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:291
msgid ""
"Before we create a rectangle of any size, let's first see how we can use "
"parameters to draw simpler shapes.\n"
"\n"
"Here we have an incomplete function that will draw corners with lines of "
"any length, but it's missing its [code]length[/code] parameter.\n"
"\n"
"The function will move the turtle forward an amount defined by the "
"parameter [code]length[/code], turn [code]90[/code] degrees, then move "
"forward [code]length[/code] pixels.\n"
"\n"
"Complete the [code]draw_corner()[/code] function so it uses the "
"[code]length[/code] parameter to draw corners."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:309
msgid ""
"Using function parameters, code a function you can reuse to draw corners "
"with lines of varying sizes."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:314
msgid "Using multiple parameters"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:315
msgid ""
"In this practice, we'll improve our [code]draw_corner()[/code] function "
"so the angle can also vary.\n"
"\n"
"Add the [code]angle[/code] parameter after the [code]length[/code] "
"parameter in the [code]draw_corner()[/code] function and use it to draw "
"corners of varying angles."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:329
msgid "With two parameters, code a function to draw corners with any angle."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:334
msgid "Drawing squares of any size"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:335
msgid ""
"We want a function to draw squares of any size.\n"
"\n"
"We could use these squares as outlines when selecting units in a tactical"
" game, as a frame for items in an inventory, and more.\n"
"\n"
"Create a function named [code]draw_square()[/code] that takes one "
"parameter: the [code]length[/code] of the square's sides.\n"
"\n"
"[b]The turtle should face towards the right when starting or completing a"
" square.[/b]\n"
"\n"
"Be sure to call [b]turn_right(90)[/b] enough times in your function to "
"do so."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:352
msgid ""
"In the previous lesson, your function would draw squares of a fixed size."
" Using a parameter, code a function to draw squares of any size."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:357
msgid "Drawing rectangles of any size"
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:358
msgid ""
"Let's make our square drawing function more flexible to include "
"rectangles of varying sizes.\n"
"\n"
"Your job is to code a function named [code]draw_rectangle()[/code] that "
"takes two parameters: the [code]length[/code] and the [code]height[/code]"
" of the rectangle.\n"
"\n"
"[b]The turtle should face towards the right when starting or completing a"
" rectangle.[/b]\n"
"\n"
"Note that we could still draw a square with [code]draw_rectangle()[/code]"
" by having the [code]length[/code] and [code]height[/code] equal the same"
" value."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:381
msgid ""
"With one parameter, you can make squares of any size. With two, you can "
"draw any rectangle! You'll do so in this practice."
msgstr ""
#: course/lesson-6-multiple-function-parameters/lesson.tres:385
msgid "Your First Function Parameter"
msgstr ""