forked from hedyorg/hedy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fa.yaml
925 lines (924 loc) · 134 KB
/
fa.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
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
adventures:
default:
name: "مقدمه"
description: "سطح توضیح"
default_save_name: "مقدمه"
levels:
5:
start_code: "name {is} {ask} 'what is your name?'\n{if} name {is} Hedy {print} 'cool!' {else} {print} 'meh'"
story_text: "In 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"
6:
start_code: "{print} '5 times 5 is ' 5 * 5"
story_text: " 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"
8:
start_code: "{repeat} 5 {times}\n {print} 'Hello folks'\n {print} 'This will be printed 5 times'"
story_text: "`{ask}` {and} `{print}` still work as you know them. But `{if}` {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"
example_code: "```\n{repeat} 5 {times}\n {print} 'Hello everyone'\n {print} 'This is all repeated 5 times'\n```\n"
12:
start_code: "{print} 'decimal numbers now need to use a dot'\n{print} 2.5 + 2.5"
story_text: "**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.\n"
example_code: "```\n{print} 'Two and a half plus two and a half is...'\n{print} 2.5 + 2.5\n```\n"
16:
start_code: "fruit = ['apple', 'banana', 'cherry']\n{print} fruit"
story_text: "We 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.\n"
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"
18:
start_code: "naam = 'Hedy'\n{print}('My name is ', naam)"
story_text: "We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on.\nThat looks like this:\n```\n{print}('my name is Hedy!')\n```\nIf you want to print more thant one items, you need to separate them by commas.\n```\nnaam = 'Hedy'\n{print}('my name is ', naam)\n```"
1:
story_text: "در مرحلهی اول میتونی از دستورهای `{print}`، `{ask}` و `{echo}` استفاده کنی.\nکدت رو توی بخش «برنامهنویسی» وارد کن. یا دکمهی سبز توی بخش «نمونه کد» رو فشار بده که کد اتوماتیک برات تایپ بشه!\nخودت، کدت رو با فشردن دکمه «اجرای کد»، زیر بخش «برنامهنویسی» اجرا کن.\n\nمیتونی با دستور `{print}` یک متن رو روی صفحه چاپ کنی.\n"
start_code: '{print} دنیا سلام!'
2:
story_text: "در مرحله دوم ما دو تا دستور جدید یاد میگیریم: `{is}` و `{sleep}`.\nتو میتونی با دستور `{is}` به یک کلمه، یک اسم اختصاص بدی. به این میگن «متغیر». توی این مثال ما دو متغیر به نامهای name و age میسازیم. تو میتونی از این کلمات در هر جای کد استفاده کنی. مثل:\n\nاینطوری تو دیگه به دستور `{echo}`نیاز نداری!\n"
example_code: |-
```
اسمم {is} Hedy
سن {is} 15
{print} اسمم is سن years old
```
story_text_2: "دستور `{print}` همچنان مثل قبل کار میکنه، اما دستور `{ask}` تغییر کرده. تو نیاز داری توی دستور `{ask}` از یک متغیر استفاده کنی. مثل این:\n"
start_code: '{print} سلام دنیا!'
3:
story_text: "در سطح 3 شما میتوانید یک لیست بسازید. . می توانید اجازه بدهید که کامپیوتر برای شما یک لیست بسازد شما این کا را با`{at} {random}`انجام می دهید.\n"
start_code: '{print}سلام دنیا!'
4:
start_code: "{print} 'سلام دنیا'"
story_text: "In 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: "```\nprint 'You need to use quotation marks from now on!'\nanswer is ask 'What do we need to use from now on?'\nprint 'We need to use ' answer\n```\n"
7:
start_code: "{repeat} 3 {times} {print} 'Hedy is fun!'"
story_text: "Level 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"
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: "In 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"
10:
start_code: "animals {is} dog, cat, blobfish\n{for} animal {in} animals\n {print} 'I love ' animal"
story_text: "In 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.\n"
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: "`{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)\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: "We 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.\n"
example_code: "```\nname = ask 'what is your name?'\nage = ask 'what is your age?'\nif name is 'Hedy' and age is 2\n print 'You are the real Hedy!'\n```\n"
14:
start_code: "age = {ask} 'How old are you?'\n{if} age < 13\n {print} 'You are younger than me!'\nelse\n {print} 'You are older than me!'"
story_text: "We 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"
example_code: "```\nage = {ask} 'How old are you?'\n{if} age > 12\n {print} 'You are older than I am!'\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: "We 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!\n"
example_code: "```\nanswer = 0\nwhile answer != 25\n answer = ask 'What is 5 times 5?'\nprint 'A correct answer has been given'\n```\n"
17:
start_code: "{for} i {in} {range} 1 {to} 10:\n {print} i\n{print} 'Ready or not, here I come!'"
story_text: "Now 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 you want to make 3 (or more!) options.\nCheck it out!"
story:
levels:
2:
story_text: "In 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: "\n```\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```\n"
start_code: '{print} Your story'
story_text_2: "### Exercise\nNow it's time to add variables to your own story that you've made in the previous level.\nGo to 'My programs', look for your level 1 story adventure and copy the code. Paste the code in your input screen in this level.\n\nThis code won't work in this level, because you have not used variables yet.\nChange the `{ask}` commands and `{echo}` commands in your code to the correct form that you've learned in this level.\n\n**Extra** Add a sleep command to your code to build up tension in your story.\n"
12:
start_code: '# place your code here'
story_text: "In this level you can use the quotation marks to save multiple words in a variable.\n"
example_code: "\n```\nname = 'The Queen of England'\n{print} name ' was eating a piece of cake, when suddenly...'\n```\n"
7:
story_text: "In 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!'"
13:
start_code: '# place your code here'
story_text: "By 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:
example_code: "\n```\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"
story_text: "In 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 in your story will be.\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"
start_code: '{print} Your story starts here'
story_text_2: "### Exercise\nCan you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`?\n"
8:
story_text: "In 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} '💥ZAP!💥'\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!🦖'\n```\n"
start_code: '# place your code here'
10:
story_text: "In 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'
9:
story_text: "In 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"
start_code: '# place your code here'
4:
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} 🦔, 🐿, 🦉, 🦇\n{print} 'He hears the sound of an' animals {at} {random}\n{print} name 'is afraid this is a haunted forest'\n```\n"
story_text: "You 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"
start_code: "{print} 'Your story will be printed here!'"
5:
story_text: "In 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"
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!'"
3:
story_text: "In 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} 🦔, 🐿, 🦉, 🦇\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} 🐿, 🦔, 🦇, 🦉\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"
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'
15:
story_text: "Using 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'
18:
example_code: "```\n{print}('Welcome to this story!')\n```\n"
story_text: "We are going to print another story, but now we have to use brackets with `{print}`.\n\n### Exercise 1\nCreate a story of at least 5 sentences. You don't have to use 'name' just yet.\n"
story_text_2: "### Exercise 2\nWe have already prepared an `{input}` for you. First, use the `name` variable in your story.\nThen add a second `{ask}` and use that variable as well.\nTip: Remember the commas in a `{print}` between text and variables!\n"
example_code_2: "```\nnaam = {input}(\"What's your name?\")\n{print}('Welcome to this story!')\n```\n"
start_code: '# Schrijf jouw code hier'
name: Story
description: Story
default_save_name: Story
parrot:
name: Parrot
description: Create your own online pet parrot that will copy you!
default_save_name: Parrot
levels:
1:
story_text: "Create 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: "### Exercise\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:
start_code: '{print} Im Hedy the parrot!'
story_text: "Create 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"
story_text_2: "### Exercise\nYou can use variables to make the parrot say more than only your name. Can you complete this code?\n"
3:
story_text: "Teach 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} 🧒 Say new_word , Hedy!\n{print} 🦜 words {at} {random}\n```\n"
start_code: '# place your code here'
5:
story_text: "Reward 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} '🧒 Say ' new_word ', Hedy!'\n{print} '🦜 ' said_word\n{if} said_word {is} new_word {print} '🧒 Great job, Hedy! 🍪'\n{else} {print} '🧒 No, Hedy! Say ' new_word\n```\n"
start_code: '# place your code here'
4:
story_text: "In 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} _ 🧒 Say _ new_word _, Hedy!_\n{print} _ 🦜 _ words {at} {random}\n```\n"
start_code: '# Write your code here'
songs:
levels:
12:
start_code: '# place your code here'
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"
story_text: "In 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"
11:
start_code: '# place your code here'
story_text: "In this level you can use the `{for} i {in} {range}` command to make songs that use counting.\n"
example_code: "```\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"
10:
start_code: '# place your code here'
story_text: "In 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: "```\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```\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```\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"
example_code_2: "```\nmonkeys = 5, 4, 3, 2, 1\n```\n"
story_text_2: "### Exercise 2\nPrint the song Five little moneys jumping on the bed. Look up the text if you don't remember.\n\n**(extra)** Print the song Old MacDonald had a farm, and make sure all animals make a different sound, using an `{if}`.\n"
8:
start_code: '# place your code here'
story_text: "In 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"
7:
start_code: "{print} 'Baby Shark'"
story_text: "Songs 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"
6:
story_text: "Songs 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"
start_code: "{print} 'Baby shark'"
story_text_2: "This 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"
16:
story_text: "In 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"
example_code: "```\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```\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"
start_code: '# place your code here'
18:
story_text: "In level 16 we made songs using lists. These programs however are no longer working properly in this level. The colons from level 17 and the brackets from level 18 still need to be added.\n\n### Exercise 1\nThe Drunken sailor song is given as sample code, but not yet working.\nCan you make sure everything works again? To help you, we've put _ in the places of _some_ errors.\n\n### Exercise 2\nNow also look up your Old MacDonald song from level 16, and correct it.\n"
example_code: "```\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"
start_code: '# Schrijf jouw code hier'
name: Sing a song!
description: Print a song
default_save_name: Song
turtle:
levels:
1:
story_text: "You 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.\n\nThis is the start of a little staircase. Can you make it have 5 steps?\n"
example_code: "```\n{turn} {right}\n{forward} 50\n{turn} {left}\n{forward} 50\n```\n"
start_code: "{forward} 50\n{turn} {left}"
2:
story_text: "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: "\n```\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\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"
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"
6:
story_text: "In 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"
start_code: "{print} 'Drawing figures'\n"
3:
story_text: "In 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"
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\n"
4:
story_text: "In 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\n"
story_text_2: "You 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:
story_text: "In level 5 you can make a choice with `{if}`. For example between different types of figures.\n"
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\n"
story_text_2: "### Exercise\nFill in the correct numbers in this code to get it to work.\nAfter you've done that, you can try to add the option backwards.\n\n**Extra** Instead of using 'left' and 'right', remake the program with North, East, South and West.\nThis way you could add even more directions like Northeast and Southwest etc.\n"
example_code_2: "```\ndirection {is} {ask} 'Do you want to go left, right, or straight ahead?'\nif direction is left turn _\nif direction is right turn _\nforward 100\n```\n"
8:
story_text: "Now 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"
example_code: "```\nangle = 90\n{repeat} 10 {times}\n {turn} angle\n {forward} 50\n```\n"
story_text_2: "Also, 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"
start_code: "hoeken = {ask} 'How many angles should I draw?'\n"
9:
start_code: '# place your code here'
story_text: "Now that we can use a `{repeat}` inside a `{repeat}`, we can create more complex figures.\n\n### Exercise 1\nThis code creates three black triangles, change that into five pink squares.\n\n **(extra)** Create a figure of your own choosing consisting of at least two different shapes types.\n"
example_code: "```\n{color} {black}\n{repeat} 3 {times}\n {repeat} 3 {times}\n {forward} 10\n {turn} 120\n {color} {white}\n {forward} 50\n {color} {black}\n```\n"
name: Turtle
description: Make your own drawing
default_save_name: turtle
dishes:
name: Dishes?
description: Use the computer to see who does the dishes (Start at level 2)
levels:
7:
start_code: "{print} 'Who does the dishes?'"
story_text: "With 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"
10:
story_text: "In 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"
start_code: '# place your code here'
6:
story_text: "How 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: "If 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"
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?'"
5:
story_text: "With 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"
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?'"
4:
story_text: "With 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"
example_code: "```\npeople {is} mom, dad, Emma, Sophie\n{print} _ the dishes are done by _\n{sleep}\n{print} people {at} _\n```\n"
start_code: "{print} 'Who does the dishes?'"
3:
story_text: "Do 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"
example_code: "```\npeople {is} mom, dad, Emma, Sophie\n{print} people {at} {random}\n```\n"
story_text_2: "Don't feel like doing the dishes yourself? Hack the program to remove your name from the list.\n"
start_code: '{print} Who does the dishes?'
default_save_name: Dishes
dice:
levels:
10:
start_code: '# place your code here'
story_text: "Is 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"
7:
start_code: "{print} 'What will the die indicate this time?'"
story_text: "You 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"
6:
story_text: "You 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"
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: "\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?'"
5:
story_text: "You 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"
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"
start_code: "{print} 'What will the die indicate this time?'"
4:
story_text: "In 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"
start_code: "{print} 'What will the die indicate this time?'"
3:
story_text: "In 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: "### Exercise\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:
story_text: "In this game you have to throw 6 in as little tries as possible.\n"
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"
start_code: '# place your code here'
name: Dice
description: Make your own dice
default_save_name: Dice
calculator:
levels:
14:
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"
start_code: '# place your code here'
story_text: "In this level you can programm the game 'Guess which number'\n"
12:
story_text: "Now 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'
10:
start_code: '# place your code here'
story_text: "This 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"
9:
story_text: "In 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"
start_code: "{print} 'Welcome to this calculator!'"
6:
story_text: "Now 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: "You 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: "You 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"
15:
story_text: "You 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'
11:
start_code: '# place your code here'
story_text: "With a `{for}` you can simplify tables of multiplication practise program.\n\n### Exercise 1\nImprove the example code such that it prints a nice multiplication table: <br> \"1 times 10 is 10\", \"2 times 10 is 20\", etc.\n\n### Exercise 2\nGo back to your level 10 multiplication code, and modify it so that it uses a `{for}` and `{range}`.\n"
example_code: "```\nnumber = 10\n{for} i {in} {range} 1 to 10\n {print} i * number\n```\n"
13:
example_code: "```\nanswer1 = {ask} 'What is 10 times 7?'\nanswer2 = {ask} 'What is 6 times 7?'\n{if} _ _ _ _ _ _ _\n {print} _\n```\n"
story_text: "\n### Exercise 1\nLet's make the practice program a bit harder. The player now has to answers two questions correctly. Fill out the blanks to complete the program.\n\n### Exercise 2 (extra)\nSometimes, calculations have multiple correct answers. For example, 10 can be divided by 5 and by 2. So the question 'What number divides 10?' can be answered by 2 and by 5.\nAsk for a calculation that has multiple correct answers, ask the player to answer it, and determine if it is correct using `{or}`.\nEmpty the programming field and create your own solution.\n"
start_code: '# Schrijf jouw code hier'
name: Calculator
description: Create a calculator
default_save_name: Calculator
restaurant:
levels:
1:
start_code: '# place your code here'
story_text: " 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 🍟\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: "### Exercise\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"
2:
story_text: "In 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"
start_code: '# place your code here'
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"
story_text_2: "### Exercise\nCan you make this code more elaborate? For example by adding drinks to the order? Or...?\n"
12:
story_text: "From this level on you can use decimal numbers to make you menu more realistic.\n"
start_code: '# place your code here'
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"
11:
start_code: '# place your code here'
story_text: "We 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"
10:
story_text_2: "Of 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
story_text: "In 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"
9:
start_code: '# place your code here'
story_text: "In 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"
8:
story_text: "In this level you can make your virtual restaurant more elaborate by repeating multiple lines of code. Like this:\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"
story_text_2: "### Exercise\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"
start_code: '# place your code here'
5:
start_code: '# place your code here'
story_text: "In 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"
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"
4:
start_code: '# place your code here'
story_text: "In 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: "```\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"
13:
start_code: '# place your code here'
story_text: "In 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"
7:
story_text: "In 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"
start_code: '# place your code here'
6:
story_text: "In 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: "You 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"
start_code: '# place your code here'
3:
story_text: "Having 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: "Does 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"
start_code: '# place your code here'
15:
story_text: "With 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:
name: Fortune teller
levels:
1:
start_code: '# place your code here'
story_text: "Have 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: "### Exercise\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"
12:
story_text: "In 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'
7:
story_text: "In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once.\n"
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"
start_code: '# place your code here'
6:
story_text: "In 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\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"
start_code: '# place your code here'
5:
start_code: '# place your code here'
story_text: "In 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!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭'\n```\n"
10:
story_text: "In 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: "```\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"
start_code: '# place your code here'
8:
story_text: "In 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"
start_code: '# place your code here'
4:
story_text: "This 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'
3:
story_text: "In 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: "In 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: "### Exercises\nNow, Hedy can only answer yes, no or maybe. Can you give Hedy more answer options, like 'definitely' or '{ask} again'.\n"
start_code: '# place your code here'
description: Let Hedy predict the future
default_save_name: Fortune Teller
haunted:
name: Haunted House
levels:
1:
example_code: "\n```\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"
start_code: '{print} How did I get here?'
story_text_2: "### Exercise\nCan you finish the scary story? Or make up your own haunted house story?\n"
story_text: "In 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"
14:
story_text: "In this level you can use the `<` and `>` symbol to introduce lives to your game.\n"
start_code: '# place your code here'
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"
9:
start_code: "{print} 'Escape from the haunted house!'"
story_text: "In this level you can use nesting, which allows you to make the haunted house even more interactive!\n\n### Exercise\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 en 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"
2:
story_text: "In this haunted house you can choose your monsters with emojis. Of course you could also use words.\n"
example_code: "```\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"
start_code: monster1 {is} _
story_text_2: "### Exercise\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"
11:
story_text: "In 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"
start_code: "{print} 'Escape from the haunted house!'"
5:
story_text: "Up 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"
start_code: '# place your code here'
4:
story_text: "In 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"
start_code: '# place your code here'
3:
story_text: "In 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"
start_code: '# place your code here'
example_code: "```\n_ Escape from the haunted house!\n_ There are 3 doors in front of you...\n_ _ _ Which door do you choose?\n_ You picked door ... choice\nmonsters _ a zombie, a vampire, NOTHING YOUVE ESCAPED\n_ You see...\n{sleep}\n_ _ _ _\n```\n"
16:
story_text: "This 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 eating 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 mension'\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 en 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'
description: escape from the haunted house
default_save_name: Haunted House
quizmaster:
levels:
14:
story_text: "In 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
rock:
name: Rock, paper, scissors
description: Make your own rock, paper, scissors game
default_save_name: Rock
levels:
1:
story_text: "In 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```\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"
start_code: '{print} Welcome to your own rock scissors paper!'
story_text_2: "### Exercise\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"
10:
story_text: "Feeling 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'
9:
story_text: "In 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```\n"
start_code: '# place your code here'
5:
story_text: "In 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"
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!'"
4:
story_text: "In 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"
start_code: "{print} 'Welcome to your own rock scissors paper!'"
3:
story_text: "\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: "\n```\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: "### Exercise\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"
2:
story_text: "In 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'
15:
story_text: "Play 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"
start_code: '# place your code here'
13:
story_text: "With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it.\n"
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'
piggybank:
name: Piggy Bank
description: Count your pocketmoney!
default_save_name: Piggy Bank
levels:
12:
start_code: '# place your code here'
story_text: "In 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:
story_text: "In 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"
start_code: '# place your code here'
language:
name: Language
description: Practice words in a foreign language
default_save_name: language
levels:
5:
story_text: "Make your own program to practice your vocabulary in a new language.\n"
example_code: "```\n{print} 'Learn French!'\ncat {is} {ask} '🐱'\n{if} cat {is} chat {print} 'Terrific!'\n{else} {print} 'No, cat is chat'\nfrog {is} {ask} '🐸'\n{if} frog {is} grenouille {print} 'Super!'\n{else} {print} 'No, frog is grenouille'\n```\n"
start_code: '# place your code here'
16:
story_text: "Make 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"
start_code: '# place your code here'
secret:
name: SuperSpy
description: Make your own spy code
default_save_name: language
levels:
12:
story_text: "In 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'
13:
story_text: "The 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"
start_code: '# place your code here'
tic:
levels:
13:
start_code: '# place your code here'
story_text: "In 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!\nHave fun!\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: "In 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 Taic 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: "In 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:
start_code: '# place your code here'
story_text: "In 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"
name: Tic Tac Toe
description: Play a game of Tic Tac Toe!
default_save_name: Tic
blackjack:
description: Try to get as close to 21 as you can
default_save_name: Blackjack
levels:
17:
start_code: '# place your code here'
story_text: "Blackjack 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"
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"
name: Blackjack
years:
name: New Year's
levels:
11:
example_code: "```\nfor _ in _ 10 to 1\n {print} i\n{print} 'Happy New Year!'\n```\n"
story_text: "In this level you can use the `{for} i {in} {range}` command to countdown to the New Year.\n\n### Exercise\nFill in the blanks and make the code work!\n"
start_code: '# place your code here'
description: Countdown to the new year!
default_save_name: New Year's Countdown
pressit:
levels:
7:
story_text: "Now that you have learned about `{repeat}`, we can press keys multiple times.\nYou can use it to make the turtle walk forward and turn.\n\n### Exercise\nThe code you have seen in level 5 only checks the key once. Copy the example code and add a `{repeat}` to it, so that you can press the keys many times.\nUse this code to draw something nice.\n"
example_code: "```\n{if} x {is} {pressed} {forward} 15 {else} {turn} 90\n```\n"
start_code: '# place your code here'
5:
example_code: "```\n{print} 'Do you want a good (g) or bad (b) ending?'\n{if} g {is} {pressed} {print} 'They lived happily ever after ❤'\n{else} {print} 'The prince was eaten by a hippopotamus 😭'\n```\n"
start_code: '# place your code here'
story_text_2: "You can also link turtle commands to keys.\n\n### Exercise\nCopy the lines a few times so you can create a larger drawing.\n"
story_text: "In this level there is another new keyword: `{pressed}`!\nWith `{pressed}` you can use keys on your keyboard to control what lines are used.\n\n### Exercise\nLook at the example and add one more line of code that reacts to a key press.\n"
example_code_2: "```\n{if} y {is} {pressed} {forward} 15\n{else} {turn} 90\n```\n"
9:
start_code: '# place your code here'
story_text: "Now that you know how to combine statements, you can create a touch type tool with `{pressed}`.\n\n### Exercise\nFinish the code. Each time a random letter should be chosen, which you have to press. You get a point for a correct press, and and two points deduction for a wrong press.\n**(extra)** Clear the screen after each letter, and show the user how many points they have scored.\n"
example_code: "```\npoints = 0\nletters = a, b, c, d, e\n{repeat} 10 {times}\n letter = _ _ _\n {print} 'Press the letter ' letter\n {if} letter {is} {pressed}\n _\n _\n _\n```\n"
name: Key presses
description: Try linking a keyboard key to a command!
default_save_name: Pressed
print_command:
name: print
description: Introduction print command
default_save_name: print
levels:
1:
story_text: "## The print command\nYou can print text to the screen using the `{print}` command.\n"
story_text_2: "### Exercise\nIn Hedy you will find exercises in every adventure. An exercise allows you to practise the new commands and concepts, and lets you give your own twist to the example codes.\nIn this exercise you will see a pink blank space. You have to fill something in the place of the blank space before the code can be ran.\n\nFill in the `{print}` command in the blank space and then add five more lines of code. Each line has to start with a `{print}` command.\nHave fun!\n"
example_code: "```\n{print} Hi there, programmer!\n{print} Welcome to Hedy!\n```\n"
example_code_2: "```\n_ Hello!\n```\n"
start_code: "{print} Welcome to Hedy!\n"
17:
start_code: "{for} i {in} {range} 1 {to} 10:\n {print} i\n{print} 'Ready or not, here I come!'"
story_text: "Now 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"
example_code: "```\n{for} i {in} {range} 1 {to} 10:\n {print} i\n{print} 'Ready or not, here I come!'\n```\n"
18:
start_code: "name = 'Hedy'\n{print}('My name is ', name)"
story_text: "We arrived at real Python code! That means we need to use parentheses with `{print}` and `{range}` from now on.\nIt also means you can use Hedy code from this level in any Python environment as long as you use the English commands. If you haven't until now, you can switch the toggle in the commands menu to do so."
example_code: "```\n{print}('Hello!')\n{for} i {in} {range}(1, 10):\n {print}('This is line ', i)\n```\n"
story_text_2: If you want to print more than one item, you need to separate them by commas.
example_code_2: "```\ntemperature = 25\n{print}('It is ', temperature, ' degrees outside')\n```\n"
story_text_3: The final change we will need to make to get Python code is changing `{ask}` into `{input}`.
example_code_3: "```\n{print}('My name is Hedy!')\nname = {input}('What is your name?')\n{print}('So your name is ', name)\n```\n"
sleep_command:
name: sleep
description: introducing sleep command
default_save_name: sleep_command
levels:
2:
story_text: "## The sleep command\nAnother 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: "```\n{print} My favorite colour is...\n{sleep} 2\n{print} green!\n```\n"
start_code: "{print} My favorite colour is...\n{sleep} 2\n{print} green!"
in_command:
name: in
description: Introducing the in command
default_save_name: in_command
levels:
5:
story_text: "## 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: "```\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: "### Exercise\nFinish the example code by filling in the blanks with commands that you've learned.\nWhen you've finished the code, try to create a code of your own and use a question that you've thought of yourself.\n"
start_code: "pretty_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'"
example_code_2: "```\nanimals is dog, cow, sheep\nanswer is ask 'What is your favorite animal?'\n_ answer _ animals _ 'Mine too!'\n_ _ 'My favorite animals are dogs, cows and sheep'\n```\n"
quotation_marks:
levels:
4:
start_code: "{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"
story_text: "## 'Quotation marks'\nIn level 4 `{ask}` and `{print}` have changed.\nYou must put text that you want to print between quotation marks.\nThis is useful, because now you can print all the words you want. Also the words you used to store something with `{is}`.\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"
example_code_2: "```\n_ This is the wrong way of using apostrophes _\n{print} 'I'm babysitting my sister's kids'\n{print} 'What's more fun than that?'\n```\n"
story_text_2: "## Contractions\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 I am or What is.\nCheck out the example code to see the wrong way of using apostrophes.\n"
12:
story_text: "**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: "```\nname = 'Hedy the Robot'\n{print} 'Hello ' name\n```\n"
example_code_2: "```\nsuperheroes = 'Spiderman', 'Batman', 'Iron Man'\n{print} superheroes {at} {random}\n```\n"
story_text_2: "**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"
story_text_3: "**All text after `{if}` comparisons need quotation marks too**\n"
example_code_3: "```\nname = {ask} 'What is your name?'\n{if} name = 'Hedy the Robot'\n {print} 'Hi there!'\n```\n"
story_text_4: "**Numbers don't need quotation marks**\nFor numbers, you do not use quotation marks in the `=`:\n"
example_code_4: "```\nscore = 25\n{print} 'You got ' score\n```\n"
start_code: "name = {ask} 'What is your name?'\n{if} name = 'Hedy the Robot'\n {print} 'Hi there!'"
name: "'quotation marks'"
description: Introduction quotation marks
default_save_name: quotation_marks
repeat_command:
name: Repeat
description: repeat command
default_save_name: repeat_command
levels:
7:
story_text: "## Repeat! Repeat! Repeat!\nLevel 7 adds the `{repeat}` command. `{repeat}` can be used to execute one line of code multiple times. Like this:\n\n### Exercise\nPlay around with the repeat command. Can you make the happy birthday song in only 3 lines of code instead of 4 now?\n"
example_code: "```\n{repeat} 3 {times} {print} 'Hedy is fun!'\n```\n"
start_code: "{print} 'happy birthday to you'\n{print} 'happy birthday to you'\n{print} 'happy birthday dear Hedy'\n{print} 'happy birthday to you'\n"
8:
start_code: "{repeat} 5 {times}\n {print} 'Hello everyone'\n {print} 'This will be printed 5 times'"
story_text: "### Repeat commands and indentation\nIn this level you can repeat multiple lines of code with only 1 repeat command.\nYou do this by making a block of lines that you want to repeat.\nThe lines in this block will need **indentation** .\nThat means putting four spaces at the beginning of each line. You will also have to indent when you just want to create a block of one line.\n"
example_code: "```\n{repeat} 5 {times}\n {print} 'Hello everyone'\n {print} 'This is all repeated 5 times'\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: "In 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"
repeat_command_2:
name: Repeat 2
levels:
7:
example_code: "```\n{repeat} 2 {times} answer = {ask} 'Did you know you could ask a question multiple times?'\n{if} answer {is} yes {repeat} 2 {times} {print} 'You knew that already!'\n{else} {repeat} 3 {times} {print} 'You have learned something new!'\n```\n"
story_text: "## Repeat with other commands and with variables\nYou have practiced the `{repeat}` command in combination with the `{print}` command now, but did you know you could also use other commands with `{repeat}` ?\nIn this example code you can see that `{repeat}` can also be used with an `{ask}`, `{if}` or `{else}` command.\n"
story_text_2: "Another interesting thing you can so with the `{repeat}` command is using variables to set the amount of times something should be repeated. In the example code you can see that we first ask the person how old they are.\nThen, in line 3, the question is repeated 'age' times. So we have used the variable 'age' with the `{repeat}` command.\n"
example_code_2: "```\n{print} 'Yay! It is your birthday!'\nage = {ask} 'How old are you now?'\n{repeat} age {times} {print} 'Hip Hip Hurray!'\n```\n"
start_code: "{repeat} 2 {times} answer = {ask} 'Did you know you could ask a question multiple times?'\n{if} answer {is} yes {repeat} 2 {times} {print} 'You knew that already!'\n{else} {repeat} 3 {times} {print} 'You have learned something new!'"
8:
story_text: "### In the block or not?\nIn this level you have to think carefully which lines of code should be in the block and which shouldn't.\nFor example: If you want to sing the song *the muffin man*. You only want the line with 'the muffin man' to be repeated twice.\nThis means the last line shouldn't start with indentation as it doesn't belong to the block.\nIf you do start the last line with indentation the song will turn out wrong.\n\n## Exercise\nEach line in the example code starts with a blank. Remove the blanks and try to figure out which line need indentation and which don't to make the muffin man song.\n"
example_code: "```\n_ {print} 'Do you know the muffin man?'\n_ {repeat} 2 {times}\n_ {print} 'The muffin man'\n_ {print} 'Do you know the muffin man, who lives on Drury Lane?'\n```\n"
start_code: "{repeat} 3 {times}\n {print} 'This line will be repeated...'\n {print} 'This one too...'\n{print} 'but this one will not!'"
description: repeat command 2
default_save_name: repeat_command_2
for_command:
name: for
description: for command
default_save_name: for
levels:
10:
start_code: "animals {is} dog, cat, blobfish\n{for} animal {in} animals\n {print} 'I love ' animal"
story_text: "## For\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 4 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: "In this level, we add a new form of the `{for}`. In earlier levels, we used `{for}` with a list, but we can also use `{for}` with numbers.\nWe do that by adding a variable name, followed by `{in}` `{range}`. We then write the number to start at, `{to}` and the number to end at.\n\nTry the example to see what happens! In this level again, you will need to use indentations in lines below the `{for}` statements."
example_code: "```\n{for} counter {in} {range} 1 {to} 5\n {print} counter\n```\n"
elif_command:
levels:
17:
story_text: "In 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!\n"
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"
start_code: "prices = ['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..'"
name: elif
description: elif
default_save_name: elif
rock_2:
name: Rock, paper, scissors 2
description: Part 2 of rock, paper, scissors
default_save_name: rock_2
levels:
2:
story_text: "Now that you have learned how to use the `{ask} command, you can make your rock, paper, scissors code interavtive too!\n\n### Exercise\nMake the rock, paper, scissors code interactive by adding the `{ask}` command and a question to your rock, paper, scissors code.\n"
example_code: "```\nchoice is _\n{print} I choose choice\n```\n"
start_code: "# place your code here"
harry_potter:
name: Harry Potter
description: Harry Potter adventures
default_save_name: Harry Potter
levels:
10:
start_code: '# place your code here'
story_text: "### Exercise\nWe can also make a Harry Potter themed fortune teller. Fill in blanks such that 9 lines are printed.\n**Extra** Change the theme of the fortune teller into something else, such as your favorite book, film or tv show.\n"
example_code: "```\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_\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"
ask_command:
name: ask
description: Introduction ask command
default_save_name: ask_command
levels:
1:
story_text: "## The ask command\nNow that you can use the `{print}` command, you are ready to learn the next command: `{ask}`. With the `{ask}` command, you can ask a question. Check it out:\n"
example_code: "```\n{print} Hello!\n{ask} What is your name?\n```\n"
story_text_2: "## The echo command\nIf you want the computer to repeat the answer back to you, you can use the `{echo}` command. Mind that the answer is echoed back at the end of the sentence, so it this example after hello.\n"
story_text_3: "### Exercise\nTry out the `{ask}` and `{echo}` commands. Firstly, fill in the blanks to make this program work.\nThen ask 2 more questions using the `{ask}` command, after each `{ask}` use an `{echo}` to print the answer on the screen.\n"
example_code_2: "```\n{print} Hello!\n{ask} What is your name?\n{echo} hello\n```\n"
example_code_3: "```\n_ How are you doing?\n_\n```\n"
start_code: "{print} Hello!\n{ask} What is your name?\n{echo} hello\n"
2:
story_text: "## The ask command\nNow that we can use **variables** in our codes, we no longer need the `{echo}` command.\nWe can use variables to store the answers to our questions and this way we can use the answer to multiple questions in our codes.\nCheck it out:\n\nThis way your code is becoming interactive!\n"
example_code: "```\nname {is} {ask} What is your name?\n{print} Hello name\nage {is} {ask} How old are you?\n{print} name is age years old.\n```\n"
story_text_2: "### Exercise\nIn the previous tab you have practised with setting variables with the `{is}` command.\nYou have created at least 3 variables and used them with a print command.\nNow, instead of setting the variables we want you to make the variables interactive, like we did in our example.\n\nCopy your code from the previous tab and make the variables interactive by using `{ask}` commands.\n"
example_code_2: "```\nfavorite_animals is ask What is your favorite animal?\nprint I like favorite_animals\n```\n"
start_code: "name {is} {ask} What is your name?\n{print} Hello name\nage {is} {ask} How old are you?\n{print} name is age years old."
is_command:
name: is
description: introducing is command
default_save_name: is_command
levels:
2:
story_text: "## Variables\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"
example_code: "```\nname {is} Hedy\nage {is} 15\n{print} name is age years old\n```\n"
example_code_2: "```\nfavorite_animals is _\n{print} I like favorite_animals\n```\n"
start_code: "name {is} Hedy\nage {is} 15\n{print} name is age years old"
story_text_2: "### Exercise\nTime to make your own variables!\nIn the example code we made an example of the variable `favorite_animals`. In line 1 the variable is set, and in line 2 we haved used the variable in a print command.\nFirstly, finish our example by filling in your favorite animal in the blanks. Then make at least 3 of these codes yourself. Pick a variable, and set the variable with the {is} command. Then use it with a {print} command, just like we did.\n"
14:
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: "We 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"
example_code: "```\nage = {ask} 'How old are you?'\n{if} age > 12\n {print} 'You are older than I am!'\n```\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"
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"
example_code_2: "```\nname = {ask} 'What is your name?'\n{if} name == 'Hedy'\n {print} 'You are cool!'\n```\n"
random_command:
name: random
description: introducing at random command
default_save_name: random_command
levels:
3:
story_text: "## At random\nIn this level you can make a list using the `{is}` command. You can let the computer choose a random item from that list. You do that with `{at} {random}`.\n"
example_code: "```\nanimals {is} dogs, cats, kangaroos\n{print} animals {at} {random}\n```\n"
story_text_2: "You can use the `{at} {random}` command in a sentence as well.\n"
example_code_2: "```\nfood {is} sandwich, slice of pizza, salad, burrito\n{print} I am going to have a food {at} {random} for lunch.\n```\n"
start_code: "animals {is} dog, cat, kangaroo\n{print} animals {at} {random}\n"
story_text_3: "### Exercise\nTry out the `{at} {random}` command by making your own gameshow (like the ones on tv) where you choose a door or suitcase and it contains a big price!\nCan you do it? We have already put the first lines into the example code.\n"
example_code_3: "```\n{print} The big gameshow!\n{print} There are 3 suitcases in front of you...\nchosen {is} {ask} Which suitcase do you choose?\nprices {is} _\n_\n```\n"
16:
start_code: "fruit = ['apple', 'banana', 'cherry']\n{print} fruit[random]"
story_text: "We 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.\nWe use square brackets to point out a place in a list. The {at} {random} command can not be used anymore."
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"
add_remove_command:
name: add and remove
description: introducing add to and remove from
default_save_name: add_remove_command
levels:
3:
story_text: "## Add to\nYou can add items to the list with the `{add} {to}` command. To add an item to a list you can simply type: `{add} penguin {to} animals` or you can use the `{ask}` command like in the example code.\n"
example_code_2: "```\nanimals {is} dog, cat, kangaroo\ndislike {is} {ask} What animal do you not like?\n{remove} dislike {from} animals\n{print} I choose animals {at} {random}\n```\n"
story_text_3: "### Exercise\nTry out the new commands in this virtual restaurant. Add the flavor the player is hpoing for to the list and remove the flavors they are allergic to.\n"
example_code_3: "```\n{print} Mystery milkshake\nflavors {is} strawberry, chocolate, vanilla\nhope {is} {ask} What flavor are you hoping for?\n_\nallergies {is} {ask} Are you allergic to any flavors?\n_\n{print} You get a flavors {at} {random} milkshake\n```\n"
start_code: "animals {is} dog, cat, kangaroo\nlike {is} {ask} What is your favorite animal?\n{add} like {to_list} animals\ndislike {is} {ask} What animal do you not like?\n{remove} dislike {from} animals\n{print} I choose animals {at} {random}"
example_code: "```\nanimals {is} dog, cat, kangaroo\nlike {is} {ask} What is your favorite animal?\n{add} like {to_list} animals\n{print} I choose animals {at} {random}\n```\n"
story_text_2: "## Remove from\nIf you can add items to a list, of course you can also take them off. This is done with the `{remove} {from}` command.\n"
if_command:
levels:
5:
story_text_3: "### Exercise\nTry to create your own code with `{if}` and `{else}`. You can use the example code if you want.\n"
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_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"
example_code_3: "```\nanswer {is} {ask} '2 + 2 = ?'\n_ _ _ 4 _ 'Great job!'\n_ _ 'No 2 + 2 = 4'\n```\n"
start_code: "name {is} {ask} 'what is your name?'\n{if} name {is} Hedy {print} 'nice'\n{else} {print} 'boo!'"
8:
start_code: "name {is} {ask} 'What is your name?'\n{if} name {is} Hedy\n {print} 'Welcome Hedy'\n {print} 'You can play on your computer!'\n"
example_code: "```\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```\n"
story_text: "## If... Else...\nYou have learned to repeat a block of lines of code after a `{repeat}` command.\nNow you can also use indentation to make blocks after a {if} or {else} command.\nCheck out the example code.\n\n### Exercise\nAdd an {else} command to the example code. Make a block of line using indentation. You do this by starting each line with 4 spaces.\n"
name: if else
description: Introducing the if command
default_save_name: if_command
maths:
name: maths
description: Introducing maths
default_save_name: maths
levels:
6:
start_code: "{print} '5 times 5 is ' 5 * 5"
story_text: "## 1 + 1\nIn this level you learn something new: you can now also calculate.\n\nThe plus is easy, you write it like with math: `5 + 5` for example. The minus also works fine, it is `5 - 5`.\n\nThe times is a bit different, because there is no times symbol on your keyboard. Just search, there really isn't!\nThat 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"
12:
start_code: "{print} 'decimal numbers now need to use a dot'\n{print} 2.5 + 2.5"
story_text: "**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"
and_or_command:
name: and or
description: introducing and or
default_save_name: and or
levels:
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: "We 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}`.\n\nIf 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"
while_command:
name: while
description: while
default_save_name: while_command
levels:
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: "We 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"