forked from hedyorg/hedy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathur.yaml
742 lines (742 loc) · 124 KB
/
ur.yaml
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
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
adventures:
default:
description: Level explanation
default_save_name: intro
levels:
1:
start_code: '{print} hello world!'
story_text: "## Welcome to Hedy!\nIn Level 1 you can use the commands `{print}`, `{ask}` and `{echo}`.\nType your code in the programming field. Or press the green button in the example code block, and the code will be typed for you!\nTry the code yourself with the green 'Run code' button under the programming field.\n\nYou can print text to the screen using the `{print}` command.\n"
example_code: "```\n{print} Hello!\n{print} Welcome to Hedy!\n```\n"
story_text_2: "You can also ask for input with `{ask}` and repeat it back with an `{echo}` command.\n"
story_text_3: "Let's get started! Don't know what to create? In the next tabs you will find ideas for programs to build.\n"
example_code_2: "```\n{ask} What is your name?\n{echo} hello\n```\n"
2:
example_code_2: "```\nanswer {is} {ask} What is your name?\n{print} Hello answer\n```\n"
story_text: "## Variables\nIn level 2 we learn two new commands: `{is}` and `{sleep}`.\nYou can name a word with `{is}`. This is called a variable. In this example we made a variable called name and a variable called age. You can use the word name anywhere in your code and it will be replaced by Hedy, like this:\n\nThis way you no longer need the `{echo}` command!\n"
example_code: "```\nname {is} Hedy\nage {is} 15\n{print} name is age years old\n```\n"
story_text_2: "`{print}` still works the same, but the `{ask}` command has changed. You need to use a variable in the `{ask}` command as well. It looks like this:\n"
story_text_3: "Another new command in this level is `{sleep}`, which pauses your program for a second. If you type a number behind the {sleep} command, the program pauses for that amount of seconds.\n"
example_code_3: "```\n{print} My favorite colour is...\n{sleep} 2\n{print} green!\n```\n"
start_code: '{print} hello world!'
5:
start_code: "name {is} {ask} 'what is your name?'\n{if} name {is} Hedy {print} 'cool!' {else} {print} 'meh'"
story_text: "## If... else....\nIn level 5 there is something new, the `{if}`! With the `{if}` you can choose between two different options.\nThis code prints nice if you enter Hedy as a name, and boo! if you enter something else.\n`{ask}` and `{print}` still work like they did in level 4.\n"
example_code: "```\nname {is} {ask} 'what is your name?'\n{if} name {is} Hedy {print} 'nice' {else} {print} 'boo!'\n```\n"
story_text_3: "## Lists\nWhen we want to check if something is in a list, we can now use the `{in}` command.\nThis code prints pretty! if you choose green or yellow, and meh otherwise.\n"
example_code_3: "```\npretty_colors {is} green, yellow\nfavorite_color {is} {ask} 'What is your favorite color?'\n{if} favorite_color {in} pretty_colors {print} 'pretty!'\n{else} {print} 'meh'\n```\n"
story_text_2: "Sometimes code with an `{if}` gets really long and does not fit on the line well. <br> You may also divide the code over two lines, starting the second line at the `{else}` like this:\n"
example_code_2: "```\nname {is} {ask} 'what is your name?'\n{if} name {is} Hedy {print} 'nice'\n{else} {print} 'boo!'\n```\n"
story_text_4: "Something else that works with `{if}` is `pressed`! With pressed you can link any letter in\nthe alphabet and any number key on your keyboard to a command. If you link it, and press the key,\nsomething will happen. Try it out!\n"
example_code_4: "```\n{if} x {is} {pressed} {print} 'it worked!'\n```\n"
9:
start_code: "{repeat} 3 {times}\n food = {ask} 'What do you want?'\n {if} food {is} pizza\n {print} 'nice!'\n {else}\n {print} 'pizza is better'"
story_text: "## All together now!\nIn this level you can not only use multiple lines with `{if}` and `{repeat}`, but you can also put them together!\nIn the example you see an `{if}` command within a `{repeat}` command. It is also allowed the other way around, and an `{if}` is also allowed in an `{if}` and a `{repeat}` in a `{repeat}`.\nGive it a try!\n"
example_code: "```\n{repeat} 3 {times}\n food = {ask} 'What do you want?'\n {if} food {is} pizza\n {print} 'nice!'\n {else}\n {print} 'pizza is better'\n```\n"
12:
example_code_5: "```\nscore = 25\n{print} 'You got ' score\n```\n"
start_code: "{print} 'decimal numbers now need to use a dot'\n{print} 2.5 + 2.5"
story_text: "## Numbers and texts\n**Decimal numbers**\nSo far, Hedy did not allow for decimal numbers like 1.5, but now we do allow that. Note that computers use the `.` for decimal numbers."
example_code: "```\n{print} 'Two and a half plus two and a half is...'\n{print} 2.5 + 2.5\n```\n"
story_text_2: "**All texts need to be in quotation marks**\nFor this level on you will also have to use quotation marks when storing a text with `=`:\n"
example_code_2: "```\nname = 'Hedy the Robot'\n{print} 'Hello ' name\n```\n"
story_text_3: "**All items in lists need quotation marks too**\nLists are texts, so they need quotation marks too. Mind that each single item on the list has quotation marks.\nThis allows you to save two words as 1 item on the list, for example 'Iron Man'.\n"
example_code_3: "```\nsuperheroes = 'Spiderman', 'Batman', 'Iron Man'\n{print} superheroes {at} {random}\n```\n"
story_text_4: "**All text after `{if}` comparisons need quotation marks too**\n"
example_code_4: "```\nname = {ask} 'What is your name?'\n{if} name = 'Hedy the Robot'\n {print} 'Hi there!'\n```\n"
story_text_5: "**Numbers don't need quotation marks**\nFor numbers, you do not use quotation marks in the `=`:\n"
story_text_6: "**Maths with words** \nIn this level it is also allowed to use the + sign with texts. For example:"
example_code_6: "```\na = 'Hello '\nb = 'world!'\n{print} a + b\n```\n"
14:
example_code: "```\nage = {ask} 'How old are you?'\n{if} age > 12\n {print} 'You are older than I am!'\n```\n"
start_code: "age = {ask} 'How old are you?'\n{if} age < 13\n {print} 'You are younger than me!'\n{else}\n {print} 'You are older than me!'"
story_text: "## Great, Greater, Greatest!\nWe are going to learn more new items. You might know them already from mathematics, the `<` and `>`.\nThe `<` checks if the first number is smaller than the second, for example age `<` 12 checks if age is smaller than 12.\nIf you want to check if the first number is smaller or equal to the second, you can use `<=`, for example age `<=` 11.\nThe `>` checks if the first number is bigger than the second, for example points `>` 10 checks if points is larger than 10.\nIf you want to check if the first number is bigger or equal to the second, you can use `>=`, for example points `>=` 11.\nYou use these comparisons in an `{if}`, like this:\n"
story_text_2: "From this level on, if you want to compare exactly, you can use two equal signs. This is what most programming languages do:\n"
example_code_2: "```\nname = {ask} 'What is your name?'\n{if} name == 'Hedy'\n {print} 'You are cool!'\n```\n"
story_text_3: "You can also compare if something is *not* equal to something else using `!=` like this:\n"
example_code_3: "```\nname = {ask} 'What is your name?'\n{if} name != 'Hedy'\n {print} 'You are not Hedy'\n```\n"
16:
start_code: "fruit = ['apple', 'banana', 'cherry']\n{print} fruit"
example_code: "```\nfriends = ['Ahmed', 'Ben', 'Cayden']\nlucky_numbers = [15, 18, 6]\n{for} i {in} {range} 1 {to} 3\n {print} 'the lucky number of ' friends[i]\n {print} 'is ' lucky_numbers[i]\n```\n"
story_text: "## More and more like real code!\nWe are going to make lists the Python way, with square brackets around the lists! We also keep the quotation marks around each item like we have learned in previous levels.\nYou can use the square brackets as well to point out a place in the lists."
17:
start_code: "{for} i {in} {range} 1 {to} 10:\n {print} i\n{print} 'Ready or not, here I come!'"
story_text: "## Elif\nNow we are going to change indentation a little bit. Every time that we need an indentation, we need `:` at the line before the indentation.\n\nIn this level you can also use a new command: `{elif}`. `{elif}` is short for {else} {if} and you need it when you want to make 3 (or more!) options.\nCheck it out!"
example_code: "```\nprices = ['1 million dollars', 'an apple pie', 'nothing']\nyour_price = prices[{random}]\n{print} 'You win ' your_price\n{if} your_price == '1 million dollars' :\n {print} 'Yeah! You are rich!'\n{elif} your_price == 'an apple pie' :\n {print} 'Lovely, an apple pie!'\n{else}:\n {print} 'Better luck next time..'\n```\n"
3:
story_text: "## Make a list!\nIn level 3 you can make a list. You can let the computer choose something random from the list. You do that with `{at} {random}`.\n"
example_code: "```\nanimals {is} dog, cat, kangaroo\n{print} animals {at} {random}\n```\n"
story_text_2: You can also add items to the list with `{add}` and remove items with `{remove}`.
example_code_2: "```\nanimals {is} dog, cat, kangaroo\n{add} penguin {to_list} animals\n{remove} cat {from} animals\n{print} animals {at} {random}\n```\n"
start_code: '{print} hello world!'
4:
start_code: "{print} 'Hello world'"
story_text: "## 'Quotation marks'\nIn level 4 `{ask}` and `{print}` have changed.\n\nYou must put text that you want to print between quotation marks.\n\nThis is useful, because now you can print all the words you want. Also the words you used to store something with `{is}`.\n\nMost programming languages also use quotation marks when printing, so we are also getting a step closer to real programming!\n"
example_code: "```\n{print} 'You need to use quotation marks from now on!'\nanswer {is} {ask} 'What do we need to use from now on?'\n{print} 'We need to use ' answer\n```\n"
story_text_2: "## Adventures are getting more and more difficult\nThe adventures are now getting more and more difficult in the successive tabs.\nSo it is best to start on the left with the story, and work to the right, in order to be challenged more and more.\n"
6:
start_code: "{print} '5 times 5 is ' 5 * 5"
story_text: "## 1 + 1\n In this level you learn something new: you can now also calculate.\n\n The plus is easy, you write it like with math: `5 + 5` for example. The minus also works fine, it is `5 - 5`.\n\n The times is a bit different, because there is no times symbol on your keyboard. Just search, there really isn't!\n That is why we multiply with the asterisk above 8: `5 * 5`. Read that as \"5 times 5\" that helps you remember it best.\n"
example_code: "```\n{print} '5 plus 5 is ' 5 + 5\n{print} '5 minus 5 is ' 5 - 5\n{print} '5 times 5 is ' 5 * 5\n```\n"
story_text_2: "We also make a change in storing a word in a variable! You may now use `=` instead of `{is}` when we store a name or a number in a variable, like this:\n"
example_code_2: "```\nname = Hedy\nanswer = 20 + 4\n```\n"
7:
start_code: "{repeat} 3 {times} {print} 'Hedy is fun!'"
story_text: "## Level 7! Level 7!\nLevel 7 adds the `{repeat}` command. `{repeat}` can be used to execute one line of code multiple times.\n"
example_code: "```\n{repeat} 3 {times} {print} 'Hedy is fun!'\n```\n"
8:
start_code: "{repeat} 5 {times}\n {print} 'Hello folks'\n {print} 'This will be printed 5 times'"
example_code: "This is how the `{repeat}` command works now:\n```\n{repeat} 5 {times}\n {print} 'Hello everyone'\n {print} 'This is all repeated 5 times'\n```\nThis is how the `{if}` and `{else}` command work now:\n\n```\nname {is} {ask} 'What is your name?'\n{if} name {is} Hedy\n {print} 'Welcome Hedy'\n {print} 'You can play on your computer!'\n{else}\n {print} 'INTRUDER!'\n {print} 'You cannot use this computer!'\n```\n"
story_text: "## Indentation\n`{ask}` and `{print}` still work as you know them. But `{if}`, `{else}` and `{repeat}` have changed!\nYou can now execute groups of code together, but you will have to *indent* the code.\nThat means putting four spaces at the beginning of the line. You will also have to indent when you just want to create a block of one line.\n"
10:
start_code: "animals {is} dog, cat, blobfish\n{for} animal {in} animals\n {print} 'I love ' animal"
story_text: "## For each item in my list...\nIn this level we learn a new code called `{for}`. With `{for}` you can make a list and use all elements.\n`{for}` creates a block, like `{repeat}` and `{if}` so all lines in the block need to start with spaces."
example_code: "```\nanimals {is} dog, cat, blobfish\n{for} animal {in} animals\n {print} 'I love ' animal\n```\n"
11:
start_code: "{for} counter {in} {range} 1 {to} 5\n {print} counter"
story_text: "## Loops!\n`{print}` works just the same but we add a new form of the `{for}`. You can now write `{for} counter {in} {range} 1 {to} 5` and use `counter` in your program.\nTry it out to see what happens! Remember to use indentations after the `{for}` and `{if}` statements (That means starting a sentence with four spaces)"
example_code: "```\n{for} counter {in} {range} 1 {to} 5\n {print} counter\n```\n"
13:
start_code: "name = {ask} 'what is your name?'\nage = {ask} 'what is your age?'\n{if} name {is} 'Hedy' {and} age {is} 2\n {print} 'You are the real Hedy!'"
story_text: "## And... Or..?\nWe are now going to learn `{and}` and `{or}`! If you want to check two statements, you don't have to use two {if}'s but can use `{and}` and `{or}`. If you use `{and}`, both statements, left and right of the `{and}` need to be true. We can also use `{or}`. Then only one statement needs to be correct."
example_code: "```\nname = {ask} 'what is your name?'\nage = {ask} 'what is your age?'\n{if} name {is} 'Hedy' {and} age {is} 2\n {print} 'You are the real Hedy!'\n```\n"
15:
start_code: "answer = 0\n{while} answer != 25\n answer = {ask} 'What is 5 times 5?'\n{print} 'A correct answer has been given'"
story_text: "## More loops!\nWe are going to learn a new loop, the `{while}` loop! We continue the loop as long as the statement is true.\nSo don't forget to change the value in the loop.\n\nIn the example code, we continue until a correct answer has been given.\nIf the correct answer is never given, the loop never ends!"
example_code: "```\nanswer = 0\n{while} answer != 25\n answer = {ask} 'What is 5 times 5?'\n{print} 'A correct answer has been given'\n```\n"
18:
start_code: "name = 'Hedy'\n{print}('My name is ', name)"
story_text: "## The last level!\nWe arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on."
example_code: "```\n{print}('my name is Hedy!')\n```\n"
story_text_2: If you want to print more than one item, you need to separate them by commas.
story_text_3: "## Input\nThe final change we will need to make to get Python code is changing `{ask}` into `{input}`."
example_code_2: "```\ntemperature = 25\n{print}('It is ', temperature, 'degrees outside')\n```\n"
example_code_3: "```\n{print}('My name is Hedy!')\nname = {input}('What is your name?')\n{print}('So your name is ', name)\n```\n"
name: Introduction
story:
name: Story
default_save_name: Story
levels:
2:
start_code: '{print} Your story'
story_text: "## Story\nIn level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence.\n\nYou do have to program a little bit extra for that. You must now name your main character first.\n\nYou can then put that name anywhere in a sentence.\n"
example_code: "```\nname {is} {ask} What is the name of the main character?\n{print} name is now going to run in the woods\n{print} name is a bit scared\n{print} Suddenly he hears a crazy noise...\n{sleep}\n{print} name is afraid this is a haunted forest\n```"
3:
example_code_3: "```\n{print} His backpack got way too heavy.\n{print} Inside were a bottle of water, a flashlight and a brick.\nbag {is} water, flashlight, brick\ndump {is} {ask} Which item should he dump?\n{remove} dump {from} bag\n```\n"
start_code: '{print} Your story'
story_text: "## Story\nIn level 3 you can make your story more fun. You can use randomness for any monster, animal or other obstacle, like this:\n"
example_code: "```\nanimals {is} \U0001F994, \U0001F43F, \U0001F989, \U0001F987\n{print} He now hears the sound of an animals {at} {random}\n```\n"
story_text_2: "The command `{add}` can also come in handy in your story.\n"
example_code_2: "```\n{print} He hears a sound\nanimals {is} \U0001F43F, \U0001F994, \U0001F987, \U0001F989\nanimal {is} {ask} What do you think it is?\n{add} animal {to_list} animals\n{print} it was a animals {at} {random}\n```\n"
story_text_3: "This is an example of the `{remove}` command in your story\n"
4:
start_code: "{print} 'Your story will be printed here!'"
story_text: "## Story\nYou may have noticed that there is still a problem in the previous levels. Did you try to print a sentence that contained the word name?\nYou can solve that in this level. You must use quotation marks for everything that you are going to print.\n"
example_code: "```\nname {is} Hans\n{print} 'The name of the main character is' name\n{print} name 'is now going to walk in the woods'\n{print} name 'is a bit scared'\nanimals {is} \U0001F994, \U0001F43F, \U0001F989, \U0001F987\n{print} 'He hears the sound of an' animals {at} {random}\n{print} name 'is afraid this is a haunted forest'\n```\n"
8:
start_code: '# place your code here'
story_text: "## Story\nIn this level you can use multiple lines in your {if} commands, this way you can upgrade your happy or sad ending!\n"
example_code: "```\n{print} 'OH NO! The T-rex is closing in!'\nend = {ask} 'Do you want a happy or a sad ending?'\n{if} end {is} happy\n {print} 'Just in time Richard jumps back into the time machine!'\n {print} 'Michael types in the code and...'\n {print} '\U0001F4A5ZAP!\U0001F4A5'\n {print} 'They are back in their garage'\n{else}\n {print} 'Michael yells COME ON RICHARD! RUN FASTER!'\n {print} 'But Richard is too slow...'\n {print} 'The T-rex closes in and eats him in one big bite!\U0001F996'\n```\n"
9:
start_code: '# place your code here'
story_text_2: The example above is pretty straightforward, but by nesting {if} you can really elaborate your code and turn your story into a real game. Check out this example!
story_text: "## Story\nIn this level you can use nesting to put {if}, {repeat} or {for} commands inside other {if}, {repeat} or {for} commands. This gives you many options and really helps you to make your story interactive.\n"
example_code: "```\n{print} 'Robin is walking downtown'\nlocation = {ask} 'Is Robin going into a shop, or does she go home?'\n{if} location {is} shop\n {print} 'She enters the shop.'\n {print} 'Robin sees an interesting looking book'\n book = {ask} 'Does Robin buy the book?'\n {if} book {is} yes\n {print} 'Robin buys the book and goes home'\n {else}\n {print} 'Robin leaves the shop and goes home'\n{else}\n {print} 'Robin goes home'\n```\n"
example_code_2: "## Elaborate code\n```\nsword = lost\ngame = on\n{print} 'Our hero is walking through the forest'\n{print} 'The path splits two ways'\n{repeat} 2 {times}\n {if} game {is} on\n path = {ask} 'Which path should she choose?'\n {if} path {is} left\n {if} sword {is} found\n {print} 'Our hero comes across a dragon!'\n {print} 'Luckily our hero has a sword to defeat the beast!'\n game = over\n {else}\n {print} 'Our hero finds a dragon, but she doesnt have any weapons!'\n {print} 'Our hero is beaten by the dragon...'\n {print} 'Try again'\n game = over\n {if} path {is} right\n {if} sword {is} lost\n {print} 'Our hero finds a sword'\n {print} 'This could come in very handy'\n sword = found\n {else}\n {print} 'You have already found the sword. There is nothing left here.'\n {print} 'She walks back'\n```\n"
13:
start_code: '# place your code here'
story_text: "## Story\nBy using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story.\n"
example_code: "```\nsword = 'lost'\ngame = 'on'\n{print} 'Our hero is walking through the forest'\n{print} 'The path splits two ways'\n{for} i {in} {range} 0 {to} 2\n {if} game {is} 'on'\n path = {ask} 'Which path should she choose?'\n {if} path {is} 'left' {and} sword {is} 'found'\n {print} 'Our hero comes across a dragon!'\n {print} 'Luckily our hero has a sword to defeat the beast!'\n game = 'over'\n {if} path {is} 'left' {and} sword {is} 'lost'\n {print} 'Our hero finds a dragon, but she doesnt have any weapons!'\n {print} 'Our hero is beaten by the dragon...'\n {print} 'Try again'\n game = 'over'\n {if} path {is} 'right' {and} sword {is} 'found'\n {print} 'You have already found the sword. There is nothing left here.'\n {print} 'She walks back'\n {if} path {is} 'right' {and} sword {is} 'lost'\n {print} 'Our hero finds a sword'\n {print} 'This could come in very handy'\n sword = 'found'\n```\n"
1:
story_text: "## Make a story\nIn level 1 you can make a story with a different main character that you enter yourself.\n\nIn the first line, use `{ask}` and ask who the main character of the story will be.\n\nAfter that first line, start with `{print}` if the sentence needs to be printed.\nYou use `{echo}` if you want your main character to be at the end of the sentence.\n"
example_code: "```\n{ask} The main character of this story is\n{print} The main character is now going to walk in the forest\n{echo} He's a bit scared,\n{print} He hears crazy noises everywhere\n{print} He's afraid this is a haunted forest\n```\n"
start_code: '{print} Your story starts here'
story_text_2: "## Challenge\nCan you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`?\n"
5:
example_code: "```\nname {is} {ask} 'Who is walking in the forest?'\n{print} name 'walks through the forest'\n{print} name 'encounter a monster'\nend {is} {ask} 'Would you like a good or a bad ending?'\n{if} end {is} good {print} name 'takes the sword and the monster quickly runs away'\n{else} {print} 'The monster eats' name\n```\n"
start_code: "{print} 'Here your story will start!'"
story_text: "## Story\nIn this level you can program different endings, which will make your story even more fun.\n\nThink of two endings for your story, for example:\n\n- The princess is walking through the forest\n- She runs into a monster\n\n- Happy ending: She takes her sword and the monster quickly runs away\n- Bad Ending: The monster eats the princess\n\nYou can also ensure that a name can be entered again. That works just like in the previous levels. You can combine that with an `{if}`, and then you have already made a whole program!\n"
7:
story_text: "## Story\nIn a story, someone says words several times. For example, when someone calls for help or sings a song.\nYou can put such repetitions in your story, in this level with `{repeat}`.\n"
example_code: "```\n{print} 'The prince kept calling for help'\n{repeat} 5 {times} {print} 'Help!'\n{print} 'Why is nobody helping me?'\n```\n"
start_code: "{repeat} 5 {times} {print} 'Help!'"
10:
story_text: "## Story\nIn this level you can use the {for} command in your story. In this way you could easily program the children's book 'brown bear, brown bear, what do you see'.\n"
example_code: "```\nanimals = red bird, black sheep, green frog, yellow duck, little child\n{print} 'brown bear'\n{print} 'brown bear'\n{print} 'What do you see?'\n{for} animal {in} animals\n {print} 'I see a ' animal ' looking at me'\n {print} animal\n {print} animal\n {print} 'What do you see?'\n{print} 'I see all the animals looking at me!'\n```\n"
start_code: '# place your code here'
12:
story_text: "## Story\nIn this level you can use the quotation marks to save multiple words in a variable."
example_code: "```\nname = 'The Queen of England'\n{print} name ' was eating a piece of cake, when suddenly...'\n```\n"
start_code: '# place your code here'
15:
story_text: "## Story\nUsing the `{while}` loop can make your stories more interesting. For example, you can use `{while} game {is} 'on'` so you can play until the game is over.\nOr you can use `{while} sword {is} 'lost'` so the player can't continu the game until they have found something.\n"
example_code: "```\nkeys = 'lost'\n{print} 'You are standing in your garden and you have lost your keys.'\n{print} 'Where do you want to look for them?'\n{print} 'You can choose: tree, flowerbed, rock, postbox'\n{while} keys == 'lost'\n location = {ask} 'Where do you want to look?'\n {if} location == 'flowerbed'\n {print} 'Here they are!'\n keys = 'found'\n {else}\n {print} 'Nope they are not at the ' location\n{print} 'Now you can enter the house!'\n```\n"
start_code: '# place your code here'
description: Story
parrot:
default_save_name: Parrot
name: Parrot
description: Create your own online pet parrot that will copy you!
levels:
1:
story_text: "## Parrot\nCreate your own online pet parrot that will copy you!\n"
example_code: "```\n{print} Im Hedy the parrot\n{ask} whats your name?\n{echo}\n{echo}\n```\n"
start_code: '{print} Im Hedy the parrot'
story_text_2: "## Challenge\nCan you make the parrot ask a different question? Fill in the blanks in the example!\n"
example_code_2: "```\n{print} Im Hedy the parrot\n{ask} _\n{echo}\n{echo}\n"
2:
story_text: "## Parrot\nCreate your own online pet parrot that will copy you!\n"
example_code: "```\n{print} Im Hedy the parrot\nname {is} {ask} whats your name?\n{print} name\n{sleep}\n{print} squawk\n{sleep}\n{print} name\n```\n"
start_code: '{print} Im Hedy the parrot!'
story_text_2: "## Challenge\nYou can use variables to make the parrot say more than only your name. Can you complete this code?\n"
example_code_2: "```\n{print} Im Hedy the parrot\nname {is} {ask} whats your name?\n{print} name\n{sleep}\n{print} name\nsurname {is} {ask} whats your surname?\n_\n{sleep}\n_\n```\n"
3:
story_text: "## Parrot\nTeach your parrot a new word with `{add}`.\n"
example_code: "```\nwords {is} squawk, Hedy\n{print} Train your parrot!\nnew_word {is} {ask} Which word do you want to teach them?\n{add} new_word {to_list} words\n{print} \U0001F9D2 Say new_word , Hedy!\n{print} \U0001F99C words {at} {random}\n```\n"
start_code: '# place your code here'
5:
story_text: "## Parrot\nReward your parrot if it says the correct word!\n"
example_code: "```\nwords {is} squawk, Hedy\n{print} 'Train your parrot!'\nnew_word {is} {ask} 'Which word do you want to teach them?'\n{add} new_word {to_list} words\nsaid_word {is} words {at} {random}\n{print} '\U0001F9D2 Say ' new_word ', Hedy!'\n{print} '\U0001F99C ' said_word\n{if} said_word {is} new_word {print} '\U0001F9D2 Great job, Hedy! \U0001F36A'\n{else} {print} '\U0001F9D2 No, Hedy! Say ' new_word\n```\n"
start_code: '# place your code here'
4:
story_text: "## Parrot\nIn this level we have to use quotation marks with the commands `{ask}` and `{print}`.\nCan you complete the code by adding quotation marks?\n"
example_code: "```\nwords {is} squawk, Hedy\n{print} _ Train your parrot! _\nnew_word {is} {ask} _ Which word do you want to teach them? _\n{add} new_word {to_list} words\n{print} _ \U0001F9D2 Say _ new_word _, Hedy!_\n{print} _ \U0001F99C _ words {at} {random}\n```\n"
start_code: '# Write your code here'
songs:
levels:
6:
start_code: "{print} 'Baby shark'"
story_text: "## Songs\nSongs often contain a lot of repetition. Sometimes the repetition is also based on counting.\nFor example, in the well-known song 'Bottles of beer'. You can program that song with a little math.\n"
example_code: "```\nverse = 99\n{print} verse ' bottles of beer on the wall'\n{print} verse ' bottles of beer'\n{print} 'Take one down, pass it around'\nverse = verse - 1\n{print} verse ' bottles of beer on the wall'\n```\n\nYou can now repeat lines 2 to 9 as many times as you want by copying the lines.\n"
story_text_2: "## 5 Little Monkeys jumping on the bed\nThis children's song counts down from 5 little monkeys to 1 monkey.\nIf you copy line 2 - 7 and paste it under the the code, you can sing the whole song!\n"
example_code_2: "```\nnumber = 6\nnumber = number - 1\nprint number ' little monkeys jumping on the bed'\nprint 'One fell off and bumped his head'\nprint 'Mama called the doctor and the doctor said'\nprint 'NO MORE MONKEYS JUMPING ON THE BED!'\nsleep\n```\n"
8:
start_code: '# place your code here'
story_text: "## Songs\nIn a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line!\n"
example_code: "```\nverse = 99\n{repeat} 99 {times}\n {print} verse ' bottles of beer on the wall'\n {print} verse ' bottles of beer'\n {print} 'Take one down, pass it around'\n verse = verse - 1\n {print} verse ' bottles of beer on the wall'\n```\n"
10:
start_code: '# place your code here'
story_text: "## Songs\nIn this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus?\nYou can also make the whole baby shark song (including all the other sharks in the family) in only 6 lines!\nOr you can make Old McDonald with all the different animals.\n"
example_code: "## 5 Little Monkeys Jumping on the bed\n```\nmonkeys = 5, 4, 3, 2\n{for} monkey {in} monkeys\n {print} monkey ' little monkeys jumping on the bed'\n {print} 'One fell off and bumped his head'\n {print} 'Mama called the doctor and the doctor said'\n {print} 'NO MORE MONKEYS JUMPING ON THE BED!'\n```\n\n## Baby Shark\n```\nsharks = baby, mommy, daddy, grandma, grandpa\n{for} shark {in} sharks\n {print} shark 'tututututudu'\n {print} shark 'tututututudu'\n {print} shark 'tututututudu'\n {print} shark\n```\n## Old McDonald\n```\nanimals = pig, dog, cow\n{for} animal {in} animals\n {if} animal {is} pig\n sound = oink\n {if} animal {is} dog\n sound = woof\n {if} animal {is} cow\n sound = moo\n {print} 'Old McDonald had a farm'\n {print} 'E I E I O!'\n {print} 'and on that farm he had a ' animal\n {print} 'E I E I O!'\n {print} 'with a ' sound sound ' here'\n {print} 'and a ' sound sound ' there'\n {print} 'here a ' sound\n {print} 'there a ' sound\n {print} 'everywhere a ' sound sound\n```\n"
11:
start_code: '# place your code here'
example_code: "## 5 little monkeys\n```\n{for} i {in} {range} 5 {to} 1\n {print} i ' little monkeys jumping on the bed'\n {print} 'One fell off and bumped his head'\n {print} 'Mama called the doctor and the doctor said'\n {if} i {is} 1\n {print} 'PUT THOSE MONKEYS RIGHT TO BED!'\n {else}\n {print} 'NO MORE MONKEYS JUMPING ON THE BED!'\n```\n"
story_text: "## Songs\nIn this level you can use the `{for} i {in} {range}` command to make songs that use counting.\n"
7:
story_text: "## Songs\nSongs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing:\n\nBaby Shark tututudutudu <br>\nBaby Shark tututudutudu <br>\nBaby Shark tututudutudu <br>\nBaby Shark\n\nYou can make this song much shorter with a `{repeat}`! Can you finish the code?\n"
example_code: "```\n{repeat} _ _ {print} 'Baby Shark tututudutudu'\n{print} 'Baby Shark'\n```\n\nAfter Baby Shark you can of course also program other songs. There are many songs with repetition.\n"
start_code: "{print} 'Baby Shark'"
12:
story_text: "## Sing a song!\nIn this song we can make it even easier to program '{if} you're happy and you know it, clap your hands'. Because we can put all of the actions in a variable, check it out:\n"
example_code: "```\nactions = 'clap your hands', 'stomp your feet', 'shout Hurray!'\n{for} action {in} actions\n {for} i {in} {range} 1 {to} 2\n {print} 'if youre happy and you know it'\n {print} action\n {print} 'if youre happy and you know it and you really want to show it'\n {print} 'if youre happy and you know it'\n {print} action\n```\n"
start_code: '# place your code here'
16:
story_text: "## Sing a song!\nIn this level, you can program a song like OldMacDonald even more quickly. You can connect the right animal to the right sound by simply putting them in the same place in the list.\nThe Drunken Sailor is also quickly made in this level. You only need 8 lines for the entire song, check it out!\n"
start_code: '# place your code here'
example_code: "## Old MacDonald\n```\nanimals = ['pig', 'dog', 'cow']\nsounds = ['oink', 'woof', 'moo']\n{for} i {in} {range} 1 {to} 3\n animal = animals[i]\n sound = sounds[i]\n {print} 'Old McDonald had a farm'\n {print} 'E I E I O!'\n {print} 'and on that farm he had a ' animal\n {print} 'E I E I O!'\n {print} 'with a ' sound sound ' here'\n {print} 'and a ' sound sound ' there'\n {print} 'here a ' sound\n {print} 'there a ' sound\n {print} 'everywhere a ' sound sound\n```\n\n## Drunken Sailor\n```\nlines = ['what shall we do with the drunken sailor', 'shave his belly with a rusty razor', 'put him in a long boat till hes sober']\n{for} line {in} lines\n {for} i {in} {range} 1 {to} 3\n {print} line\n {print} 'early in the morning'\n {for} i {in} {range} 1 {to} 3\n {print} 'way hay and up she rises'\n {print} 'early in the morning'\n```\n"
name: Sing a song!
description: Print a song
default_save_name: Song
turtle:
description: Make your own drawing
default_save_name: Turtle
levels:
2:
example_code: "```\nanswer {is} {ask} How many steps should the turtle make?\n{forward} answer\n```\n"
story_text: "## Turtle\nIn this level you can use variables to make the turtle interactive. For example you can ask the player how many steps the turtle must make.\n"
story_text_2: "Also, in level 1 the turtle could only turn left or right. That is a bit boring!\nIn level 2 he can point his nose in all directions.\n\nUse 90 to turn a quarter. We call this degrees. A full turn is 360 degrees.\nCan you make a figure with this code? Maybe a triangle or a circle?\n"
example_code_2: "```\n{print} Drawing figures\nangle {is} 90\n{turn} angle\n{forward} 25\n{turn} angle\n{forward} 25\n```\n"
start_code: "{print} Turtle race!\nhoek {is} 90\n{turn} hoek\n{forward} 25"
3:
example_code: "```\nangles {is} 10, 50, 90, 150, 250\n{turn} angles {at} {random}\n{forward} 25\n```\n"
start_code: "angles {is} 10, 50, 90, 150, 250\n{turn} angles {at} {random}\n{forward} 25"
story_text: "## Searching turtle\nIn this level you can use use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time.\nUse `{at} {random}` to choose a value from a list. You can copy and paste lines 2 and 3 to create a longer random path.\n"
4:
story_text: "## Let's draw\nIn level 4 you have to use quotation marks with `{print}` and `{ask}`. Also when drawing!\n"
example_code: "```\n{print} 'Drawing figures'\nangle {is} 90\n{turn} angle\n{forward} 25\n{turn} angle\n{forward} 25\n```\n"
start_code: "{print} 'Drawing figures'\nangle {is} 90\n{turn} angle\n{forward} 25"
story_text_2: "## Colors\nYou can also change the color of the lines with the command `{color}`. Check out the example.\nYou can also use the command `{color} {white}` to make 'invisible' lines. You could use these white lines to move the turtle anywhere in the screen before you start drawing.\n"
example_code_2: "```\n{color} {white}\n{forward} -80\n{color} {green}\n{forward} 50\n{color} {yellow}\n{forward} 50\n{color} {red}\n{forward} 50\n```\n"
5:
example_code: "```\n{print} 'Drawing Figures'\nfigure {is} {ask} 'Do you want a square or a triangle?'\n{if} figure {is} triangle angle {is} 120\n{else} angle {is} 90\n{turn} angle\n{forward} 25\n{turn} angle\n{forward} 25\n{turn} angle\n{forward} 25\n{turn} angle\n{forward} 25\n```\n"
start_code: "{print} 'Drawing Figures'\nfigure {is} {ask} 'Do you want a square or a triangle?'\n{if} figure {is} triangle angle {is} 120 {else} angle {is} 90\n{turn} angle\n{forward} 25"
story_text: "## Let's draw\nIn level 5 you can make a choice with `{if}`. For example between different types of figures.\n"
6:
start_code: "{print} 'Drawing figures'"
story_text: "## Let's draw\nIn this level you can use calculations to draw different figures.\nYou may have learned in school that turning a full circle is 360 degrees. If not, now you know!\nThat's why you also use 90 degrees for a square. 360 divided by 4 is 90.\nNow that we can do math with Hedy, we can draw all the figures we want!\n"
example_code: "```\nangles = {ask} 'How many angles do you want?'\nangle = 360 / angles\n{forward} 50\n{turn} angle\n{forward} 50\n{turn} angle\n{forward} 50\n{turn} angle\n{forward} 50\n{turn} angle\n{forward} 50\n{turn} angle\n{forward} 50\n{turn} angle\n```\n"
8:
start_code: angles = {ask} 'How many angles should I draw?'
example_code: "```\nangle = 90\n{repeat} 10 {times}\n {turn} angle\n {forward} 50\n```\n"
story_text: "## Let's draw\nNow that we can repeat several lines, we can make figures more easily.\nWe only have to set the angle once and then use that variable in the `{repeat}`.\n"
story_text_2: "## Interaction\nAlso, we can now improve the program that draws different figures.\nCan you figure out how far the turtle has to turn here? Finish the code and you can draw any polygon you'd like!\n"
example_code_2: "```\nangles = {ask} 'How many angles should I draw?'\nangle = 360 / angles\n{repeat} angle {times}\n {turn} _\n {forward} _\n```\n"
1:
story_text: "## Let's draw\nYou can also use Hedy to draw. By combining turns and lines, you can make a square or stairs!\n\nUsing `{forward}` you draw a line forwards. The number behind it determines how far the turtle will walk. `{turn} {right}` turns a quarter turn in clockwise direction, `{turn} {left}` turns counter clockwise.\nIf you want to go backwards, you use the `{forward}` command but with a negative number. So for example `{forward} -100`\n\nThis is the start of a little staircase. Can you make it have 5 steps?\n"
example_code: "```\n{forward} 50\n{turn} {right}\n{forward} 50\n{turn} {left}\n{forward} 50\n```\n"
start_code: "{forward} 50\n{turn} {left}"
name: Turtle
dishes:
levels:
3:
start_code: '{print} Who does the dishes?'
example_code: "```\npeople {is} mom, dad, Emma, Sophie\n{print} people {at} {random}\n```\n"
story_text: "## Dishwashing\nDo you always disagree at home about who should wash the dishes or change the litter box today?\nThen you can let the computer choose very fairly. You can program that in this level!\nYou first make a list of the members of your family. Then choose '{at} {random}' from the list.\n"
story_text_2: "## Hack the dishwashing program!\nDon't feel like doing the dishes yourself? Hack the program to remove your name from the list.\n"
example_code_2: "```\npeople {is} mom, dad, Emma, Sophie\nyour_name {is} {ask} Who are you?\n{remove} your_name {from} people\n{print} people {at} {random} does the dishes\n```\n"
4:
example_code: "```\npeople {is} mom, dad, Emma, Sophie\n{print} _ the dishes are done by _\n{sleep}\n{print} people {at} _\n```\n"
story_text: "## Dishwashing\nWith quotation marks you can make your dishwashing planning more beautiful.\nThis time the sample code is not quite complete.\n\nCan you complete the code by filling the blanks? Every blank must be replaced with one word of symbol.\n\nTip: Don't forget the quotation marks!\n"
start_code: "{print} 'Who does the dishes?'"
5:
example_code: "```\npeople {is} mom, dad, Emma, Sophie\ndishwasher {is} people {at} {random}\n{if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ {else} {print} 'luckily no dishes because' _ 'is already washing up'\n```\n"
start_code: "{print} 'Who does the dishes?'"
story_text: "## Dishwashing\nWith the `{if}` you can now have more fun with choice in the program. You can have your program respond to the choice that the computer has made.\n\nCan you finish the code so that it prints 'too bad' when it is your turn and otherwise 'yes!'?\nDon't forget the quotes!\n"
10:
start_code: '# place your code here'
story_text: "## Dishwashing\nIn this level you could make an even better dish washing shedule.\n"
example_code: "```\ndays = Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday\nnames = mom, dad, Emma, Sophie\n{for} day {in} days\n {print} names {at} {random} ' does the dishes on ' day\n```\n"
6:
example_code_2: "```\npeople = mom, dad, Emma, Sophie\ndishwasher = people {at} {random}\n{print} 'Monday the dishes are done by: ' dishwasher\n{remove} dishwasher {from} people\ndishwasher = people {at} {random}\n{print} 'Tuesday the dishes are done by: ' dishwasher\n{remove} dishwasher {from} people\ndishwasher = people {at} {random}\n```\n"
start_code: "{print} 'Who does the dishes?'"
story_text: "## Dishwashing\nHow often is everyone going to do the dishes? Is that fair? You can count it in this level.\n"
example_code: "```\npeople = mom, dad, Emma, Sophie\nemma_washes = 0\ndishwasher = people {at} {random}\n{print} 'The dishwasher is' dishwasher\n{if} dishwasher {is} Emma emma_washes = emma_washes + 1\n{print} 'Emma will do the dishes this week' emma_washes 'times'\n```\n\nNow you can copy lines 3 to 5 a few times (e.g. 7 times for a whole week) to calculate for a whole week again.\nDo you make the code for the whole week?\n"
story_text_2: "## Make it fair\nIf you are extremely unlucky the previous program might choose you to to the dishes for the whole week! That's not fair!\nTo create a fairer system you can use the `{remove}` command to remove the chosen person from the list. This way you don't have to do the dishes again untill everybody has had a turn.\n\nMonday and tuesday are ready for you! Can you add the rest of the week?\nAnd... can you come up with a solution for when your list is empty?\n"
7:
story_text: "## Dishwashing\nWith the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week.\n"
example_code: "```\npeople = mom, dad, Emma, Sophie\n{repeat} _ _ {print} 'the dishwasher is' _\n```\n"
start_code: "{print} 'Who does the dishes?'"
name: Dishes?
description: Use the computer to see who does the dishes (Start at level 2)
default_save_name: Dishes
dice:
default_save_name: Dice
levels:
4:
start_code: "{print} 'What will the die indicate this time?'"
example_code: "```\nchoices {is} 1, 2, 3, 4, 5, earthworm\n{print} _ you threw _\n{print} _ _ _ <- here you have to program the choice\n```\n"
story_text: "## Dice\nIn this level we can make sentences with the die value in the sentence, with quotes of course.\nThis time the sample code is not quite complete. Can you finish the code?\n"
5:
example_code: "```\nchoices {is} 1, 2, 3, 4, 5, earthworm\nthrow {is} _\n{print} 'you have' _ 'thrown'\n{if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear it again!'\n```\n"
story_text: "## Dice\nYou can also make a die again in this level using the `{if}`.\nComplete the sample code so that the code says \"You can stop throwing\" once you have thrown an earthworm.\n\nBut maybe you want to recreate a die from a completely different game. That's fine too! Then make up your own reaction. Eg 'yes' for 6 and 'pity' for something {else}.\n"
start_code: "{print} 'What will the die indicate this time?'"
6:
example_code: "```\nchoices = 1, 2, 3, 4, 5, earthworm\npoints = 0\nthrow = choices {at} {random}\n{print} 'you threw' throw\n{if} throw {is} earthworm points = points + 5 {else} points = points + throw\n{print} 'those are' points ' point'\n```\nCan you make the code so that you get the total score for 8 dice? To do that, you have to cut and paste some lines of the code.\n"
example_code_2: "## Looking forward\n\nDid you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7!\n"
start_code: "{print} 'What will the die indicate this time?'"
story_text: "## Dice\nYou can also make an Earthworm die again in this, but now you can also calculate how many points have been rolled.\nYou may know that the worm counts 5 points for Earthworms. Now after a roll you can immediately calculate how many points you have thrown.\nThis is the code to calculate points for one die:\n"
7:
start_code: "{print} 'What will the die indicate this time?'"
story_text: "## Dice\nYou can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice.\nTry to finish the sample code! The dashes should contain multiple commands and characters.\n\nBut maybe you want to make a completely different die. Of course you can!\n"
example_code: "```\nchoices = 1, 2, 3, 4, 5, earthworm\n{repeat} _ _ {print} _ _ _\n```\n"
3:
story_text: "## Dice\nIn this level we can choose from a list. With that we can let the computer choose one side of the die.\nTake a look at the games you have in your closet at home.\nAre there games with a (special) die? You can also copy it with this code.\nFor example, the dice of the game Earthworms with the numbers 1 to 5 and an earthworm on it.\n\n![Die of earthworms with 1 to 5 and an earthworm on it](https://cdn.jsdelivr.net/gh/felienne/hedy@24f19e9ac16c981517e7243120bc714912407eb5/coursedata/img/dobbelsteen.jpeg)\n"
example_code: "```\nchoices {is} 1, 2, 3, 4, 5, earthworm\n{print} choices {at} {random}\n```\n"
start_code: '{print} What will the die indicate this time?'
example_code_2: "```\nchoices {is} _\n```\n"
story_text_2: "## Challenge\nThe dice in the example above are dice for a specific game. Can you make normal dice?\nOr other special dice from a different game?\n"
15:
example_code: "```\noptions = 1, 2, 3, 4, 5, 6\n{print} 'Throw 6 as fast as you can!'\nthrown = 0\ntries = 0\n{while} thrown != 6\n thrown = options {at} {random}\n {print} 'You threw ' thrown\n tries = tries + 1\n{print} 'Yes! You have thrown 6 in ' tries ' tries.'\n```\n"
story_text: "## Dice\nIn this game you have to throw 6 in as little tries as possible.\n"
start_code: '# place your code here'
10:
story_text: "## Dice\nIs everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once!\n"
example_code: "```\nplayers = Ann, John, Jesse\nchoices = 1, 2, 3, 4, 5, 6\n{for} player {in} players\n {print} player ' throws ' choices {at} {random}\n {sleep}\n```\n"
start_code: '# place your code here'
name: Dice
description: Make your own dice
rock:
default_save_name: Rock
levels:
1:
start_code: '{print} Welcome to your own rock scissors paper!'
story_text: "## Rock, paper, scissors\nIn level 1 you can start with a rock, paper, scissors game.\n\nWith `{ask}` you can make a choice, and with `{echo}` you can repeat that choice.\n"
example_code: "```\n{print} what do you choose?\n{ask} choose from rock, paper or scissors\n{echo} so your choice was:\n```\nInstead of using words, you could also use emojis of course: ✊✋✌\n"
story_text_2: "## Challenge\nInstead of using words, you could also use emojis: ✊✋✌\nCan you create a code using emojis?\n"
example_code_2: "```\n{print} what do you choose?\n{ask} choose from _\n{echo} so your choice was:\n```\n"
3:
story_text: "## Rock, paper, scissors\n\nIn this level we can enter lists and choose things from them.\nYou first make a list with `{is}`. Then you can let the computer choose something from the list with `{at} {random}`.\nFor example, you can let the computer pick from rock, paper and scissors.\n"
example_code: "```\nchoices {is} rock, paper, scissors\n{print} choices {at} {random}\n```\n"
start_code: '{print} Welcome to your own rock scissors paper!'
story_text_2: "## Challenge\nNow you only have one player, so can you add a second player?\nYou can even use variables to name player 1 and player 2.\n"
example_code_2: "```\nchoices {is} rock, paper, scissors\n{print} player 1 chooses... choices {at} {random}\n{print} player 2 _\n```\n"
9:
start_code: '# place your code here'
story_text: "## Rock, paper, scissors\nIn this level you can program the whole rock, paper, scissors game by nesting the {if}-commands. Can you finish the code?\n"
example_code: "```\nchoices {is} rock, paper, scissors\nyour_choice {is} {ask} 'What do you choose?'\n{print} 'You choose ' your_choice\ncomputer_choice {is} choices {at} {random}\n{print} 'The computer chooses ' computer_choice\n{if} computer_choice {is} your_choice\n {print} 'Tie'\n{if} computer_choice {is} rock\n {if} your_choice {is} paper\n {print} 'You win!'\n {if} your_choice {is} scissors\n {print} 'You lose!'\n# finish this code\n```\n"
10:
story_text: "## Rock, Paper, Scissors\nFeeling too lazy to play the game yourself? Let Hedy play it for you!\n"
example_code: "```\nchoices = rock, paper, scissors\nplayers = Marleen, Michael\n{for} player {in} players\n {print} player ' chooses ' choices {at} {random}\n```\n"
start_code: '# place your code here'
15:
start_code: '# place your code here'
story_text: "## Rock, Paper, Scissors\nPlay until you beat the computer! But first, finish the example code...\n"
example_code: "```\nwon = 'no'\noptions = 'rock', 'paper', 'scissors'\n{while} won == 'no'\n your_choice = {ask} 'What do you choose?'\n computer_choice = options {at} {random}\n {print} 'you chose ' your_choice\n {print} 'the computer chose ' computer_choice\n {if} computer_choice == your_choice\n {print} 'Tie!'\n {if} computer_choice == 'rock' {and} your_choice == 'scissors'\n {print} 'You lose!'\n {if} computer_choice == 'rock' {and} your_choice == 'paper'\n {print} 'You win!'\n won = 'yes'\n```\n"
5:
example_code: "```\noptions {is} rock, paper, scissors\ncomputer_choice {is} _\nchoice {is} {ask} 'What do you choose?'\n{print} 'you chose ' _\n{print} 'computer chose ' _\n{if} _ {is} _ {print} 'tie!' {else} {print} 'no tie'\n```\n\nFill in the correct code on the blanks to see {if} it is a draw.\n"
start_code: "{print} 'Welcome to your own rock scissors paper!'"
story_text: "## Rock, paper, scissors\nIn this level we can determine who won.\nFor that you need the new `{if}` code.\n\nSave your choice with the name of choice and the choice of computer as computer choice.\nThen you can use `{if}` to see {if} they are the same or different.\nWill you finish the code?\n"
2:
story_text: "## Rock, paper, scissors\nIn this level you can practise using the variables, so that you can make the rock, paper, scissors game in the next level!\n"
example_code: "```\nchoice {is} _\n{print} I choose choice\n```\n"
start_code: '# place your code here'
4:
story_text: "## Rock, paper, scissors\nIn this level we can further program rock, paper, scissors. But {if} you want to add text, you have to use quotation marks here too.\nDo you complete the code by entering the correct commands or characters on the underscores?\n"
example_code: "```\nchoices {is} rock, paper, scissors\n{print} _ The computer chose: _ _ {at} _\n```\n"
start_code: "{print} 'Welcome to your own rock scissors paper!'"
13:
example_code: "```\noptions = 'rock', 'paper', 'scissors'\nyour_choice = {ask} 'What do you choose?'\ncomputer_choice = options {at} {random}\n{print} 'You choose ' your_choice\n{print} 'The computer chooses ' computer_choice\n{if} computer_choice {is} your_choice\n {print} 'Tie'\n{if} computer_choice {is} 'rock' {and} your_choice {is} 'paper'\n {print} 'You win!'\n{if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors'\n {print} 'The computer wins!'\n```\n"
start_code: '# place your code here'
story_text: "## Rock, paper, scissors\nWith the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it.\n"
name: Rock, paper, scissors
description: Make your own rock, paper, scissors game
calculator:
levels:
9:
start_code: "{print} 'Welcome to this calculator!'"
story_text: "## Calculator\nIn previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this...\n"
example_code: "```\nscore = 0\n{repeat} 10 {times}\n numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\n number1 = numbers {at} {random}\n number2 = numbers {at} {random}\n correct_answer = number1 * number2\n {print} 'What is ' number1 ' times ' number2 '?'\n answer = {ask} 'Type your answer here...'\n {print} 'Your answer is' answer\n {if} answer {is} correct_answer\n score = score + 1\n{print} 'Great job! Your score is... ' score ' out of 10!'\n```\n"
14:
start_code: '# place your code here'
story_text: "## Guess which number\nIn this level you can programm the game 'Guess which number'\n"
example_code: "```\n{print} 'Guess which number'\nnumbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\nnumber = numbers {at} {random}\ngame = 'on'\n{for} i {in} {range} 1 {to} 10\n {if} game == 'on'\n guess = {ask} 'Which number do you think it is?'\n {if} guess > number\n {print} 'Lower!'\n {if} guess < number\n {print} 'Higher!'\n {if} guess == number\n {print} 'You win!'\n game = 'over'\n```\n"
15:
story_text: "## Calculator\nYou can add the `{while}` loop to the calculator game you've learned to make in a previous level.\nThis makes sure the player can't continue to the next question {if} they answer incorrectly.\n"
example_code: "```\nscore = 0\n{for} i {in} {range} 0 {to} 9\n numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\n number1 = numbers {at} {random}\n number2 = numbers {at} {random}\n correct = number1 * number2\n answer = 0\n {while} answer != correct\n {print} 'How much is ' number1 ' times ' number2 '?'\n answer = {ask} 'Fill in your answer:'\n {print} 'Your answer is ' answer\n {print} 'Good job!'\n{print} 'You win!'\n```\n"
start_code: '# place your code here'
6:
story_text: "## Calculator\nNow that you can calculate, you can also create a program to practice maths calculations. You can make up the calculations yourself, for example:\n"
example_code: "```\ncorrect_answer = 11 * 27\nanswer = {ask} 'How much is 11 times 27?'\n{if} answer {is} correct_answer {print} 'good job!'\n{else} {print} 'Wrong! It was ' correct_answer\n```\n"
story_text_2: "## Random numbers\nYou can also let the computer do random sums on its own using random.\nThis is how you choose a number of tables to practice, and from that you always get a different sum:\n"
example_code_2: "```\ntables = 4, 5, 6, 8\nnumbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\ntable = tables {at} {random}\nnumber = numbers {at} {random}\ncorrect_answer = table * number\nanswer = {ask} 'how much is ' table ' times ' number '?'\n{if} answer {is} correct_answer {print} 'okay'\n{else} {print} 'mistake! it was ' correct_answer\n```\n"
start_code: "{print} 'Welcome to this calculator!'"
story_text_3: "## Random numbers\nYou can also let the computer do random sums on its own using random.\nThis is how you choose a number of tables to practice, and from that you always get a different sum:\n"
example_code_3: "```\ntables = 4, 5, 6, 8\nnumbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\ntable = tables {at} {random}\nnumber = numbers {at} {random}\ncorrect_answer = table * number\nanswer = {ask} 'how much is ' table ' times ' number '?'\n{if} answer {is} correct_answer {print} 'okay'\n{else} {print} 'mistake! it was ' correct_answer\n```\n"
10:
story_text: "## Calculator\nThis calculator game helps you practise your tables of multiplication!\nIf you add more numbers to the list, you can practise all the multiplications.\n"
example_code: "```\nnumbers = 1, 2, 3\n{for} number1 {in} numbers\n {for} number2 {in} numbers\n answer = {ask} 'How much is ' number2 ' times ' number1 '?'\n correct = number1 * number2\n {if} answer {is} correct\n {print} 'Great job!'\n {else}\n {print} 'Thats wrong. The right answer is ' correct\n```\n"
start_code: '# place your code here'
12:
story_text: "## Calculator\nNow you can make a calculator that works for decimal numbers.\n"
example_code: "```\nnumber1 = {ask} 'What is the first number?'\nnumber2 = {ask} 'What is the second number?'\nanswer = number1 + number2\n{print} number1 ' plus ' number2 ' is ' answer\n```\n"
start_code: '# place your code here'
name: Calculator
description: Create a calculator
default_save_name: Calculator
restaurant:
levels:
3:
start_code: '# place your code here'
story_text: "## Random Restaurant\nHaving trouble to decide what you wanna have for dinner? You can let Hedy choose for you!\nSimply add lists of your favorite (or least favorite) meals and Hedy can randomly choose your dinner.\nYou can also have a bit of fun, by letting Hedy choose the price for your dinner as well! What will you get?\n"
example_code: "```\n{print} Welcome to Hedy's Random Restaurant!\n{print} The only restaurant that will randomly choose your meal and its price for you!\nstarters {is} salad, soup, carpaccio\nmains {is} pizza, brussels sprouts, spaghetti\ndesserts {is} brownies, ice cream, french cheeses\ndrinks {is} cola, beer, water\nprices {is} 1 dollar, 10 dollars, 100 dollars\n{print} You will start with: starters {at} {random}\n{print} Then we'll serve: mains {at} {random}\n{print} And as dessert: desserts {at} {random}\n{print} You will get a drinks {at} {random} to drink\n{print} That will be: prices {at} {random}\n{print} Thank you and enjoy your meal!\n```\n"
story_text_2: "## Allergies\nDoes your costumer have any allergies or do they dislike certain dishes? Then you can use the `{remove}`command to remove it from your menu.\n"
example_code_2: "```\n{print} Mystery milkshake\nflavors {is} strawberry, chocolate, vanilla\nallergies {is} {ask} Are you allergic to any falvors?\n{remove} allergies {from} flavors\n{print} You get a flavors {at} {random} milkshake\n```\n"
4:
start_code: '# place your code here'
story_text: "## Restaurant\nIn this level you have to use quotation marks when using the `{print}` command.\nCan you make your code from the previous levels work in this level too by adding the quotation marks?\n\nBe careful! In the previous levels apostrophes were allowed in the text, but in this level Hedy will confuse them for quotation marks and the code will not work!\nSo instead of typing `{print} Today we're serving pizza` , you should type `{print} 'Today we are serving pizza'`\n"
example_code: "## Example Hedy Restaurant\n```\n{print} 'Welcome to Hedys restaurant!'\n{print} 'Today we are serving pizza or lasagna.'\nfood {is} {ask} 'What would you like to eat?'\n{print} 'Great choice! The ' food ' is my favorite!'\ntopping {is} {ask} 'Would you like meat or veggies on that?'\n{print} food ' with ' topping ' is on its way!'\ndrinks {is} {ask} 'What would you like to drink with that?'\n{print} 'Thank you for your order.'\n{print} 'Your ' food ' and ' drinks ' will be right there!'\n```\n"
5:
story_text: "## Restaurant\nIn this level the {if} command allows you to {ask} your customers questions and give different responses to the answers.\nIn the example below, you see that you can {ask} the customer {if} they want to hear the specials and Hedy can respond accordingly.\n"
start_code: '# place your code here'
example_code: "```\n{print} 'Welcome to Hedys restaurant!'\nspecial {is} {ask} 'Would you like to hear our specials today?'\n{if} special {is} yes {print} 'Todays special is chicken piri piri and rice.' {else} {print} 'No problem.'\nfood {is} {ask} 'What would you like to eat?'\n{print} 'One ' food ', coming right up!'\ndrink {is} {ask} 'What would you like to drink with that?'\n{if} drink {is} cola {print} 'Im sorry, we are out of cola!' {else} {print} 'Great choice!'\nanything {is} {ask} 'Would you like anything {else}?'\n{print} 'Let me repeat your order...'\n{print} 'One ' food\n{if} drink {is} cola {print} 'and...' {else} {print} 'One ' drink\n{if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything\n{print} 'Thank you for your order and enjoy your meal!'\n```\n"
story_text_2: "## Challenge\nCan you think of more questions to {ask} the customers when they are ordering, and make up different responses to their answers by using the {if} command?\n"
6:
start_code: '# place your code here'
story_text: "## Restaurant\nIn this level you can use maths to calculate the total price of your customer's order, which can make your virtual restaurant more realistic.\n"
example_code: "\nYou can make a simple restaurant code, like this:\n```\n{print} 'Welcome to Hedys restaurant'\n{print} 'Here is our menu:'\n{print} 'Our main courses are pizza, lasagne, or spaghetti'\nmain = {ask} 'Which main course would you like?'\nprice = 0\n{if} main {is} pizza price = 10\n{if} main {is} lasagne price = 12\n{if} main {is} spaghetti price = 8\n{print} 'You have ordered ' main\n{print} 'That will be ' price ' dollars, please'\n{print} 'Thank you, enjoy your meal!'\n```\n"
example_code_2: "\nIn this example there are three courses, which requires more code and more additions in calculating the price.\n```\n{print} 'Welcome to Hedys restaurant'\n{print} 'Here is our menu:'\n{print} 'Our starters are salad, soup, or carpaccio'\n{print} 'Our main courses are pizza, lasagne, or spaghetti'\n{print} 'Our desserts are brownie, icecream, or milkshake'\nstarter = {ask} 'Which starter would you like to have?'\nmain = {ask} 'Which main course would you like?'\ndessert = {ask} 'Which dessert do you pick?'\nprice = 0\n{if} starter {is} soup price = price + 6 {else} price = price + 7\n{if} main {is} pizza price = price + 10\n{if} main {is} lasagne price = price + 12\n{if} main {is} spaghetti price = price + 8\n{if} dessert {is} brownie price = price + 7\n{if} dessert {is} icecream price = price + 5\n{if} dessert {is} milkshake price = price + 4\n{print} 'You have ordered ' starter ' , ' main ' and ' dessert\n{print} 'That will be ' price ' dollars, please'\n{print} 'Thank you, enjoy your meal!'\n```\n"
story_text_2: "But you can also add many more things to your virtual restaurant, for example more courses.\n\n## Challenge\nYou can add many more things to your virtual restaurant. For example, can you...\n- {ask} how many people are coming and multiply the price by that amount?\n- add another course?\n- give people a discount when they enter a (secret) couponcode?\n- add a children's menu?\n- think of other fun things to add?\n"
7:
start_code: '# place your code here'
story_text: "## Restaurant\nIn this level you've learned how to use the {repeat} command to repeat a line of code a certain amount of times.\nYou can use that in your restaurant to {ask} multiple people what they'd like to eat. Like this:\n"
example_code: "```\n{print} 'Welcome to Hedys restaurant!'\npeople = {ask} 'How many people are joining us today?'\n{repeat} people times food = {ask} 'What would you like to eat?'\n{print} 'Thanks for your order! Its coming right up!'\n```\n"
8:
story_text: "## Restaurant\nIn this level you can make your virtual restaurant more elaborate by repeating multiple lines of code. Like this:\n"
story_text_2: "## Challenge\nOf course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add as many options as you like!\n"
example_code: "```\n{print} 'Welcome to Hedys restaurant!'\npeople = {ask} 'How many people will be joining us today?'\n{print} 'Great!'\n{repeat} people {times}\n food = {ask} 'What would you like to order?'\n {print} food\n{print} 'Thank you for ordering!'\n{print} 'Enjoy your meal!'\n```\n"
start_code: '# place your code here'
11:
start_code: '# place your code here'
story_text: "## Restaurant\nWe can use the `{for} i {in} {range} 1 {to} 5` to {print} the orders from multiple customers in an orderly manner.\n"
example_code: "```\n{print} 'Welcome to Restaurant Hedy!'\npeople = {ask} 'For how many people would you like to order?'\n{for} i {in} {range} 1 {to} people\n {print} 'Order number ' i\n food = {ask} 'What would you like to eat?'\n {print} food\n {if} food {is} fries\n sauce = {ask} 'What kind of sauce would you like with that?'\n {print} sauce\n drinks = {ask} 'What would you like to drink?'\n {print} drinks\nprice = 4 * people\n{print} 'That will be ' price ' dollars, please!'\n```\n"
12:
start_code: '# place your code here'
story_text: "## Restaurant\nFrom this level on you can use decimal numbers to make you menu more realistic.\n"
example_code: "```\nprice = 0\nfood = {ask} 'What would you like to order?'\ndrink = {ask} 'What would you like to drink?'\n{if} food {is} 'hamburger'\n price = price + 6.50\n{if} food {is} 'pizza'\n price = price + 5.75\n{if} drink {is} 'water'\n price = price + 1.20\n{if} drink {is} 'soda'\n price = price + 2.35\n{print} 'That will be ' price ' dollar, please'\n```\n"
13:
start_code: '# place your code here'
story_text: "## Restaurant\nIn this level we can use the new commands to upgrade our restaurant.\nWe use `{and}` to see {if} two things are both the case.\n"
example_code: "```\nprice = 10\nfood = {ask} 'What would you like to eat?'\ndrinks = {ask} 'What would you like to drink?'\n{if} food {is} 'sandwich' {and} drinks {is} 'juice'\n {print} 'Thats our discount menu'\n price = price - 3\n{print} 'That will be ' price ' dollars'\n```\n"
story_text_2: "We use `{or}` to see {if} one our of two things is the case.\n"
example_code_2: "```\ndrinks = {ask} 'What would you like to drink?'\n{if} drinks {is} 'water' {or} drinks {is} 'juice'\n {print} 'Thats a healthy choice'\n```\n"
1:
story_text: "## Restaurant\n In level 1 you can make your own virtual restaurant and take your guests' orders.\n"
example_code: "```\n{print} Welcome to Hedy's restaurant \U0001F35F\n{ask} What would you like to order?\n{echo} So you would like to order\n{print} Thanks you for your order!\n{print} It's on its way!\n```\n"
story_text_2: "## Challenge\nCan you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal?\n"
start_code: '# place your code here'
2:
story_text: "## Restaurant\nIn level 2 you could expand your restaurant by using variables. In level 1 Hedy could only {echo} the order once and only remember the last thing that was ordered.\nNow you can use variables and Hedy can remember both the food and the drinks!\n"
example_code: "```\n{print} Welcome to Hedy's restaurant!\n{print} Today we're serving pizza or lasagna.\nfood {is} {ask} What would you like to eat?\n{print} Great choice! The food is my favorite!\ntopping {is} {ask} Would you like meat or veggies on that?\n{print} food with topping is on its way!\ndrinks {is} {ask} What would you like to drink with that?\n{print} Thank you for your order.\n{print} Your food and drinks will be right there!\n```\n"
start_code: '# place your code here'
story_text_2: "## Challenge\nCan you make this code more elaborate? For example by adding drinks to the order? Or...?\n"
example_code_2: "```\n{print} Welcome to Hedy's restaurant!\n{print} Today we're serving pizza or lasagna.\nfood {is} {ask} What would you like to eat?\n{print} Great choice! The food is my favorite!\ntopping {is} {ask} Would you like meat or veggies on that?\n{print} food with topping is on its way!\ndrinks {is} _\n```\n"
9:
story_text: "## Restaurant\nIn this level you can use nesting to make your restaurant more realistic and more fun!\nFor example you would {ask} for sauce {if} somebody orders fries, but you wouldn't {if} someone orders pizza!\nCheck out the example, and try this at your own virtual restaurant!\n"
example_code: "```\n{print} 'Welcome to Hedys restaurant!'\npeople = {ask} 'How many people will be joining us today?'\n{print} 'Great!'\nprice = 0\n{repeat} people {times}\n food = {ask} 'What would you like to order?'\n {print} food\n {if} food {is} fries\n price = price + 3\n sauce = {ask} 'What kind of sauce would you like with your fries?'\n {if} sauce {is} no\n {print} 'no sauce'\n {else}\n price = price + 1\n {print} 'with ' sauce\n {if} food {is} pizza\n price = price + 4\n{print} 'That will be ' price ' dollar'\n{print} 'Enjoy your meal!'\n```\n"
start_code: '# place your code here'
10:
story_text: "## Restaurant\nIn this level you'll learn how to easily {ask} your guests' orders in a short code.\n"
example_code: "```\ncourses = appetizer, main course, dessert\n{for} course {in} courses\n food = {ask} 'What would you like to eat as your ' course '?'\n {print} food ' will be your ' course\n```\n"
story_text_2: "\nOf course, you could also order for multiple people!\n"
example_code_2: "```\ncourses = appetizer, main course, dessert\nnames = Timon, Onno\n{for} name {in} names\n {for} course {in} courses\n food = {ask} name ', what would you like to eat as your ' course '?'\n {print} name ' orders ' food ' as their ' course\n```\n"
start_code: courses = appetizer, main course, dessert
15:
story_text: "## Restaurant\nWith the `{while}` you can make sure your costumers can keep adding orders until they are done.\n"
example_code: "```\n{print} 'Welcome at McHedy'\nmore = 'yes'\n{while} more == 'yes'\n order = {ask} 'What would you like to order?'\n {print} order\n more = {ask} 'Would you like to order anything {else}?'\n{print} 'Thank you!'\n```\n"
start_code: '# place your code here'
name: Restaurant
description: Create your own virtual restaurant
default_save_name: Restaurant
fortune:
levels:
3:
start_code: '# place your code here'
story_text: "## Fortune Teller\nIn the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}.\nIn this level you can use a variable and the `{at} {random}` command to really let Hedy choose an answer for you. Check out this code for instance:\n"
example_code: "\nIn this example the player can {ask} Hedy a yes-no question and Hedy will pick a random answer for you.\n```\n{print} I’m Hedy the fortune teller!\nquestion {is} {ask} What do you want to know?\n{print} This is what you want to know: question\nanswers {is} yes, no, maybe\n{print} My crystal ball says...\n{sleep} 2\n{print} answers {at} {random}\n```\n"
story_text_2: "## Challenges\nNow, Hedy can only answer yes, no or maybe. Can you give Hedy more answer options, like 'definitely' or '{ask} again'.\n"
5:
start_code: '# place your code here'
story_text_2: "## Hack the program\nReplace Hedy with your own name in the last line, and Hedy will always predict that you will win the lottery and others won't!\nOf course this might raise some suspicion with the other players... To avoid that, you can make sure that Hedy does give different answers every time you run the code.\nBut of course, still gives you a positive answer and the other players a negative one.\n"
story_text: "## Fortune Teller\nIn this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller!\nBy using `{if}` and `{else}` you can make sure that you will always get a good fotune, while other people might not.\nCheck out this example to find out how.\n"
example_code: "```\n{print} 'Im Hedy the fortune teller!'\n{print} 'I can predict {if} youll win the lottery tomorrow!'\nperson {is} {ask} 'Who are you?'\n{if} person {is} Hedy {print} 'You will definitely win!\U0001F929' {else} {print} 'Bad luck! Someone {else} will win!\U0001F62D'\n```\n"
example_code_2: "```\n{print} 'Im Hedy the fortune teller!'\n{print} 'I can predict {if} you will win the lottery tomorrow!'\nperson {is} {ask} 'Who are you?'\ngoodanswer {is} Hurray! You win!, You will definitely win!, We have a winner!\nbadanswer {is} Bad luck! Try again!, Another person will win, You lose!\n{if} person {is} Hedy {print} goodanswer {at} {random} {else} {print} badanswer {at} {random}\n```\n"
story_text_3: "## Challenges\nThis concept can be used to make may different programs, just be creative! For example you could create a machine that predicts that your favorite sports team will beat all the competitors!\nOr you could make Snow White's magic mirror on the wall, to tell everyone you are the fairest of them all!\nLet your imagination do the work!\n"
6:
start_code: '# place your code here'
story_text: "## Fortune Teller\nIn this level you can use math in your predictions as a fortune teller. This allows you to make up (silly) formulas to calculate the future.\nFor example you could calculate how rich you'll get or how many kids you will have when you grow up.\n"
example_code: "```\n{print} 'I am Hedy the fortune teller!'\n{print} 'I can predict how many kids youll get when you grow up!'\nage = {ask} 'How old are you?'\nsiblings = {ask} 'How many siblings do you have?'\nlength = {ask} 'How tall are you in centimetres?'\nkids = length / age\nkids = kids - siblings\n{print} 'You will get ...'\n{sleep}\n{print} kids ' kids!'\n```\n\n## Example Silly Fortune Teller\nIf the previous example wasn't silly enough for you, take a look at this one!\n\n```\n{print} 'Im Hedy the silly fortune teller!'\n{print} 'I will predict how smart you are!'\nfootball = {ask} 'On a scale 1-10 how much do you love football?'\nbananas = {ask} 'How many bananas did you eat this week?'\nhygiene = {ask} 'How many times did you wash your hands today?'\nresult = bananas + hygiene\nresult = result * football\n{print} 'You are ' result ' percent smart.'\n```\n"
8:
start_code: '# place your code here'
story_text: "## Fortune Teller\nIn the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions.\nNow that problem is solved, because of the new way of using the repeat command.\nIn the next example you can have your fortune teller {ask} 3 questions and also print them!\n"
example_code: "```\n{print} 'I am Hedy the fortune teller!'\n{print} 'You can {ask} me 3 questions.'\nanswers = yes, no, maybe\n{repeat} 3 {times}\n question = {ask} 'What do you want to know?'\n {print} question\n {sleep}\n {print} 'My crystal ball says...' answers {at} {random}\n```\n"
10:
example_code: "```\nhouses = mansion, apartment, shack, house\nloves = nobody, a royal, their neighbour, their true love\npets = dog, cat, elephant\nnames = Jenna, Ryan, Jim\n{for} name {in} names\n {print} name ' lives in a ' houses {at} {random}\n {print} name ' will marry ' loves {at} {random}\n {print} name ' will get a ' pets {at} {random} ' as their pet.'\n {sleep}\n```\n"
story_text_2: We can also make a Harry Potter themed fortune teller.
start_code: '# place your code here'
story_text: "## Fortune Teller\nIn this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like.\n"
example_code_2: "```\nhouses = Gryffindor, Slytherin, Hufflepuff, Ravenclaw\nsubjects = potions, defence against the dark arts, charms, transfiguration\nfears = Voldemort, spiders, failing your OWL test\nnames = Harry, Ron, Hermione\n{for} name in names\n {print} name ' is placed in ' houses {at} {random}\n {print} name ' is great at ' subjects {at} {random}\n {print} name 's greatest fear is ' fears {at} {random}\n```\n"
1:
story_text: "## Fortune Teller\nHave you ever been to a carnival and had your future predicted by a fortune teller? Or have you ever played with a magic eight ball?\nThen you probably know that they can't really predict your future, but it's still fun to play!\n\nIn the upcoming levels you can learn how to create your own fortune telling machine!\nIn level 1 you can start off easy by letting Hedy introduce herself as a fortune teller and let her {echo} the players' answers.\nLike this:\n"
example_code: "```\n{print} Hello, I'm Hedy the fortune teller!\n{ask} Who are you?\n{print} Let me take a look in my crystal ball\n{print} I see... I see...\n{echo} Your name is\n```\n"
story_text_2: "## Challenge\nHedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you?\nObviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players!\nTake a look in level 2 to improve your fortune teller.\n"
start_code: '# place your code here'
4:
story_text: "## Fortune Teller\nThis level has no new functions, but allows you to practice with using the quotation marks.\nYou can remake your level 3 code, and make sure to add the quotation marks in the right places!\n\nMind that in level 3, we couldn't use the word 'question' as both the name of the variable and a normal word that could be printed.\nThe quotation marks in level 3 make this possible!\n\nImportant! Mind that now that we're using quotation marks, Hedy will get confused when you use the apostrophe for contractions like I'm or What's.\nMake sure to remove those apostrophes and change the spelling to Im or Whats.\n"
example_code: "```\n{print} 'Im Hedy the fortune teller!'\nquestion {is} {ask} 'What do you want to know?'\n{print} 'This is your question: ' question\nanswers {is} yes, no, maybe\n{print} 'My crystal ball says...'\n{sleep} 2\n{print} answers {at} {random}\n```\n"
start_code: '# place your code here'
7:
story_text: "## Fortune Teller\nIn this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once.\n"
story_text_2: "## Challenge\nAs you can see, the questions aren't printed in this example. That's because the variable `question` was changed 3 times.\nEvery time the player fills in the new answer, Hedy overwrites the previous one, so the first answer the player gave is forgotten.\nThis means you can't print all the questions this way.\n\nBy using 3 different variables instead of 1 (for example `question_1` , `question_2` and `question_3`), you could solve the problem and print the questions.\nThis does mean that you can only use `{repeat}` for the answers, and you will have to ask and print all the questions separately.\nCan you do it?\n\nIn the upcoming levels the layout of {repeat} command will change, which enables you to repeat multiple lines at once.\n"
start_code: '# place your code here'
example_code: "```\n{print} 'Im Hedy the fortune teller!'\n{print} 'You can {ask} 3 questions!'\n{repeat} 3 {times} question = {ask} 'What do you want to know?'\nanswer = yes, no, maybe\n{repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random}\n```\n"
12:
story_text: "## Fortune Teller\nIn this level you can make your fortunes multiple words. Like in this example below:\n"
example_code: "```\nfortunes = 'you will be rich', 'you will fall in love', 'you will slip on a banana peel'\n{print} 'I will take a look in my crystall ball for your future.'\n{print} 'I see... I see...'\n{sleep}\n{print} fortunes {at} {random}\n```\n"
start_code: '# place your code here'
name: Fortune teller
description: Let Hedy predict the future
default_save_name: Fortune Teller
haunted:
levels:
2:
start_code: monster1 {is} _
story_text: "## Haunted House\nIn this haunted house you can choose your monsters with emojis. Of course you could also use words.\n"
example_code: "```\nmonster_1 {is} \U0001F47B\nmonster_2 {is} \U0001F921\nmonster_3 {is} \U0001F476\n{print} You enter the haunted house.\n{print} Suddenly you see a monster_1\n{print} You run into the other room, but a monster_2 is waiting there for you!\n{print} Oh no! Quickly get to the kitchen.\n{print} But as you enter monster_3 attacks you!\n```\n"
story_text_2: "## Challenge\nIn the example above the monsters are predetermined. So each time you run your code, the output is the same.\nCan you add `{ask}` commands to make the haunted house interactive and have the players choose the monsters they come across?\n"
example_code_2: "```\nmonster_1 {is} _\nmonster_2 {is} _\nmonster_3 {is} _\n{print} You enter the haunted house.\n{print} Suddenly you see a monster_1\n{print} You run into the other room, but a monster_2 is waiting there for you!\n{print} Oh no! Quickly get to the kitchen.\n{print} But as you enter monster_3 attacks you!\n```\n"
4:
start_code: '# place your code here'
story_text: "## Haunted house\nIn this level you learn how to use quotation marks in your games.\nCan you make your Haunted House level 4 proof?\n"
example_code: "```\n{print} _Escape from the haunted house!_\n{print} _There are 3 doors in front of you..._\nchoice {is} {ask} _Which door do you choose?_\n{print} _You picked door ..._ choice\nmonsters {is} a zombie, a vampire, NOTHING YOUVE ESCAPED\n{print} _You see..._\n{sleep}\n{print} monsters {at} {random}\n ```\n"
5:
start_code: '# place your code here'
story_text: "## Haunted House\nUp until this level the haunted house game always asked the player to choose a door, but as you might have noticed, they didn't really have to answer correctly.\nIf the player filled in a completely random answer, the game would still work and the player might even win (despite not picking a door).\nIn this level you can only win the game by picking the same door Hedy picked randomly.\n"
example_code: "```\n{print} 'Escape from the haunted house!'\n{print} 'There are 3 doors in front of you...'\ndoors {is} 1, 2, 3\nmonsters {is} werewolf, mummy, vampire, zombie\nchosen_door {is} {ask} 'Which door do you choose?'\n{print} 'You chose door...' chosen_door\n{sleep}\ncorrect_door {is} doors {at} {random}\n{if} chosen_door {is} correct_door {print} 'Great! Youve escaped!'\n{else} {print} 'Oh no! You are being eaten by a...' monsters {at} {random}\n```\n"
11:
start_code: "{print} 'Escape from the haunted house!'"
story_text: "## Haunted House\nIn this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are.\n"
example_code: "```\n{print} 'Escape from the Haunted House!'\nplayer {is} alive\ndoors = 1, 2, 3\nmonsters = zombie, vampire, giant spider\n{for} i {in} {range} 1 {to} 3\n {if} player {is} alive\n correct_door = doors {at} {random}\n {print} 'Room ' i\n {print} 'There are 3 doors in front of you...'\n chosendoor = {ask} 'Which door do you choose?'\n {if} chosendoor {is} correct_door\n {print} 'No monsters here!'\n {else}\n {print} 'You are eaten by a ' monsters {at} {random}\n player = dead\n {else}\n {print} 'GAME OVER'\n{if} player {is} alive\n {print} 'Great! You survived!'\n```\n"
1:
story_text: "## Haunted house\nIn this adventure you are working towards making a game in which you have to escape from a haunted house by picking the correct door.\nIf you pick the right door you'll survive, but if not a terrible monster might...\n\nIn level 1 we start our haunted house game by making up a scary story and ask the player what monster they'll see in the haunted house.\n"
example_code: "```\n{print} How did I get here?\n{print} I remember my friend telling me to go into the old mansion...\n{print} and suddenly everything went black.\n{print} But how did I end up on the floor...?\n{print} My head hurts like Ive been hit by a baseball bat!\n{print} What's that sound?\n{print} Oh no! I feel like Im not alone in this house!\n{print} I need to get out of here!\n{print} There are 3 doors in front of me..\n{ask} Which door should i pick?\n{echo} I choose door\n{print} ...?\n```\n"
story_text_2: "## Challenge\nCan you finish the scary story? Or make up your own haunted house story?\n"
start_code: '{print} How did I get here?'
3:
story_text: "## Haunted house game\nIn the previous levels you've made an introduction to your haunted house game, but as you might have noticed the story would always have a dreadful end.\nIn this level you can make your story more interactive by changing the outcome of the game; sometimes you'll get eaten, sometimes you'll escape!\nLet Hedy decide randomly!\n"
example_code: "```\n{print} Escape from the haunted house!\n{print} There are 3 doors in front of you...\nchoice {is} {ask} Which door do you choose?\n{print} You picked door ... choice\nmonsters {is} a zombie, a vampire, NOTHING YOUVE ESCAPED\n{print} You see...\n{sleep}\n{print} monsters {at} {random}\n```\n"
story_text_2: "## Challenge\nThis story is pretty straight {forward}, maybe you can spook it up a bit by adding a more exciting story.\nAlso you have very limited outcomes right now, there are only 3 options of what's behind the doors. Maybe you can think of more monsters to add to the list!\n\n## Change the game into a tv gameshow!\nLastly, we'd like to challenge you to change this game into a gameshow (like the ones on tv) where you choose a door or suitcase and it contains a big price!\nCan you do it?\n"
start_code: '# place your code here'
example_code_3: "```\n{print} The big gameshow!\n{print} There are 3 suitcases in front of you...\n{print} One of them contains _\n_\n```\n"
story_text_3: "## Change the game into a tv gameshow!\nLastly, we'd like to challenge you to change this game into a gameshow (like the ones on tv) where you choose a door or suitcase and it contains a big price!\nCan you do it?\n"
9:
story_text: "## Haunted House\nIn this level you can use nesting, which allows you to make the haunted house even more interactive!\n\n## Challenge\nNow it's very hard to win this game, can you make it easier to win?\nFor example by only having 1 wrong door and 2 correct doors instead of 1 correct door and 2 wrong ones?\n"
example_code: "```\n{print} 'Escape from the Haunted House!'\nplayer = alive\ndoors = 1, 2, 3\nmonsters = zombie, vampire, giant spider\n{repeat} 3 {times}\n {if} player {is} alive\n correct_door {is} doors {at} {random}\n {print} 'There are 3 doors in front of you...'\n chosen_door = {ask} 'Which door do you choose?'\n {if} chosen_door {is} correct_door\n {print} 'No monsters here!'\n {else}\n {print} 'You are eaten by a ' monsters {at} {random}\n player = dead\n {else}\n {print} 'GAME OVER'\n{if} player {is} alive\n {print} 'Great! You survived!'\n```\n"
start_code: "{print} 'Escape from the haunted house!'"
14:
story_text: "## Haunted House\nIn this level you can use the `<` and `>` symbol to introduce lives to your game.\n"
example_code: "```\n{print} 'Escape from the haunted house'\nlives = 3\ndoors = 1, 2, 3\nmonsters = 'the wicked witch', 'a zombie', 'a sleeping 3 headed dog'\n{for} i {in} {range} 1 {to} 10\n {if} lives > 0\n good_door = doors {at} {random}\n monster = monsters {at} {random}\n chosen_door = {ask} 'Which door do you choose?'\n {if} good_door == chosen_door\n {print} 'You have chosen the correct door'\n {else}\n {print} 'You see...' monster\n {if} monster == 'a sleeping 3 headed dog'\n {print} 'Pffieuw.... Its asleep'\n {else}\n {print} 'You lose one life'\n lives = lives -1\n {else}\n {print} 'GAME OVER'\n```\n"
start_code: '# place your code here'
16:
story_text: "## Haunted House Game\nThis haunted house game uses the connection between the lists you can use in this level.\nFor example: all the properties that belong to the zombie are first in all the lists, witch second and vampire third.\nCheck out the code!\n"
example_code: "```\nnumbers = [1, 2, 3]\ni = numbers[{random}]\nhint = ['growling', 'a cackling laugh', 'fluttering batwings']\nmonsters = ['zombie', 'witch', 'vampire']\nbad_fate = ['Your brain is eaten', 'You are forever cursed', 'You are bitten']\ngood_fate = ['You throw the ham. The zombie is distracted and starts etaing it.', 'You set the curtains on fire. The witch flees out of fear for the fire', 'The vampire hates garlic and flees']\nweapons = ['ham', 'lighter', 'garlic']\n{print} 'You are standing in front of an old mansion'\n{print} 'Something is not right here'\n{print} 'You hear ' hint[i]\n{print} 'You are going to explore it'\n{print} 'You enter the kitchen and see a lighter, a raw ham and a garlic.'\nyour_weapon = {ask} 'What do you bring with you?'\n{print} 'With your ' your_weapon ' you enter the living room'\n{print} 'There you find a ' monsters[i]\nneeded_weapon = weapons[i]\n{if} your_weapon == needed_weapon\n {print} 'You use your ' your_weapon\n {print} good_fate[i]\n {print} 'YOU WIN!'\n{else}\n {print} 'You have chosen the wrong weapon...'\n {print} bad_fate[i]\n {print} 'GAME OVER'\n```\n"
start_code: '# place your code here'
name: Haunted House
description: Escape from the haunted house
default_save_name: Haunted House
piggybank:
levels:
12:
start_code: '# place your code here'
story_text: "## Piggy Bank\nIn this adventure you learn how to make a digital piggy bank, to calculate how much money you have and how long you need to save up to buy what you want!\n"
example_code: "```\n{print} 'The digital piggy bank'\nwish = {ask} 'What would you like to buy?'\nprice = {ask} 'How much does that cost?'\nsaved = {ask} 'How much money have you saved already?'\nallowance = {ask} 'How much pocket money do you get per week?'\nto_save = price - saved\nweeks = to_save / allowance\n{print} 'You can buy a ' wish ' in ' weeks ' weeks.'\n```\n"
14:
start_code: '# place your code here'
story_text: "## Piggybank\nIn this level you can let Hedy tell you {if} you have saved up enough money!\n"
example_code: "```\nmoney = {ask} 'How much money have you saved?'\nwish = {ask} 'How much money do you need?'\nallowance = {ask} 'How much pocket money do you get each week?'\nto_save = wish - money\nweeks = to_save / allowance\n{if} wish > money\n {print} 'You need to save up some more!'\n {print} 'Youll need ' weeks ' more weeks.'\n{else}\n {print} 'Great! You have enough'\n {print} 'Lets go shopping!'\n```\n"
name: Piggy Bank
description: Count your pocketmoney!
default_save_name: Piggy Bank
quizmaster:
levels:
14:
story_text: "## Make your own quiz\nIn this adventure you can make your own quiz! Fill in the blanks, add more questions and enjoy your own quiz!\nYou can make a quiz about anything you like: your hobby, your favorite animal, your favorite book or anything at all!\n"
example_code: "```\n{print} 'Make your own quiz'\npoints_a = 0\npoints_b = 0\n{print} 'Question'\n{print} 'Answer option A'\n{print} 'Answer option B'\nanswer = {ask} 'Which answer?'\n{if} answer == 'A'\n points_a = points_a + 1\n{if} answer == 'B'\n points_b = points_b + 1\n{print} 'End of the quiz!'\n{print} 'Lets see the results!'\n{if} points_a > points_b\n {print} 'You belong to the A club'\n{if} points_b > points_a\n {print} 'You belong to the B club'\n```\n"
start_code: '# place your code here'
name: Quizmaster
description: Make your own quiz!
default_save_name: Quizmaster
language:
levels:
5:
story_text: "## Learn a new language\nMake your own program to practice your vocabulary in a new language.\n"
example_code: "```\n{print} 'Learn French!'\ncat {is} {ask} '\U0001F431'\n{if} cat {is} chat {print} 'Terrific!'\n{else} {print} 'No, cat is chat'\nfrog {is} {ask} '\U0001F438'\n{if} frog {is} grenouille {print} 'Super!'\n{else} {print} 'No, frog is grenouille'\n```\n"
start_code: '# place your code here'
16:
start_code: '# place your code here'
story_text: "## Learn a new language\nMake your own program to practice your vocabulary in a new language.\n"
example_code: "```\nfrench_words = ['bonjour', 'ordinateur', 'pomme de terre']\ntranslation = ['hello', 'computer', 'potato']\nscore = 0\n{for} i {in} {range} 1 {to} 3\n answer = {ask} 'What does ' french_words[i] ' mean?'\n correct = translation[i]\n {if} answer == correct\n {print} 'Correct!'\n score = score + 1\n {else}\n {print} 'Wrong, ' french_words[i] ' means ' translation[i]\n{print} 'You gave ' score ' correct answers.'\n```\n"
name: Language
description: Practice words in a foreign language
default_save_name: Language
secret:
name: SuperSpy
description: Make your own spy code
default_save_name: SuperSpy
levels:
13:
start_code: '## place your code here'
story_text: "## Superspy\nThe code you made in the previous level can be made a lot easier in this one with the `{and}` command.\n"
example_code: "```\nname is ask 'What is your name?'\npassword is ask 'What is your password?'\nif name is 'Agent007' and password is 'TOPSECRET'\n print 'Go to the airport at 02.00'\nelse\n print 'Go to the trainstation at 10.00'\n ```\n"
12:
story_text: "## Make a secret code like a super spy\nIn this adventure you can create your own super spy code. Encode a message that only the right agent can decipher.\nIf the enemy tries to crack the code, they will get some false info to waste their time.\n"
example_code: "```\nname is ask 'What is your name?'\nif name is 'Agent007'\n a is 'Go to the airport '\nelse\n a is 'Go to the trainstation '\npassword is ask 'What is the password?'\nif password is 'TOPSECRET'\n b is 'tomorrow at 02.00'\nelse\n b is 'today at 10.00'\nprint a + b\n```\n"
start_code: '## place your code here'
blackjack:
name: Blackjack
description: Try to get as close to 21 as you can
default_save_name: Blackjack
levels:
17:
example_code: "```\n{print} 'BLACKJACK'\ncards = [2, 3, 4, 5, 6, 7, 8, 9, 10, 'Jack', 'Queen','King', 'Ace']\npoints = 0\ndealer_points = 0\ncard_1 = cards[{random}]\ncard_2 = cards[{random}]\ncard_3 = cards [{random}]\ndealer_card_1 = cards[{random}]\ndealer_card_2 = cards[{random}]\ndealer_card_3 = cards[{random}]\n# Points for card 1\n{if} card_1 == 'Jack' {or} card_1 == 'Queen' {or} card_1 == 'King':\n points = points + 10\n{elif} card_1 == 'Ace':\n points = points + 11\n{else}:\n points = points + card_1\n# Points for card 2\n{if} card_2 == 'Jack' {or} card_2 == 'Queen' {or} card_2 == 'King':\n points = points + 10\n{elif} card_2 == 'Ace':\n points = points + 11\n{else}:\n points = points + card_2\n# Points for dealer card 1\n{if} dealer_card_1 == 'Jack' {or} dealer_card_1 == 'Queen' {or} dealer_card_1 == 'King':\n dealer_points = dealer_points + 10\n{elif} dealer_card_1 == 'Ace':\n dealer_points = dealer_points + 11\n{else}:\n dealer_points = dealer_points + dealer_card_1\n# Points for dealer card 2\n{if} dealer_card_2 == 'Jack' {or} dealer_card_2 == 'Queen' {or} dealer_card_2 == 'King':\n dealer_points = dealer_points + 10\n{elif} dealer_card_2 == 'Ace':\n dealer_points = dealer_points + 11\n{else}:\n dealer_points = dealer_points + dealer_card_2\n# Two Aces\n{if} card_1 == 'Ace' {and} card_2 == 'Ace':\n points = 12\n{if} dealer_card_1 == 'Ace' {and} dealer_card_2 == 'Ace':\n dealer_points = 12\n# Scoreboard\n{print} 'You have a ' card_1 ' and a ' card_2 ' (' points ' points)'\n{print} 'The dealer has a ' dealer_card_1 ' and a ' dealer_card_2 ' (' dealer_points ' points)'\n# Extra card for the player\nhit = {ask} 'Do you want an extra card?'\n{if} hit == 'yes':\n {if} card_3 == 'Jack' {or} card_3 == 'Queen' {or} card_3 == 'King':\n points = points + 10\n {elif} card_3 == 'Ace':\n {if} points > 11:\n points = points + 11\n {else}:\n points = points + 1\n {else}:\n points = points + card_3\n print 'You get an extra ' card_3 ' (' points ' points)'\n{else}:\n print 'No extra cards'\n# Winner\n{if} points > 21 {or} dealer_points > points {or} dealer_points == 21:\n {print} 'You lose'\n{elif} dealer_points < 17:\n {print} 'The dealer takes an extra card. It is a... ' dealer_card_3\n {if} dealer_card_3 == 'Jack' {or} dealer_card_3 == 'Queen' {or} dealer_card_3 == 'King':\n dealer_points = dealer_points + 10\n {elif} dealer_card_3 == 'Ace':\n {if} dealer_points < 11:\n dealer_points = dealer_points + 11\n {else}:\n dealer_points = dealer_points + 1\n {else}:\n dealer_points = dealer_points + dealer_card_3\n {print} 'The dealer has ' dealer_points ' points now'\n {if} dealer_points < 21 {and} dealer_points > points:\n {print} 'You lose'\n {else}:\n {print} 'You win'\n{elif} points > dealer_points {and} points < 21:\n {print} 'You win!'\n```\n"
start_code: '# place your code here'
story_text: "## Create a game of Blackjack\nBlackjack is a simple game of cards in which you have to get as close to 21 points as possible. You get two cards. Each card is worth their numeral value, and the face cards (Jack, Queen and King) are worth 10 points.\nThe Ace is worth either 1 or 11 points (you can choose). The dealer, your opponent, also gets two cards.\nIf you want, you can get another card, and its points will be added to your total. The dealer can also choose to take another card.\nBut be careful not to get more than 21 points, because if you do, you lose!\nThe player who gets closest to 21, without going over it, wins!\n\nHave fun!\n"
tic:
levels:
13:
start_code: '## place your code here'
story_text: "## Tic Tac Toe\nIn this adventure you can program a game of Tic Tac Toe. You can play with two people. Taking turns, you pick a number of the spot (1 - 9) you want to put your sign (x or o) on.\nThe first player that gets 3 in a row (horizontally, vertically or diagonally) wins!\n"
example_code: "```\nsign = 'x'\nopen_spots = 1, 2, 3, 4, 5, 6, 7, 8, 9\ngame = 'on'\nspot_1 = '.'\nspot_2 = '.'\nspot_3 = '.'\nspot_4 = '.'\nspot_5 = '.'\nspot_6 = '.'\nspot_7 = '.'\nspot_8 = '.'\nspot_9 = '.'\n{print} 'TIC TAC TOE!'\n{print} spot_1 spot_2 spot_3\n{print} spot_4 spot_5 spot_6\n{print} spot_7 spot_8 spot_9\n{print} ' '\n{for} i {in} {range} 1 {to} 9\n {if} game {is} 'on'\n choice = {ask} 'Player ' sign ', which spot?'\n {if} choice {in} open_spots\n {remove} choice {from} open_spots\n {if} choice {is} 1\n spot_1 = sign\n {if} choice {is} 2\n spot_2 = sign\n {if} choice {is} 3\n spot_3 = sign\n {if} choice {is} 4\n spot_4 = sign\n {if} choice {is} 5\n spot_5 = sign\n {if} choice {is} 6\n spot_6 = sign\n {if} choice {is} 7\n spot_7 = sign\n {if} choice {is} 8\n spot_8 = sign\n {if} choice {is} 9\n spot_9 = sign\n {else}\n {print} 'That spot was already taken'\n {print} spot_1 spot_2 spot_3\n {print} spot_4 spot_5 spot_6\n {print} spot_7 spot_8 spot_9\n {print} ' '\n winner = {ask} 'Did you win?'\n {if} winner {is} 'yes'\n {print} 'Good job, player ' sign '!'\n game = 'over'\n {else}\n {if} sign {is} 'x'\n sign = 'o'\n {else}\n sign = 'x'\n```\n"
14:
story_text: "## Tic Tac Toe\nIn the previous levels you've made a tic tac toe game. Now you've learned how to use the = sign, the == sign and the != sign.\nYou can use this knowledge in your new Tic Tac Toe game, like this:\n"
start_code: '## place your code here'
example_code: "```\nsign = 'x'\nopen_spots = 1, 2, 3, 4, 5, 6, 7, 8, 9\ngame = 'on'\nspot_1 = '.'\nspot_2 = '.'\nspot_3 = '.'\nspot_4 = '.'\nspot_5 = '.'\nspot_6 = '.'\nspot_7 = '.'\nspot_8 = '.'\nspot_9 = '.'\n{print} 'TIC TAC TOE!'\n{print} spot_1 spot_2 spot_3\n{print} spot_4 spot_5 spot_6\n{print} spot_7 spot_8 spot_9\n{print} ' '\n{for} i {in} {range} 1 {to} 9\n {if} game != 'over'\n choice = {ask} 'Player ' sign ', which spot?'\n {if} choice {in} open_spots\n {remove} choice {from} open_spots\n {if} choice == 1\n spot_1 = sign\n {if} choice == 2\n spot_2 = sign\n {if} choice == 3\n spot_3 = sign\n {if} choice == 4\n spot_4 = sign\n {if} choice == 5\n spot_5 = sign\n {if} choice == 6\n spot_6 = sign\n {if} choice == 7\n spot_7 = sign\n {if} choice == 8\n spot_8 = sign\n {if} choice == 9\n spot_9 = sign\n {else}\n {print} 'That spot was already taken'\n {print} spot_1 spot_2 spot_3\n {print} spot_4 spot_5 spot_6\n {print} spot_7 spot_8 spot_9\n {print} ' '\n winner = {ask} 'Did you win?'\n {if} winner == 'yes'\n {print} 'Good job, player ' sign '!'\n game = 'over'\n {else}\n {if} sign == 'x'\n sign = 'o'\n {else}\n sign = 'x'\n```\n"
15:
start_code: '## place your code here'
story_text: "## Tic Tac Toe\nIn this level you can improve your Tic Tac Toe game with the {while} loop. With this loop you can combine the `{if} game != 'over'` and the `{for} i {in} {range} 1 to 9` into one simple line.\nCheck it out:\n"
example_code: "```\nsign = 'x'\nopen_spots = 1, 2, 3, 4, 5, 6, 7, 8, 9\ngame = 'on'\nspot_1 = '.'\nspot_2 = '.'\nspot_3 = '.'\nspot_4 = '.'\nspot_5 = '.'\nspot_6 = '.'\nspot_7 = '.'\nspot_8 = '.'\nspot_9 = '.'\n{print} 'TIC TAC TOE!'\n{print} spot_1 spot_2 spot_3\n{print} spot_4 spot_5 spot_6\n{print} spot_7 spot_8 spot_9\n{print} ' '\n{while} game != 'over'\n choice = {ask} 'Player ' sign ', which spot?'\n {if} choice {in} open_spots\n {remove} choice {from} open_spots\n {if} choice == 1\n spot_1 = sign\n {if} choice == 2\n spot_2 = sign\n {if} choice == 3\n spot_3 = sign\n {if} choice == 4\n spot_4 = sign\n {if} choice == 5\n spot_5 = sign\n {if} choice == 6\n spot_6 = sign\n {if} choice == 7\n spot_7 = sign\n {if} choice == 8\n spot_8 = sign\n {if} choice == 9\n spot_9 = sign\n {else}\n {print} 'That spot was already taken'\n {print} spot_1 spot_2 spot_3\n {print} spot_4 spot_5 spot_6\n {print} spot_7 spot_8 spot_9\n {print} ' '\n winner = {ask} 'Did you win?'\n {if} winner == 'yes'\n {print} 'Good job, player ' sign '!'\n game = 'over'\n {else}\n {if} sign == 'x'\n sign = 'o'\n {else}\n sign = 'x'\n```\n"
17:
story_text: "## Tic Tac Toe\nIn the previous levels the tic tac toe game had an annoying feature. After every move, you had to fill in yourself if you had won or not.\nThis made the game playable, but also quite slow. In this level we have learned the `{elif}` command, that could solve that problem.\nTo use the {elif} to let Hedy check whether or not a player has won is fun, but it also requires a fair amount of extra lines.\n\nIn the example code you see that we added the requirements to win (3 spots in a row horizontally, vertically or diagonally).\nYou can find them in line 46 to 69. You can see that each time the requirement is met (so if a player has won) the variable game is set to 'over'.\nThis means that the {while} loop will be stopped and the game ends.\n"
example_code: "```\nsign = 'x'\nopen_spots = [1, 2, 3, 4, 5, 6, 7, 8, 9]\ngame = 'on'\nspot_1 = '.'\nspot_2 = '.'\nspot_3 = '.'\nspot_4 = '.'\nspot_5 = '.'\nspot_6 = '.'\nspot_7 = '.'\nspot_8 = '.'\nspot_9 = '.'\n{print} 'TIC TAC TOE!'\n{print} spot_1 spot_2 spot_3\n{print} spot_4 spot_5 spot_6\n{print} spot_7 spot_8 spot_9\n{print} ' '\n{while} game != 'over':\n choice = {ask} 'Player ' sign ', which spot?'\n {if} choice {in} open_spots:\n {remove} choice {from} open_spots\n {if} choice == 1:\n spot_1 = sign\n {if} choice == 2:\n spot_2 = sign\n {if} choice == 3:\n spot_3 = sign\n {if} choice == 4:\n spot_4 = sign\n {if} choice == 5:\n spot_5 = sign\n {if} choice == 6:\n spot_6 = sign\n {if} choice == 7:\n spot_7 = sign\n {if} choice == 8:\n spot_8 = sign\n {if} choice == 9:\n spot_9 = sign\n {else}:\n {print} 'That spot was already taken'\n {print} spot_1 spot_2 spot_3\n {print} spot_4 spot_5 spot_6\n {print} spot_7 spot_8 spot_9\n {print} ' '\n {if} spot_1 == spot_2 {and} spot_2 == spot_3 {and} spot_1 != '.':\n {print} 'Player ' sign ' wins!'\n game = 'over'\n {elif} spot_4 == spot_5 {and} spot_5 == spot_6 {and} spot_4 != '.':\n {print} 'Player ' sign ' wins!'\n game = 'over'\n {elif} spot_7 == spot_8 {and} spot_8 == spot_9 {and} spot_7 != '.':\n {print} 'Player ' sign ' wins!'\n game = 'over'\n {elif} spot_1 == spot_4 {and} spot_4 == spot_7 {and} spot_1 != '.':\n {print} 'Player ' sign ' wins!'\n game = 'over'\n {elif} spot_2 == spot_5 {and} spot_5 == spot_8 {and} spot_2 != '.':\n {print} 'Player ' sign ' wins!'\n game = 'over'\n {elif} spot_3 == spot_6 {and} spot_6 == spot_9 {and} spot_3 != '.':\n {print} 'Player ' sign ' wins!'\n game = 'over'\n {elif} spot_1 == spot_5 {and} spot_5 == spot_9 {and} spot_1 != '.':\n {print} 'Player ' sign ' wins!'\n game = 'over'\n {elif} spot_3 == spot_5 {and} spot_5 == spot_7 {and} spot_3 != '.':\n {print} 'Player ' sign ' wins!'\n game = 'over'\n {else}:\n {if} sign == 'x':\n sign = 'o'\n {else}:\n sign = 'x'\n```\n"
start_code: '## place your code here'
name: Tic Tac Toe
description: Play a game of Tic Tac Toe!
default_save_name: Tic
pressit:
levels:
5:
story_text: "## Press it!\nIn the introduction you were also told about the new keyword ```pressed```! Using ```pressed```\ncan make coding much more interactive, and you can have live control of what is executed!\nIn the upcoming levels you will learn how ```pressed``` makes this possible and what uses ```pressed```\nhas.\nBesides printing text, there is a whole other variety of uses for ```pressed```\nFor example, you can also link turtle commands to keys! Try it!\n"
example_code: "```\n{if} x {is} {pressed} {forward} 50\n```\n"
story_text_2: "## If Else Pressed\nYou can also assign an else statement to ```pressed```. The else statement will be executed\nwhenever you press a key other than the key you assigned.\n"
example_code_2: "```\n{if} y {is} {pressed} {print} 'Amazing! You pressed the y key!'\n{else} {print} 'Oh no! You did not press the y key.'\n```\n"
start_code: '# place your code here'
6:
story_text: "Did you know you can also make a calculator using ```pressed```?\nGive the calculator two numbers and press the m key to multiply.\nNow you don't have to bring your own!\nTry other keys and see what happens! Do you get a different result?\n"
example_code: "```\nfirst = {ask} 'what is your first number?'\nsecond = {ask} 'what is your second number?'\nprint 'press a to add, s to substract, d to divide, m to multiply'\n{if} a {is} {pressed} result = first + second\n{if} s {is} {pressed} result = first - second\n{if} d {is} {pressed} result = first / second\n{if} m {is} {pressed} result = first * second\n{print}'The answer is ' result\n```\n"
start_code: '# place your code here'
7:
story_text: "You might have tried it in level 5 and 6, pressing the key linked to ```pressed``` multiple\ntimes. If you did, you noticed that this did nothing. but now that you have learned about repeat, we\ncan press keys multiple times! Make the turtle walk forward!\n"
example_code: "```\n{repeat} 3 {times} {if} x {is} {pressed} forward 15\n```\n"
start_code: '# place your code here'
8:
story_text: "## Press It!\nNow that you need to use indents for the {if} and {else} statements,\nyou will also have to indent code when using {pressed}! Don't worry,\nit works te same as with the other statements, see the example!\nPress another key instead of x and see what happens.\n"
example_code: "```\n{if} x {is} {pressed}\n {print} 'Only the cool kids press the x key.'\n{else}\n {print} 'The adventurous kids press something else.'\n```\n"
start_code: '# place your code here'
9:
story_text: "Now that you know how to nest multiple statements, you can also do this with {pressed}!\nBy nesting a pressed in a {repeat} loop, you can repeatedly press buttons and make something happen.\nNow we know you could do this before, but by using the indents you have much more overview!\nTry it counting to 5, for example!\n"
example_code: "```\ntotal = 1\n{repeat} 5 times\n {if} x {is} {pressed}\n {print} total\n {print} 'keep pressing!'\n total = total + 1\n```\n"
story_text_2: "Besides counting, you can now also move the turtle in many more ways than only forward or backwards!\nTry making some figures by walking the turtle around!\n"
example_code_2: "```\nstepsize = 25\nleft = -90\nright = 90\naround = 180\nrepeat 40 times\n {if} w {is} {pressed}\n forward stepsize\n {if} s {is} {pressed}\n turn around\n {if} a {is} {pressed}\n turn left\n {if} d {is} {pressed}\n turn right\n```\n"
start_code: '# place your code here'
10:
story_text: "In this level you can make the turtle draw you a figure. The turtle is raring to go.\nGive the turtle the starting signal by pressing the x or y key on your keyboard.\nCan you let the turtle draw you another figure?\n"
start_code: '# place your code here'
example_code: "```\ndistances = 100, 80, 60, 40, 20, 10\n{if} x {is} {pressed}\n for distance in distances\n {forward} distance\n {turn} -90\n{if} y {is} {pressed}\n for distance in distances\n {forward} distance\n {turn} 90\n```\n"
11:
story_text: "Now that you have learned of the ```for ... in range ... to ...``` rule, you can use it for ```pressed```\ntoo! for example, try moving the turtle! The turtle grows everytime you press a linked button.\nThis way the turtle can move further every step!\n"
example_code: "```\nleft = -90\nright = 90\naround = 180\nfor counter in range 1 to 15\n stepsize = counter * 5\n {if} w {is} {pressed}\n forward stepsize\n {if} s {is} {pressed}\n turn around\n {if} a {is} {pressed}\n turn left\n {if} d {is} {pressed}\n turn right\n```\n"
start_code: '# place your code here'
12:
story_text: "Are you familiar with videogames? You walk into tall grass and are suddenly approached by\na very suspicious mouse. What will you do?\nIn this level we will make a small menu with different kinds of options.\nStoring text into a variable is quite handy for repeated uses.\nOption, I choose you!\n"
example_code: "```\nchoose = 'You chose option: '\nprint 'A wild mouse appeared!'\nprint 'Choose an option and press first letter: (n)et, (c)at, (b)ag, (r)un'\n{if} n {is} {pressed}\n {print} choose + 'net'\n {print} 'You attempt to catch the mouse with a net..'\n sleep\n {print} 'Congratulations you did it!'\n{if} c {is} {pressed}\n {print} choose + 'cat'\n {print} 'You send out your cat'\n sleep\n {print} 'The mouse got scared and ran away!'\n{if} b {is} {pressed}\n {print} choose + 'bag'\n {print} 'The mouse jumped into you bag!'\n{if} r {is} {pressed}\n {print} choose + 'run'\n {print} 'You got away safely!'\n```\n"
start_code: '# place your code here'
13:
story_text: "Now that you learned how to use ```and``` and ```or```, we can use it with ```pressed```too!\nimagine the turtle being able to do a superjump forward. by pressing ```p``` the turtle can make a\nsuperjump! However, the turtle can only do this jump if he turns left and right first!\n"
start_code: '# place your code here'
example_code: "```\nstepsize = 10\nleft = -90\nright = 90\naround = 180\nlooked_left = 0\nlooked_right = 0\nrepeat 40 times\n {if} w {is} {pressed}\n forward stepsize\n {if} s {is} {pressed}\n turn around\n {if} a {is} {pressed}\n turn left\n looked_left = 1\n {if} d {is} {pressed}\n turn right\n looked_right = 1\n {if} p {is} {pressed}\n {if} looked_left is 1 and looked_right is 1\n forward 40\n looked_left = 0\n looked_right = 0\n```\n"
14:
story_text: "Now that you learned how to use operators, we can use it with ```pressed```too!\nimagine the turtle being able to do a superjump forward. by pressing ```p``` the turtle can make a\nsuperjump! However, the turtle can only do this jump every 5 steps or every 4 turns\n"
start_code: '# place your code here'
example_code: "```\nstepsize = 15\nleft = -90\nright = 90\naround = 180\njumptime = 5\nspins = 4\nrepeat 40 times\n {if} w {is} {pressed}\n forward stepsize\n jumptime = jumptime - 1\n {if} s {is} {pressed}\n turn around\n {if} a {is} {pressed}\n turn left\n spins = spins - 1\n {if} d {is} {pressed}\n turn right\n spins = spins - 1\n {if} p {is} {pressed}\n {if} jumptime <= 0 or spins <= 0\n forward stepsize * 3\n jumptime = 5\n spins = 4\n```\n"
15:
story_text: "Now that you have learned about the ```while``` loops, you can start using it on the turtle!\nThe turtle is now only allowed to take only 15 steps or turn 15 times, before he gets tired!\nTry to get as far as possible before the turtle gets tired! You can use your superjump after 2 turns\nor 5 steps.\n"
example_code: "```\nstepsize = 15\nleft = -90\nright = 90\naround = 180\njumptime = 5\nspins = 2\ntired_in = 15\nwhile tired_in > 0\n {if} w {is} {pressed}\n forward stepsize\n jumptime = jumptime - 1\n {if} s {is} {pressed}\n turn around\n {if} a {is} {pressed}\n turn left\n spins = spins - 1\n {if} d {is} {pressed}\n turn right\n spins = spins - 1\n {if} p {is} {pressed}\n {if} jumptime <= 0 or spins <= 0\n forward stepsize * 4\n jumptime = 5\n spins = 2\n tired_in = tired_in - 1\n```\n"
start_code: '# place your code here'
16:
example_code: "```\nlimbs = ['Right Hand', 'Left Hand', 'Right Foot', 'Left Foot']\ncolours = ['Blue', 'Green', 'Red', 'Yellow']\nrepeat 20 times\n l = limbs[random]\n c = colours[random]\n {if} x {is} {pressed}\n {print} l + ' on ' + c + '!'\n```\n"
story_text: "Lets move a little with a game of Twister!\nWhen everyone is ready, press the x key for the next move!\n"
start_code: '# place your code here'
17:
story_text: "Now that you learned how to use ```elif```, we can use it with ```pressed```too! Be aware,\n```elif ... is pressed ``` is not possible! That is why we are going to nest some ```elif```\nstatements into the ```pressed``` options. We also had to add ```:``` to the code to make\neverything work! imagine the turtle being able to do a superjump forward. by pressing ```p``` the\nturtle can make a superjump! However, the turtle can only do this jump every 5 steps or every\n4 turns\n"
start_code: '# place your code here'
example_code: "```\nstepsize = 15\nleft = -90\nright = 90\naround = 180\njumptime = 5\nspins = 4\nrepeat 40 times\n {if} w {is} {pressed}:\n forward stepsize\n jumptime = jumptime - 1\n {if} s {is} {pressed}:\n turn around\n {if} a {is} {pressed}:\n turn left\n spins = spins - 1\n {if} d {is} {pressed}:\n turn right\n spins = spins - 1\n {if} p {is} {pressed}:\n {if} jumptime <= 0 or spins <= 0:\n forward stepsize * 3\n jumptime = 5\n spins = 4\n {elif} jumptime > 0:\n print \"you need to take more steps or turns before you can superjump!\"\n```\n"
name: Press it!
description: Try linking a keyboard key to a command!
default_save_name: Pressit
years:
name: New Year's
description: Countdown to the new year!
default_save_name: New Year's Countdown
levels:
11:
story_text: "## Songs\nIn this level you can use the `{for} i {in} {range}` command to countdown to the New Year.\n\n## Challenge\nFill in the blanks and make the code work!\n"
example_code: "## Countdown\n```\nfor _ in _ 10 to 1\n {print} i\n{print} 'Happy New Year!'\n```\n"
start_code: '# place your code here'