-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathcodemonster-lessons.js
3040 lines (3025 loc) · 252 KB
/
codemonster-lessons.js
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
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2012 Geeky Ventures
// Each lesson has a tutor message, the code given at the start of the
// lesson, some hiddenCode that is not shown but defines some
// convenience functions and globals, a lessonSection that is
// displayed to give a sense of where you are and progress, which
// tutorImage to display, and a check that (when it exists) will
// display a little congratulatory "You got it!" the first time that
// regex appears in the student's code.
// code, if missing, will not change the code in the box.
// hiddenCode, lessonSection, and tutorImage all will, if missing, use
// the hiddenCode from the last lesson where it was defined.
// youGotItCheck, if missing, will just not display the congrats message.
// Of these, the message is always there and the code often there. Others
// are usually missing for most lessons.
var lessons =
[
{
message: {
en: "I'm Code Monster! (click on my words to see what's next)",
de: "Ich bin das Code Monster! (Klick auf meine Wörter was danach kommt)",
jp: "コードモンスターだ! ここの文章をクリックして次に進んでね!"
},
code: "c.fillRect(20, 20, 50, 75);\n",
lessonSection: {
en: "Getting Started",
de: "Los geht's!",
jp: "さあ、はじめよう!"
},
tutorImage: 1,
hiddenCode: "var c = document.getElementById('pane').getContext('2d');\nfunction rgba(r,g,b,a) {return 'rgba('+[r,g,b,a].join(',')+')';}\nfunction rgb(r,g,b,a) {return 'rgb('+[r,g,b].join(',')+')';}\n\n"
},
{
message: {
en: "You're going to learn some programming! (click again)",
de: "Du wirst etwas programmieren lernen! (Klicke wieder hier)",
jp: "これからプログラミングについて学ぼう! (もういちどクリックしてね)"
}
},
{
message: {
en: "Below me, on the left, is Javascript code, on the right, what it does.",
de: "Unter mir, auf der linken Seite, ist Javascript Code. Auf der rechten Seite ist das, was der Code macht.",
jp: "下を見て。左がわには<ruby>Javascript<rp>(</rp><rt>ジャバスクリプト</rt><rp>)</rp></ruby>のコード、右がわにはそのコードが何をやっているかがかいてあるよ。"
}
},
{
message: {
en: "You can use<span class=tutor-code>fillRect()</span>to draw a box. See the number 50? Can you change that to 150?",
de: "Du kannst mit<span class=tutor-code>fillRect()</span>ein Rechteck zeichnen. Siehst Du die Nummer 50? Kannst Du die in 150 ändern?",
jp: "<span class=tutor-code>fillRect()</span>を使って四角形をかけるよ。50という数字が見えるかな? それを半角数字で150にかえてみよう! <br><br><i class=jp>★プログラミングのおやくそく★<br>数字やアルファベットはかならず<strong>半角</strong>で入力してね!</i>"
},
code: "c.fillRect(20, 20, 50, 75);\n"
},
{
message: {
en: "That made the box wider. What do you think the other numbers do? Try changing them.",
de: "Das hat das Rechteck weiter gemacht. Was glaubst du machen die anderen Zahlen? Versuche sie zu ändern.",
jp: "四角形が大きくなったね。他の数字にするとどうなると思う? いろいろかえてみよう!",
},
lessonSection: {
en: "Parameters and Drawing",
de: "Parameter und Zeichnen",
jp: "パラメータと描画"
}
},
{
message: {
en: "Did you figure it out? The numbers are how far from the left side to draw the box, how far from the top, how wide to draw the box, and how tall.",
de: "Hast du verstanden was sie machen? Die Zahlen sagen wie weit von links das Rechteck zu zeichnen ist, wie weit von oben, wie weit das Rechteck ist und wie hoch es gezeichnet werden soll.",
jp: "分かったかな? これらの数字は、左はし、または上からどのくらいはなれた場所に四角形をかくか、四角形のはば、高さはどのくらいにするかを表しているんだ。"
}
},
{
message: {
en: "Try changing all the numbers! Play with it!",
de: "Ändere alle Zahlen! Spiel mit ihnen!",
jp: "全ての数字をかえてみよう! いろいろかえて遊んでみよう!"
}
},
{
message: {
en: "Two boxes. Can you change the numbers to make them bigger?",
de: "Zwei Rechtecke. Kannst du sie grösser machen?",
jp: "2つの四角形があるね。数字をかえてこれらを大きくしてみよう!"
},
code: "c.fillRect(20, 20, 50, 75);\nc.fillRect(100, 100, 60, 80);\n"
},
{
message: {
en: "Can you change the numbers to move them around?",
de: "Kannst du die Zahlen ändern um sie herumzubewegen?",
jp: "数字をかえて四角形を動かしてみよう。"
}
},
{
message: {
en: "Can you change the numbers so that one covers the other?",
de: "Kannst du die Zahlen ändern damit eins mit dem anderen überlappt?",
jp: "かた方をかくすように数字をかえてみよう。"
}
},
{
message: {
en: "Monster like boxes square.",
de: "Monster mögen Quadrate.",
jp: "モンスターは<ruby>正方形<rp>(</rp><rt>せいほうけい</rt><rp>)</rp></ruby>がすき。"
},
code: "c.fillRect(20, 20, 80, 80);\n"
},
{
message: {
en: "A square has the same width and height. This box has the same width and height, both are 80.",
de: "Ein Quadrat hat die gleiche Weite und Höhe. Dieses Rechteck hat die gleiche Weite und Höhe: 80.",
jp: "正方形はたてと横が同じ長さの四角形だよ。これはたてと横が両方とも80で同じ長さだよ。"
},
code: "c.fillRect(20, 20, 80, 80);\n"
},
{
message: {
en: "Hey, look, this does the same thing!",
de: "Guck mal! Das hier macht das gleiche!",
jp: "ねえ、見て! これは同じことをしているよ!"
},
code: "var size = 80;\nc.fillRect(20, 20, size, size);\n",
lessonSection: {
en: "Variables",
de: "Variable",
jp: "変数を見てみよう"
}
},
{
message: {
en: "Why does that do the same thing? Any ideas?",
de: "Warum macht das das gleiche? Hast du eine Idee?",
jp: "どうして同じことができると思う? わかるかな?"
}
},
{
message: {
en: "var means variable. What we did is create a variable, called it<span class=tutor-code>size</span>, set it equal to 80, and now we can use<span class=tutor-code>size</span>where we would have used 80. Do you know why we might want that?",
de: "var bedeutet Variable. Was wir gemacht haben ist das wir eine Variable<span class=tutor-code>size</span>erzeugen, und lassen sie 80 sein, und jetzt können wir<span class=tutor-code>size</span>benutzen wo wir früher 80 hatten. Hast du vielleicht eine Idee warum wir das machen?",
jp: "「var」は<ruby>変数<rp>(</rp><rt>へんすう</rt><rp>)</rp></ruby>という意味だよ。<br>ここでは、「<span class=tutor-code>size</span>」(サイズ・大きさ)とよぶ<ruby>変数<rp>(</rp><rt>へんすう</rt><rp>)</rp></ruby>を作って、それを80にしているんだ。<br>そうすると80にした<span class=tutor-code>size</span>が使えるようになるんだ。<br>なんでそんなことがひつようだと思う?"
},
code: "var size = 80;\nc.fillRect(20, 20, size, size);\n"
},
{
message: {
en: "What happens if you change 80 to 220?",
de: "Was passiert wenn du die Zahl 80 in 220 änderst?",
jp: "もし80を220にかえたらどうなると思う?"
}
},
{
message: {
en: "And look! Wider and taller box, both at the same time!",
de: "Schau! Das Quadrat ist jetzt weiter und höher! Gleichzeitig!",
jp: "見て! 四角形のたてと横の長さを同時にかえられるんだ!"
}
},
{
message: {
en: "Can you change the other numbers to move the box around?",
de: "Kannst du die anderen Zahlen ändern um das Quadrat herumzubewegen?",
jp: "他の数字もかえて四角形を動かしてみよう。"
}
},
{
message: {
en: "Can you make the box very small?",
de: "Kannst Du das Quadrat ganz klein machen?",
jp: "四角形をものすごく小さくしてみよう。"
}
},
{
message: {
en: "What happens if you make<span class=tutor-code>size</span>equal to 0? Or to something really big like 5000?",
de: "Was passiert wenn du<span class=tutor-code>size</span>zu 0 machst? Oder riesig, wie zum Beispiel 5000?",
jp: "<span class=tutor-code>size</span>を0にしたらどうなるかな? また、5000のようなものすごく大きい数字にしたらどうなるかな?"
}
},
{
message: {
en: "Monster want two boxes.",
de: "Monster mag 2 Quadrate.",
jp: "モンスターは四角形が2つ欲しいな。"
},
code: "var size = 80;\nc.fillRect(20, 20, size, size);\nc.fillRect(90, 90, size, size);\n"
},
{
message: {
en: "Both boxes have the same size. That's a neat trick.",
de: "Beide sind gleichgross. Das ist schlau.",
jp: "四角形は両方とも同じ大きさにしてね。ちょっと考えれば、かんたんだね!"
}
},
{
message: {
en: "You can change what<span class=tutor-code>size</span>is equal to. That will grow or shrink both boxes at once! Try changing 80 to 180!",
de: "Du kannst<span class=tutor-code>size</span>ändern zu was du magst. Beide werden gleichzeitig grösser oder kleiner! Probiere die 80 in 180 zu ändern!",
jp: "<span class=tutor-code>size</span>の数字をかえればいいよね。そうすると、いちどに両方の四角形の大きさを大きくしたり、小さくしたりできるからね! <br>80から180にしてみよう!"
},
youGotItCheck: "180"
},
{
message: {
en: "Can you move each of the boxes around by changing some of the numbers?",
de: "Kannst du die Quadrate herumbewegen indem du einige Zahlen änderst?",
jp: "いくつか数字をかえて四角形を動かしてみよう。"
}
},
{
message: {
en: "Monster want more boxes. Three boxes!",
de: "Monster mag mehr Quadrate! 3 Quadrate!",
jp: "モンスターはもっと四角形がほしいな。3つほしい!"
},
code: "var size = 80;\nc.fillRect(20, 20, size, size);\nc.fillRect(80, 80, size, size);\nc.fillRect(140, 140, size, size);\n"
},
{
message: {
en: "Now what happens when you change what<span class=tutor-code>size</span>is equal to?",
de: "Was passiert wenn du<span class=tutor-code>size</span>jetzt änderst?",
jp: "では、<span class=tutor-code>size</span>を同じようにかえたら何が起きるだろう?"
}
},
{
message: {
en: "More boxes! Try changing<span class=tutor-code>size</span>now!",
de: "Mehr Quadrate! Jetzt versuche<span class=tutor-code>size</span>zu ändern!",
jp: "四角形がふえた! では、<span class=tutor-code>size</span>を今すぐかえてみよう!"
},
code: "var size = 80;\nc.fillRect(20, 20, size, size);\nc.fillRect(60, 60, size, size);\nc.fillRect(100, 100, size, size);\nc.fillRect(140, 140, size, size);\nc.fillRect(180, 180, size, size);\n"
},
{
message: {
en: "Ooo! Color! Pretty!",
de: "Oh! Farben! Schön!",
jp: "すごい! 色がついてる! かわいい!"
},
code: "var size = 80;\n\nc.fillStyle = \"blue\";\nc.fillRect(20, 20, size, size);\n",
lessonSection: {
en: "Color",
de: "Farben",
jp: "色"
}
},
{
message: {
en: "Many colors work. Try \"green\" or \"purple\" or \"gold\".",
de: "Viele Farben funktionieren: rot (red), grün (green), blau (blue), violett (purple), goldfarben (gold).",
jp: "いろんな色にできるよ。blueを \"green\"(緑) や \"purple\"(むらさき) や \"gold\"(金) にしてみよう。"
}
},
{
message: {
en: "How about two pink boxes?",
de: "Wie wäre es mit rosa (pink) Quadraten?",
jp: "2つのピンクの四角形はどう?"
},
code: "var size = 80;\n\nc.fillStyle =\"pink\";\nc.fillRect(20, 20, size, size);\nc.fillRect(90, 90, size, size);\n"
},
{
message: {
en: "One pink and one silver.",
de: "Eins rosa (pink), und eins silberfarben (silver).",
jp: "1つはピンク(pink)で、もう1つは銀(silver)にしよう。"
},
code: "var size = 80;\n\nc.fillStyle =\"pink\";\nc.fillRect(20, 20, size, size);\nc.fillStyle =\"silver\";\nc.fillRect(90, 90, size, size);\n"
},
{
message: {
en: "Can you make the silver box gold instead? And the pink one blue instead?",
de: "Kannst du das silberne Quadrat gold (gold) machen? Und die rosane blau (blue)?",
jp: "銀の四角形を、銀ではなく金(gold)にできるかな? で、ピンクを青(blue)にかえられる?"
},
code: "var size = 80;\n\nc.fillStyle =\"pink\";\nc.fillRect(20, 20, size, size);\nc.fillStyle =\"silver\";\nc.fillRect(90, 90, size, size);\n"
},
{
message: {
en: "Here are two boxes that are the same color again. Now can you make the two boxes be different colors?",
de: "Hier sind 2 Quadrate mit der gleichen Farbe. Kannst du eine von beiden eine andere Farbe geben?",
jp: "また2つの四角形が同じ色になったね。今度は、2つの四角形をちがう色にできるかな?"
},
code: "var size = 80;\n\nc.fillStyle =\"green\";\nc.fillRect(20, 20, size, size);\n\nc.fillRect(90, 90, size, size);\n"
},
{
message: {
en: "Here is one version. I like red and blue.",
de: "Hier ist eine Lösung. Ich mag rot (red) und blau (blue).",
jp: "こういうやり方もあるよ。モンスターは赤と青が好きなんだ。"
},
code: "var size = 80;\n\nc.fillStyle =\"red\";\nc.fillRect(20, 20, size, size);\nc.fillStyle =\"blue\";\nc.fillRect(80, 80, size, size);\n"
},
{
message: {
en: "Red, green, and blue. That's nice.",
de: "Rot, grün und blau. Sooo schön.",
jp: "赤、緑、青。いいね。"
},
code: "var size = 80;\n\nc.fillStyle =\"red\";\nc.fillRect(20, 20, size, size);\nc.fillStyle =\"lime\";\nc.fillRect(80, 80, size, size);\nc.fillStyle =\"blue\";\nc.fillRect(140, 140, size, size);\n"
},
{
message: {
en: "Wha... This does the same thing! What could<span class=tutor-code>rgb()</span>be?",
de: "Huch...das macht das gleiche! Was mag wohl<span class=tutor-code>rgb()</span>sein?",
jp: "おや、これでも同じことができているよ! <span class=tutor-code>rgb()</span>って何なのかな?"
},
code: "var size = 80;\n\nc.fillStyle =\"rgb(255, 0, 0)\";\nc.fillRect(20, 20, size, size);\nc.fillStyle =\"rgb(0, 255, 0)\";\nc.fillRect(80, 80, size, size);\nc.fillStyle =\"rgb(0, 0, 255)\";\nc.fillRect(140, 140, size, size);\n"
},
{
message: {
en: "Try changing any of the zeroes to 200 or so. And try changing any of the 255 to 0. What do the numbers seem to do?",
de: "Versuche die Null in zum Beispiel 200 zu ändern. Und die 255 in 0. Was scheinen die Zahlen zu machen?",
jp: "0のうちのどれかを200とかにしてみよう。そして255のどれかを0にしてみよう。この数字は何を意味しているのかな?"
},
code: "var size = 80;\n\nc.fillStyle =\"rgb(255, 0, 0)\";\nc.fillRect(20, 20, size, size);\nc.fillStyle =\"rgb(0, 255, 0)\";\nc.fillRect(80, 80, size, size);\nc.fillStyle =\"rgb(0, 0, 255)\";\nc.fillRect(140, 140, size, size);\n"
},
{
message: {
en: "Did you figure it out? <span class=tutor-code>rgb()</span>refers to red, green, and blue. The numbers go from 0 to 255. So,<span class=tutor-code>rgb(0, 255, 0)</span>means no red or blue, but all the green you got!",
de: "Hast du es herausgefunden?<span class=tutor-code>rgb()</span>kommt von red, green, blue (rot, grün, blau). Die Zahlen gehen von 0 bis 255.<span class=tutor-code>rgb(0, 255, 0)</span>heisst kein rot, viel grün, kein blau.",
jp: "分かったかな? <span class=tutor-code>rgb()</span>とは、red(赤)、green(緑)、blue(青)を意味しているんだ。数字は0から255まで。だから、<span class=tutor-code>rgb(0, 255, 0)</span>は赤でもなく、青でもなく、緑っていうことになるんだ!"
}
},
{
message: {
en: "You can make lots of colors this way if you change some of the numbers. Try it!",
de: "Du kannst viele Farben erzeugen indem du die Zahlen änderst. Versuch es!",
jp: "こうやって中の数字をかえることで、いろいろな色にかえられるよ。やってみよう!"
}
},
{
message: {
en: "Here is a fun game. Can you make these two boxes the same color?",
de: "Hier kommt ein spassiges Spiel: Kannst du beide Quadrate in der gleichen Farbe einfärben?",
jp: "楽しいゲームをしよう。これらの2つの四角形を同じ色にできるかな?"
},
code: "var size = 80;\n\nc.fillStyle =\"rgb(0, 0, 0)\";\nc.fillRect(20, 20, size, size);\nc.fillStyle =\"red\";\nc.fillRect(80, 80, size, size);\n",
lessonSection: {
en: "Quiz: Color",
de: "Quiz: Farben",
jp: "クイズ:色"
},
youGotItCheck: "rgbs*(s*255s*,s*0s*,s*0s*)"
},
{
message: {
en: "Can you make these both blue?",
de: "Kannst du die Quadrate blau machen?",
jp: "これら両方の四角形を青色にできるかな?"
},
code: "var size = 80;\n\nc.fillStyle =\"rgb(0, 0, 0)\";\nc.fillRect(20, 20, size, size);\nc.fillStyle =\"blue\";\nc.fillRect(80, 80, size, size);\n",
youGotItCheck: "rgb(0, 0, 255)"
},
{
message: {
en: "Can you figure out what the<span class=tutor-code>rgb()</span>numbers should be to make these both yellow?",
de: "Welche Zahlen ergeben gelb?",
jp: "これら両方の四角形を黄色にするには、<span class=tutor-code>rgb()</span>の数字をいくつにすればよいかわかるかな?"
},
code: "var size = 80;\n\nc.fillStyle =\"rgb(255, 0, 0)\";\nc.fillRect(20, 20, size, size);\nc.fillStyle =\"yellow\";\nc.fillRect(80, 80, size, size);\n"
},
{
message: {
en: "Can you figure out what the<span class=tutor-code>rgb()</span>numbers should be to make these both teal?",
de: "Welche Zahlen ergeben blaugrün?",
jp: "これら両方の四角形を青緑色(teal)にするには、<span class=tutor-code>rgb()</span>の数字をいくつにすればよいかわかるかな?"
},
code: "var size = 80;\n\nc.fillStyle =\"rgb(0, 0, 128)\";\nc.fillRect(20, 20, size, size);\nc.fillStyle =\"teal\";\nc.fillRect(80, 80, size, size);\n"
},
{
message: {
en: "Okay, this one is really hard. Can you make these two exactly match? Can you figure out what the<span class=tutor-code>rgb()</span>numbers should be to make these both crimson? Don't worry if you don't get it exactly, just see how close you can get!",
de: "Okay, das ist jetzt schwer: Kannst du die Farben genau gleich machen? Welche Zahlen für<span class=tutor-code>rgb()</span>ergeben karminrot (crimson)? Versuche so genau wie möglich die karminrot zu treffen.",
jp: "さあ、これはすごくむずかしいよ。この2つの四角形を全く同じ色にできるかな? 両方の四角形を<ruby><rb>真紅</rb><rp>(</rp><rt>しんく</rt><rp>)</rp></ruby>の色(crimson)にするには<span class=tutor-code>rgb()</span>の数字をいくつにすればいいかわかるかな? <br>正かくにできなくても心配ないよ。近い色にできればいいよ!"
},
code: "var size = 80;\n\nc.fillStyle =\"rgb(0, 0, 0)\";\nc.fillRect(20, 20, size, size);\nc.fillStyle =\"crimson\";\nc.fillRect(80, 80, size, size);\n"
},
{
message: {
en: "Here it is. Whew, that's a hard one! How close did you get?",
de: "Hier ist die Lösung. Weia, das war schwer! Wie nah warst du dran?",
jp: "できたよ。これはむずかしいね! どのくらい近い色ができたかな?"
},
code: "var size = 80;\n\nc.fillStyle =\"rgb(220, 20, 60)\";\nc.fillRect(20, 20, size, size);\nc.fillStyle =\"crimson\";\nc.fillRect(80, 80, size, size);\n"
},
{
message: {
en: "If you want to try others, put \"olive\", \"purple\", \"aqua\", or any other color you can think of as the color for the first box, then try to find the rgb numbers that match it!",
de: "Wenn du andere Farben probieren willst, probier \"olive\", \"purple\", \"aqua\" oder probier eine andere Farbe (aber in Englisch)",
jp: "他の色もやってみたければ、\"olive\"(オリーブ色)、\"purple\"(うすむらさき色)、\"aqua\"(水色)を入れてみよう。または、最初の四角形に思いつく色を入れてみて、それに合うrgbの数字を見つけてみよう!"
}
},
{
message: {
en: "<span class=tutor-code>rgba()</span>is a crazy version of<span class=tutor-code>rgb()</span>. See what this does? It's got one more number at the end that's 0.5. What is that last number doing? Try changing the 0.5 to 0.1. Or to 0.8. What does it do?",
de: "<span class=tutor-code>rgba()</span>ist eine besondere Version von<span class=tutor-code>rgb()</span>. Siehst Du den Unterschied? Sie hat eine Zahl mehr am Ende und die ist 0.5. Was macht die letzte Zahl? Versuch die 0.5 durch 0.1 or 0.8 zu ersetzen. Was passiert?",
jp: "<span class=tutor-code>rgba()</span>は<span class=tutor-code>rgb()</span>のもっとすごいバージョンだよ。何ができるか見てみよう。<span class=tutor-code>rgb()</span>にはさいごにもう1つ数字が追加されていて、0.5ってなっているね。このさいごの数字は何をやっているんだろう? 0.5を0.1にかえてみよう。または0.8にかえてみよう。どうなるかな?"
},
code: "var size = 80;\n\nc.fillStyle =\"rgba(255, 0, 0, 0.5)\";\nc.fillRect(20, 20, size, size);\nc.fillStyle =\"rgba(0, 0, 255, 0.5)\";\nc.fillRect(80, 80, size, size);\n",
lessonSection: {
en: "Color and Transparency",
de: "Farben und Transparenz",
jp: "色と透明"
}
},
{
message: {
en: "The a in<span class=tutor-code>rgba</span>means alpha (how transparent the box is) from 0.0 (invisible) to 1.0 (solid)",
de: "Das a in<span class=tutor-code>rgba</span>steht für alpha (Transparenz) und sie reicht von 0.0 (unsichtbar) bis 1.0 (undurchsichtig).",
jp: "<span class=tutor-code>rgb()</span>の「a」は<ruby>alpha<rp>(</rp><rt>アルファ</rt><rp>)</rp></ruby>のことで、どれだけすきとおっているかを意味しているんだ。数字は0.0(とうめい)から1.0(ぬりつぶし)までで、0、0.1、0.2、0.3、0.4、0.5、0.6、0.7、0.8、0.9、1 のどれかを使うんだよ。"
}
},
{
message: {
en: "You can do pretty cool things with<span class=tutor-code>rgba()</span>. Look at this! Try changing some of the 0.5 alphas to 0.2 or 0.8!",
de: "Du kannst interessante Sachen mit<span class=tutor-code>rgba()</span>machen. Schau mal! Ändere einige der 0.5 transparenz in 0.2 oder 0.8!",
jp: "<span class=tutor-code>rgba()</span>を使ってすごいことができるよ。これを見てよ! 0.5ってなっているalphaのどれかを0.2または0.8にかえてみよう!"
},
code: "var size = 80;\n\nc.fillStyle =\"rgba(255, 0, 0, 0.5)\";\nc.fillRect(20, 20, size, size);\nc.fillStyle =\"rgba(0, 255, 0, 0.5)\";\nc.fillRect(80, 80, size, size);\nc.fillStyle =\"rgba(0, 0, 255, 0.5)\";\nc.fillRect(140, 140, size, size);\n"
},
{
message: {
en: "Try changing the size from 80 to 180! You can get some fun effects when the colors overlap. Play with it!",
de: "Versuch die Grösse von 80 auf 180 zu ändern! Du kannst spassige Effekte erhalten wenn Farben überlappen. Spiel damit!",
jp: "sizeを80から180にかえてみよう! 色の重なったところが面白くなっているでしょ。いろいろ遊んでみてね!"
}
},
{
message: {
en: "Let's go back to variables. Monster no like to repeat numbers. Can you replace both the 20 numbers with<span class=tutor-code>offset</span>?",
de: "Lass uns zurück auf Variablen kommen. Monster mögen keine Wiederholungen. Kannst Du beide 20 mit<span class=tutor-code>offset</span>ersetzen?",
jp: "では<ruby>変数<rp>(</rp><rt>へんすう</rt><rp>)</rp></ruby>にもどろう。モンスターは数字をくり返すのがスキじゃない。20という数字の両方を「<span class=tutor-code>offset</span>」にかえられるかな?"
},
code: "var offset = 30;\nvar size = 80;\nc.fillStyle =\"lime\";\nc.fillRect(20, 20, size, size);\nc.fillRect(90, 90, size, size);\n",
lessonSection: {
en: "Operators and Assignment",
de: "Operatoren und Zuweisungen",
jp: "演算子と代入"
}
},
{
message: {
en: "Now try changing what<span class=tutor-code>var offset</span>is equal to from 30 to 50. See how you can move the first box?",
de: "Jetzt ändere<span class=tutor-code>var offset</span>von 30 nach 50. Siehst du wie sich das erste Quadrat bewegt?",
jp: "今度は、<span class=tutor-code>var offset</span>を30から50にかえてみよう。さいしょの四角形が動いたでしょ?"
},
code: "var offset = 30;\nvar size = 80;\nc.fillStyle =\"lime\";\nc.fillRect(offset, offset, size, size);\nc.fillRect(90, 90, size, size);\n"
},
{
message: {
en: "Variables can be set to new values. See how offset is set to 100 before being used by the second box?",
de: "Variablen können neue Werte erhalten. Siehst du wie sie auf 100 gesetzt wird bevor es vom zweiten Quadrat benutzt wird?",
jp: "こんなふうに<ruby>変数<rp>(</rp><rt>へんすう</rt><rp>)</rp></ruby>には新しい数字を入れられるんだ。それに2つ目の四角形のコードの、上の行を見てみて。「var offset = 100;」じゃなくて「offset = 100;」って書いてあるでしょ。2回目からあとは「var」がいらないんだ。"
},
code: "var offset = 30;\nvar size = 80;\nc.fillStyle =\"lime\";\nc.fillRect(offset, offset, size, size);\noffset = 100;\nc.fillRect(offset, offset, size, size);\n"
},
{
message: {
en: "Try moving the second box. Change the 100 to 50 or 150.",
de: "Versuche das zweite Quadrat zu bewegen. Ändere die 100 in 50 oder 150.",
jp: "2つ目の四角形を動かしてみよう。100を50や150にかえてみて!"
}
},
{
message: {
en: "Try moving the first box too.",
de: "Versuche das erste Quadrat auch zu bewegen.",
jp: "1つ目の四角形も動かしてみて。"
}
},
{
message: {
en: "Can you put the boxes on top of each other so it looks like just one box?",
de: "Kannst Du beide Quadrate übereinander zeichnen sodass es wie ein Quadrat aussieht?",
jp: "1つの四角形に見えるように、四角形を重ねてみてみよう。"
}
},
{
message: {
en: "You can also add numbers to a variable. See what this is doing? It changes<span class=tutor-code>offset</span>with<span class=tutor-code>offset = offset + 50</span>",
de: "Du kannst auch Zahlen zu Variablen addieren. Siehst du wie das funktioniert? Es ändert<span class=tutor-code>offset</span>mit<span class=tutor-code>offset = offset + 50</span>",
jp: "<ruby>変数<rp>(</rp><rt>へんすう</rt><rp>)</rp></ruby>には数字も足せるんだよ。どうやるかっていうと、<span class=tutor-code>offset</span>を<span class=tutor-code>offset = offset + 50</span>にかえるんだ。"
},
code: "var offset = 30;\nvar size = 80;\nc.fillStyle =\"lime\";\nc.fillRect(offset, offset, size, size);\noffset = offset + 50;\nc.fillRect(offset, offset, size, size);\n"
},
{
message: {
en: "<span class=tutor-code>offset = offset + 50</span>means take<span class=tutor-code>offset</span>, add 50 to it, then make<span class=tutor-code>offset</span>equal that now. In other words, make<span class=tutor-code>offset</span>50 more than it used to be.",
de: "<span class=tutor-code>offset = offset + 50</span>bedeutet: nehme den Wert von<span class=tutor-code>offset</span>, addiere 50 dazu, und setze<span class=tutor-code>offset</span>auf den neuen Wert. In anderen Worten: mache<span class=tutor-code>offset</span>50 mehr.",
jp: "<span class=tutor-code>offset = offset + 50</span>とは、<span class=tutor-code>offset</span>に50足したものが新しい<span class=tutor-code>offset</span>の数字になるということなんだ。ここの例でいうと、元の<span class=tutor-code>offset</span>は30だから、新しい<span class=tutor-code>offset</span>は、30 + 50 = 80、つまり80にかわるということなんだ。"
}
},
{
message: {
en: "How about you try it? Can you replace both the 90 numbers used for the (left, top) of the second box with a variable? Hint: Either create a new variable or change<span class=tutor-code>offset</span>and then use<span class=tutor-code>offset</span>.",
de: "Probier mal! Kannst du beide 90 für (links, oben) des zweiten Quadrates mit einer Variablen ändern? Ein Tip: Entweder zu benutzt eine neue Variable, oder du änderst<span class=tutor-code>offset</span>und benutzt<span class=tutor-code>offset</span>dann.",
jp: "試してみよう。2つ目の四角形の(左,上)の90を<ruby>変数<rp>(</rp><rt>へんすう</rt><rp>)</rp></ruby>に変えてみよう。<br>ヒント:新しい<ruby>変数<rp>(</rp><rt>へんすう</rt><rp>)</rp></ruby>を作るか、<span class=tutor-code>offset</span>を使ってみよう。そのときは<span class=tutor-code>offset</span>の数字をかえてね。"
},
code: "var offset = 30;\nvar size = 80;\nc.fillStyle =\"lime\";\nc.fillRect(offset, offset, size, size);\n\nc.fillRect(90, 90, size, size);\n",
lessonSection: {
en: "Quiz: Variables and Operators",
de: "de section",
jp: "クイズ:変数と演算"
}
},
{
message: {
en: "Monsters like adding. Me add good. Okay, now try changing<span class=tutor-code>offset</span>from 30 to 80. See what happens?",
de: "Monster mag addieren. Ich kann das! Okay, versuch<span class=tutor-code>offset</span>von 30 auf 80 zu ändern. Was passiert?",
jp: "モンスターは足すのが大好き。足すっていいね。それでは<span class=tutor-code>var offset</span>を30から80にかえてみよう。何が起きるかな?"
},
code: "var offset = 30;\nvar size = 80;\nc.fillStyle =\"lime\";\nc.fillRect(offset, offset, size, size);\noffset = offset + 60;\nc.fillRect(offset, offset, size, size);\n"
},
{
message: {
en: "Ooo, you can move both boxes together! Change the<span class=tutor-code>offset</span>and move 'em around!",
de: "Oh, du kannst beide Quadrate zusammen bewegen! Ändere<span class=tutor-code>offset</span>und bewege sie herum!",
jp: "おおおー、二つの四角形を同時に動かせるね! <span class=tutor-code>offset</span>をかえて、いろんなところに動かしてみよう!"
}
},
{
message: {
en: "This looks the same, but it's a little different. What's that<span class=tutor-code>*</span>doing? What happens if you change<span class=tutor-code>* 3</span>to<span class=tutor-code>* 2</span>? Try changing it to<span class=tutor-code>* 1</span>. Try changing the<span class=tutor-code>offset</span>too. Did you figure out what<span class=tutor-code>*</span>means?",
de: "Das sieht ähnlich aus, ist aber etwas anders. Was macht das<span class=tutor-code>*</span>? Was passiert wenn du<span class=tutor-code>* 3</span>in<span class=tutor-code>* 2</span>änderst? Probier auch mal<span class=tutor-code>* 1</span>. Ändere auch<span class=tutor-code>offset</span>. Hast du's herausgefunden was<span class=tutor-code>*</span>macht?",
jp: "これは同じように見えるけどちょっとちがうね。「<span class=tutor-code>*</span>」は何をしているかな? <span class=tutor-code>* 3</span>を<span class=tutor-code>* 2</span>にかえると何が起こるかな?<span class=tutor-code>* 1</span>にかえるとどうかな? <span class=tutor-code>offset</span>もかえてみよう。「<span class=tutor-code>*</span>」が何か分かったかな?"
},
code: "var offset = 30;\nvar size = 80;\nc.fillStyle =\"lime\";\nc.fillRect(offset, offset, size, size);\noffset = offset * 3;\nc.fillRect(offset, offset, size, size);\n",
lessonSection: {
en: "More Operators",
de: "Mehr Operatoren",
jp: "もっと演算をしてみよう"
}
},
{
message: {
en: "<span class=tutor-code>*</span>means multiply. <span class=tutor-code>2 * 2</span>would be 4. So,<span class=tutor-code>offset = offset * 3</span>means make<span class=tutor-code>offset</span>three times bigger.",
de: "<span class=tutor-code>*</span>benutzt man zum multiplizieren.<span class=tutor-code>2 * 2</span>ist 4.<span class=tutor-code>offset = offset * 3</span>macht also<span class=tutor-code>offset</span>3 mal grösser.",
jp: "「<span class=tutor-code>*</span>」は「かける(×)」という意味だね。<span class=tutor-code>2 * 2</span>は4になるね。だから<span class=tutor-code>offset = offset * 3</span>は<span class=tutor-code>offset</span>を3倍大きくしてることになるね。"
}
},
{
message: {
en: "<span class=tutor-code>*</span>means multiply and<span class=tutor-code>/</span>means divide. So, what we set size equal to below is just a complicated way of saying make<span class=tutor-code>size</span>equal to 100. See?",
de: "<span class=tutor-code>*</span>bedeutet multiplizieren und<span class=tutor-code>/</span>bedeuted dividieren. Was unten steht ist deshalb eine komplizierte Art um<span class=tutor-code>size</span>auf 100 zu setzen. Siehst du?",
jp: "「<span class=tutor-code>*</span>」は「かける(×)」で、「<span class=tutor-code>/</span>」は「わる(÷)」だよ。つまり、<span class=tutor-code>var size =</span>の後に書いてあるものは、<span class=tutor-code>size</span>は100だよということを、むずかしく書いているだけなんだ。わかるかな?"
},
code: "var size = 20 * 6 / 2 + 50 - 10;\nvar offset = 30;\nc.fillStyle =\"lime\";\nc.fillRect(offset, offset, size, size);\noffset = offset * 3;\nc.fillRect(offset, offset, size, size);\n"
},
{
message: {
en: "We can also compare numbers. See this code? We will only draw a second box when<span class=tutor-code>size</span>is less than 80.",
de: "Wir können auch Nummern vergleichen. Siest du den Code? Wir malen ein zweites Quadrat nur wenn<span class=tutor-code>offset</span>weniger als 80 ist.",
jp: "もちろん、数を比べることもできるんだよ。このコードはなんだと思う? <span class=tutor-code>size</span>が80より小さいのときに2つ目の四角形をかくんだ。"
},
code: "var size = 50;\n\nc.fillRect(20, 20, size, size);\nif (size < 80) {\n c.fillRect(100, 100, size, size);\n}\n",
lessonSection: {
en: "If and Comparisons",
de: "Wenn (If) und Vergleiche",
jp: "ifと比較"
}
},
{
message: {
en: "Try changing<span class=tutor-code>size</span>to 150. See what happens? Try changing<span class=tutor-code>size</span>to 79. Then change it to 80.",
de: "Versuche<span class=tutor-code>size</span>in 150 zu ändern. Was passiert? Probiere<span class=tutor-code>size</span>auf 79 zu setzen. Dann auf 80.",
jp: "<span class=tutor-code>var size</span>を150に変えてみよう。何が起こるかな? その次に<span class=tutor-code>var size</span>を79にも変えてみよう。そして80にも変えてみて。"
}
},
{
message: {
en: "Okay, let's see what you know! Here are two boxes. Can you add a third box (offset by another 60 from the second box)?",
de: "Okay, lass uns sehen was du weisst! Hier sind zwei Quadrate. Kannst du ein drittes Quadrat zeichnen was 60 mehr rechts/unten vom zweiten Quadrat ist?",
jp: "分かってきたかな? ここに2つの四角形があるよ。3つめの四角形を足してみよう (2つ目の箱から60はなしてね)。"
},
code: "var size = 80;\nvar offset = 20;\n\nc.fillStyle =\"lime\";\n\nc.fillRect(offset, offset, size, size);\noffset = offset + 60;\nc.fillRect(offset, offset, size, size);\n",
lessonSection: {
en: "Quiz: Variables and Color",
de: "Quiz: Variablen und Farben",
jp: "クイズ:変数と色"
}
},
{
message: {
en: "Here is one way to do it. Try changing the<span class=tutor-code>size</span>or<span class=tutor-code>offset</span>!",
de: "Hier ist eine Möglichkeit das zu machen. Versuche<span class=tutor-code>size</span>oder<span class=tutor-code>offset</span>zu ändern!",
jp: "次は<span class=tutor-code>size</span>か<span class=tutor-code>offset</span>の数字を変えてみよう!"
},
code: "var size = 80;\nvar offset = 20;\n\nc.fillStyle =\"lime\";\n\nc.fillRect(offset, offset, size, size);\noffset = offset + 60;\nc.fillRect(offset, offset, size, size);\noffset = offset + 60;\nc.fillRect(offset, offset, size, size);\n"
},
{
message: {
en: "Remember<span class=tutor-code>rgba()</span>? Monster like. Can you make me three boxes with different colors?",
de: "Erinnerst du dich an<span class=tutor-code>rgba()</span>? Monster mag das. Kannst du drei Quadrate mit verschiedenen Farben machen?",
jp: "<span class=tutor-code>rgba()</span>をおぼえてるかな? モンスターはすきさ。3つの四角形をちがう色で作れるかな?"
},
code: "var size = 80;\nvar offset = 20;\n\nc.fillStyle =\"rgba(0, 0, 255, 0.5)\";\nc.fillRect(offset, offset, size, size);\noffset = offset + 60;\nc.fillStyle =\"rgba(0, 0, 255, 0.5)\";\nc.fillRect(offset, offset, size, size);\noffset = offset + 60;\nc.fillStyle =\"rgba(0, 0, 255, 0.5)\";\nc.fillRect(offset, offset, size, size);\n"
},
{
message: {
en: "Here is one way. Ooo! Pretty! Try changing<span class=tutor-code>size</span>,<span class=tutor-code>offset</span>, or the red, blue, and green numbers!",
de: "So kann man das machen. Oh! Schön! Versuche<span class=tutor-code>size</span>,<span class=tutor-code>offset</span>, oder die rot, grün oder blau Werte zu ändern!",
jp: "こんなふうにしてもいいんだよ。わあ! 素敵! <br>じゃあ、<span class=tutor-code>size</span>か、<span class=tutor-code>offset</span>か、赤、青、緑の数字をかえてみて! <br>(おぼえてるかな? rgbは0から255までだよ)"
},
code: "var size = 80;\nvar offset = 20;\n\nc.fillStyle =\"rgba(0, 0, 255, 0.5)\";\nc.fillRect(offset, offset, size, size);\noffset = offset + 60;\nc.fillStyle =\"rgba(0, 255, 0, 0.5)\";\nc.fillRect(offset, offset, size, size);\noffset = offset + 60;\nc.fillStyle =\"rgba(255, 0, 0, 0.5)\";\nc.fillRect(offset, offset, size, size);\n"
},
{
message: {
en: "Monster no like writing code more than once. Lots of writing the same code more than once here, me not like.",
de: "Monster mag Code nicht mehr als einmal schreiben. Hier ist viel gleich. Mag ich nicht.",
jp: "モンスター、コード、一度しか書かない。何度も同じコードを書く、スキジャナイ。"
},
code: "var size = 80;\nvar offset = 20;\n\nc.fillStyle =\"blue\";\n\nc.fillRect(offset, offset, size, size);\noffset = offset + 40;\nc.fillRect(offset, offset, size, size);\noffset = offset + 40;\nc.fillRect(offset, offset, size, size);\n",
lessonSection: {
en: "for Loops",
de: "for Schleifen",
jp: "forループ(繰り返し)"
}
},
{
message: {
en: "This is called a<span class=tutor-code>for</span>loop. It repeats code without writing it more than once. Me like. Try changing the 3 to 5!",
de: "Das hier ist eine<span class=tutor-code>for</span>Schleife. Sie wiederholt Sachen ohne dass man das mehrmals schreiben muss. Ich mag das. Versuche die 3 in 5 zu ändern!",
jp: "これは<span class=tutor-code>for</span>ループ(くりかえし)とよぶのさ。何か同じことをくり返したいとき、コードを何度も書かずにすむんだ。モンスター、スキ。3を5にかえて、ためしてみよう!"
},
code: "var size = 80;\nvar offset = 20;\n\nc.fillStyle =\"blue\";\nfor (var i = 0; i < 3; i = i + 1) {\n c.fillRect(offset, offset, size, size);\n offset = offset + 40;\n}\n"
},
{
message: {
en: "for loops have three parts, where to start (<span class=tutor-code>i = 0</span>), when to keep going (<span class=tutor-code>i < 5</span>), and how much to change each time (<span class=tutor-code>i = i + 1</span>). Can you make ten boxes?",
de: "<span class=tutor-code>for</span>Schleifen haben 3 Teile: wo man anfängt (<span class=tutor-code>i = 0</span>), wie lange man weitermacht (<span class=tutor-code>i < 5</span>), und wieviel pro Schleife verändert wird (<span class=tutor-code>i = i + 1</span>). Kannst du 10 Quadrate machen?",
jp: "<span class=tutor-code>for</span>ループは3つのパーツでできているんだ。どこから始めるかを(<span class=tutor-code>i = 0</span>)で表し、(<span class=tutor-code>i < 5</span>)でいつまでつづけるかを決め、 (<span class=tutor-code>i = i + 1</span>)でどのくらいかえたいのかを決めるんだ。じゃあ、10この四角形を作ってみようか。"
},
code: "var size = 80;\nvar offset = 20;\n\nc.fillStyle =\"blue\";\nfor (var i = 0; i < 5; i = i + 1) {\n c.fillRect(offset, offset, size, size);\n offset = offset + 40;\n}\n"
},
{
message: {
en: "Argh! They don't fit? How can you make ten boxes fit?",
de: "Weia! Sie passen nicht! Wie kannst du die 10 Quadrate passend machen?",
jp: "あれれ! どうしよう? どうすれば10個の四角形をわくの中に入れることができるかな?"
},
code: "var size = 80;\nvar offset = 20;\n\nc.fillStyle =\"blue\";\nfor (var i = 0; i < 10; i = i + 1) {\n c.fillRect(offset, offset, size, size);\n offset = offset + 40;\n}\n"
},
{
message: {
en: "Here is one way!",
de: "Hier ist eine Möglichkeit.",
jp: "こんなふうにやってもいいんだよ!"
},
code: "var size = 80;\nvar offset = 20;\n\nc.fillStyle =\"blue\";\nfor (var i = 0; i < 10; i = i + 1) {\n c.fillRect(offset, offset, size, size);\n offset = offset + 10;\n}\n"
},
{
message: {
en: "Smaller boxes also fit. Try playing with<span class=tutor-code>size</span>,<span class=tutor-code>offset</span>, and changing 10!",
de: "Kleinere Quadrate passen auch. Versuche auch<span class=tutor-code>size</span>,<span class=tutor-code>offset</span>und auch die 10 zu ändern!",
jp: "小さい四角形もわくの中に入るよね。<span class=tutor-code>size</span>や<span class=tutor-code>offset</span>で遊んでみて、10にかえてみよう!"
},
code: "var size = 20;\nvar offset = 20;\n\nc.fillStyle =\"blue\";\nfor (var i = 0; i < 10; i = i + 1) {\n c.fillRect(offset, offset, size, size);\n offset = offset + 10;\n}\n"
},
{
message: {
en: "Remember rgba()? What's this doing? Play with it!",
de: "Erinnerst du dich an rgba()? Was macht das? Spiel damit!",
jp: "rgba() が何かおぼえているかな? これは何をしているだろう? 遊んでみて!"
},
code: "var size = 50;\nvar offset = 20;\n\nfor (var i = 0; i < 10; i = i + 1) {\n var b = i * 25;\n var rgba = \"rgba(0, 0, \" + b + \", 0.5)\";\n c.fillStyle = rgba;\n c.fillRect(offset, offset, size, size);\n offset = offset + 20;\n}\n",
lessonSection: {
en: "Fun with For Loops",
de: "Spass mit For Schleifen",
jp: "Forループで楽しんでみよう"
}
},
{
message: {
en: "Complicated! That means use 0 blue light for the first box, 25 for the second, then 50, 75, 100...",
de: "Kompliziert! Das bedeutet benutze 0 blau für das erste Quadrat, 25 für das zweite, dann 50, 75, 100...",
jp: "むずかしいね! 1つ目の四角形は「rgb」の「b」が0だけど、2つ目の箱は「b」が25になるんだ。そして50、75、100…とつづく。<br>なぜなら「i」が0のとき「b」は0×25=0になるよね。次のループでは「i」は1になるから「b」は1×25=25、その次のループでは「i」が2になるから2×25=50になるというわけさ。"
}
},
{
message: {
en: "Here is another one, this one changing alpha! Neat-o!",
de: "Hier ist noch eins. Das ändert die Transparenz (alpha). Cool!",
jp: "次はべつのものだよ。今度はalphaがかわるね。かっこいい!"
},
code: "var size = 50;\nvar offset = 20;\n\nfor (var i = 0.1; i < 0.5; i = i + 0.05) {\n var rgba = \"rgba(0, 0, 255, \" + i + \")\";\n c.fillStyle = rgba;\n c.fillRect(offset, offset, size, size);\n offset = offset + 20;\n}\n"
},
{
message: {
en: "Can you show me what you learned? Draw me a square! Hint: Remember<span class=tutor-code>c.fillRect(<i>left, top, width, height</i>);</span>to draw a box.",
de: "Kannst du mir zeigen was du gelernt hast? Mal mir ein Quadrat! Tip: Erinnere dich an<span class=tutor-code>c.fillRect(<i>left, top, width, height</i>);</span>um ein Rechteck zu zeichnen.",
jp: "ここまで学んできたことをモンスターとおさらいしよう。正方形をかいてみて! <br>ヒント:「<span class=tutor-code>c.fillRect(<i>左,上,はば,高さ</i>);</span>」を思い出してかいてみよう。"
},
code: "",
lessonSection: {
en: "Quiz: Write Code Yourself",
de: "Quiz: Schreib deinen eigenen Code",
jp: "クイズ:コードを自分で書いてみよう!"
}
},
{
message: {
en: "Can you add another square?",
de: "Kannst du noch ein Quadrat zeichnen?",
jp: "べつの正方形も足してみよう!"
}
},
{
message: {
en: "Now can you make the second square red? (Hint:<span class=tutor-code>c.fillStyle = \"blue\";</span>before<span class=tutor-code>fillRect()</span>will make the rect blue)",
de: "Kannst du das zweite Quadrat rot machen Tip:<span class=tutor-code>c.fillStyle = \"blue\";</span>vor<span class=tutor-code>fillRect()</span>macht das nächste Recheck blau (blue)",
jp: "今度は2つ目の正方形を赤(red)にかえてみよう。<br>ヒント:<span class=tutor-code>c.fillRect()</span>のコードの前に<span class=tutor-code>c.fillStyle = \"blue\";</span>というコードを一行くわえたら、正方形は青になったよ。"
}
},
{
message: {
en: "Great! Did you get something like this? If not, try playing with the numbers a bit to see how it works!",
de: "Grossartig! Hast du sowas wie das hier geschrieben? Wenn nicht, ändere die Zahlen und sieh wie's funktioniert!",
jp: "すばらしい! これと同じようなものができたかな? もしできなかったら、数字を少しかえて遊んでみてね!"
},
code: "c.fillRect(10, 10, 20, 20);\nc.fillStyle = \"red\";\nc.fillRect(50, 50, 100, 100);\n"
},
{
message: {
en: "Monster draw line. What do you think<span class=tutor-code>moveTo()</span>does?<span class=tutor-code>lineTo()</span>? Try changing 20 to 50.",
de: "Monster malt Linien. Was meinst du was<span class=tutor-code>moveTo()</span>macht? Und<span class=tutor-code>lineTo()</span>? Probier die 20 in 50 zu ändern.",
jp: "モンスター、線をかくよ。<span class=tutor-code>moveTo()</span>は何をするかな? <span class=tutor-code>lineTo()</span>は? 20から50にかえてみよう。"
},
code: "c.beginPath();\nc.moveTo(30, 20);\nc.lineTo(120, 40);\nc.stroke();\n",
lessonSection: {
en: "Lines",
de: "Linien",
jp: "線"
}
},
{
message: {
en: "Try changing the other numbers too. Can you figure out what<span class=tutor-code>moveTo()</span>and<span class=tutor-code>lineTo()</span>do?",
de: "Versuch auch die anderen Zahlen zu ändern. Weisst du was<span class=tutor-code>moveTo()</span>und<span class=tutor-code>lineTo()</span>tun?",
jp: "他の数字もかえてみよう。<span class=tutor-code>moveTo()</span>と<span class=tutor-code>lineTo()</span>が何をするか分かるかな?"
}
},
{
message: {
en: "<span class=tutor-code>moveTo(left, top)</span>moves the pen to a spot without drawing. <span class=tutor-code>lineTo(left, top)</span>draws a line from wherever the pen is to a spot.",
de: "moveTo(links, oben) bewegt den Zeichenstift zu den Punkt (links, oben) ohne etwas zu zeichnen. lineTo(links, open) malt eine Linie von woimmer der Zeichenstift ist zu den Punkt (links, oben).",
jp: "<span class=tutor-code>moveTo(左,上)</span>は線が始まる点のことで、<span class=tutor-code>lineTo(左,上)</span>は線が終わる点のことだね。"
}
},
{
message: {
en: "Here is what happens if we do a second<span class=tutor-code>lineTo()</span>. The second line starts from where the first ended.",
de: "Hier siehst du was passiert wenn man ein zweites<span class=tutor-code>lineTo()</span>benutzt: die zweite Linie startet dort wo die erste endete.",
jp: "<span class=tutor-code>lineTo()</span>を追加したらどうなるか見てみよう。2本目の線は1本目が終わるところから始まっているね。"
},
code: "c.beginPath();\nc.moveTo(30, 20);\nc.lineTo(120, 40);\nc.lineTo(120, 150);\nc.stroke();\n"
},
{
message: {
en: "So, we're drawing a path, a trail of lines all connected together. We start the path with<span class=tutor-code>beginPath()</span>and draw everything with<span class=tutor-code>stroke()</span>.",
de: "Wir zeichnen also einen Pfad der aus verbundenen Linien besteht. Wir starten den Pfad mit<span class=tutor-code>beginPath()</span>und malen alles auf einmal mit<span class=tutor-code>stroke()</span>.",
jp: "つまり、オレたちはパス(全てがつながった線のこと)をかいているんだ。このパスは<span class=tutor-code>beginPath()</span>から始まって、全てが <span class=tutor-code>stroke()</span>で終わっているよ。"
}
},
{
message: {
en: "If we put a<span class=tutor-code>moveTo()</span>before the second<span class=tutor-code>lineTo()</span>, we'll move the pen without drawing. See?",
de: "Wenn wir<span class=tutor-code>moveTo()</span>vor das zweite<span class=tutor-code>lineTo()</span>benutzen, bewegen wir den Zeichenstift ohne zu zeichnen. Siehst du?",
jp: "<span class=tutor-code>moveTo()</span>を2つ目の<span class=tutor-code>lineTo()</span>よりも前におくと、線がはなれたよ。わかるかな?"
},
code: "c.beginPath();\nc.moveTo(30, 20);\nc.lineTo(120, 40);\nc.moveTo(120, 60);\nc.lineTo(120, 150);\nc.stroke();\n"
},
{
message: {
en: "You try it! Add another line, put a second<span class=tutor-code>c.lineTo()</span>after the first going to (150, 115).",
de: "Probier du es! Füge eine neue Linue hinzu: mach ein zweites<span class=tutor-code>c.lineTo()</span>nach dem ersten um zu (150, 115) zu gehen.",
jp: "他の線を足してみよう! 2つ目の線は<span class=tutor-code>c.lineTo(150,115)</span>の後にかいてごらん。"
},
code: "c.beginPath();\nc.moveTo(100, 30);\nc.lineTo(150, 115);\n\nc.stroke();\n"
},
{
message: {
en: "Did that do what you expected? Try adding a third line!",
de: "Hat es das gemacht was du gedacht has? Füge eine dritte Linie hinzu!",
jp: "うまくいったかな? 3本目を足しみよう!"
},
code: "c.beginPath();\nc.moveTo(100, 30);\nc.lineTo(150, 115);\nc.lineTo(50, 115);\n\nc.stroke();\n"
},
{
message: {
en: "Can you make a triangle?",
de: "Kannst du ein Dreieck machen?",
jp: "じゃあ、三角形は作れるかな?"
}
},
{
message: {
en: "Here is one way, a triangle!",
de: "Hier ist eine Möglichkeit ein Dreieck zu machen.",
jp: "三角形を作る方法はこれだ!"
},
code: "c.beginPath();\nc.moveTo(100, 30);\nc.lineTo(150, 115);\nc.lineTo(50, 115);\nc.lineTo(100, 30);\nc.stroke();\n"
},
{
message: {
en: "Okay, an orange triangle. Like blue better. Can you make it blue?",
de: "Okay, ein orangenes Dreieck. Ich mal blau lieber. Kannst du es blau (blue) machen?",
jp: "なるほど、オレンジの三角形か。青の方がすきなんだよな。青にかえられる?"
},
code: "c.beginPath();\nc.strokeStyle = \"orange\";\nc.moveTo(100, 30);\nc.lineTo(150, 115);\nc.lineTo(50, 115);\nc.lineTo(100, 30);\nc.stroke();\n"
},
{
message: {
en: "I was trying to make two triangles, but forgot a<span class=tutor-code>moveTo()</span>. See what happened?",
de: "ich wollte zwei Dreiecke machen, aber ich have<span class=tutor-code>moveTo()</span>vergessen. Siehst du was passiert ist?",
jp: "2つの三角形を作ろうと思ってたんだけど、<span class=tutor-code>moveTo()</span>をわすれちゃったよ。どうなったか見てみる?"
},
code: "c.beginPath();\nc.moveTo(100, 30);\nc.lineTo(150, 115);\nc.lineTo(50, 115);\nc.lineTo(100, 30);\n\nc.lineTo(250, 215);\nc.lineTo(150, 215);\nc.lineTo(200, 130);\nc.stroke();\n"
},
{
message: {
en: "That's not good. Can you add<span class=tutor-code>c.moveTo(200, 130);</span>to make it two separate triangles?",
de: "Das ist nicht gut. Kannst du<span class=tutor-code>c.moveTo(200, 130);</span>irgendwo einfügen damit es zwei Dreiecke werden?",
jp: "うまくいかなかっただろ。<span class=tutor-code>c.moveTo(200, 130);</span>を足して2つのはなれた三角形を作れるかな?"
}
},
{
message: {
en: "I want a lot of triangles. We need to use<span class=tutor-code>for</span>! This<span class=tutor-code>for</span>loop draws two triangles.",
de: "Ich male viele Dreiecke! Wir brauchen<span class=tutor-code>for</span>! Diese <span class=tutor-code>for</span>Schleife zeichnet zwei Dreiecke.",
jp: "たくさんの三角形がほしいんだ。こういう時は<span class=tutor-code>for</span>を使わなくちゃね! このforループは2つの三角形をかくんだよ。"
},
code: "c.beginPath();\nfor (var i = 30; i <= 60; i = i + 30) {\n c.moveTo(70 + i, i);\n c.lineTo(120 + i, 85 + i);\n c.lineTo(20 + i, 85 + i);\n c.lineTo(70 + i, i);\n}\nc.stroke();\n",
lessonSection: {
en: "Lines and Loops",
de: "Linien und Schleifen",
jp: "線とループ"
}
},
{
message: {
en: "This<span class=tutor-code>for</span>loop starts at 30 and increases by 30 every time. So, until it is told to stop, it counts 30, 60, 90, 120... Right now, the for loop is told to stop at 60.",
de: "Diese<span class=tutor-code>for</span>Schleife startet mit 30 und erhöht sich um 30 jedes mal. Das heisst es zählt 30, 60, 90, 120... bis es fertig ist. Im Moment hört es auf wenn 60 erreicht ist.",
jp: "この<span class=tutor-code>for</span>ループは30から始まって、30ずつふえていくんだ。つまりストップって言われるまで30、60、90、120…と足していくんだね。今は60になったらストップといってるね。"
}
},
{
message: {
en: "So, can you make this<span class=tutor-code>for</span>loop draw three triangles? Five?",
de: "Kannst du diese<span class=tutor-code>for</span>Schleife drei Dreiecke zeichnen lassen? Fünf auch?",
jp: "じゃあ、さっそくこの<span class=tutor-code>for</span>ループで3つの三角形をかけるかな? 5個は?"
}
},
{
message: {
en: "Can you make more triangles by changing how the<span class=tutor-code>for</span>loop goes up? What if it counted by 10 each time, so it would count 30, 40, 50, 60... Can you do try that?",
de: "Kannst du mehr Dreiecke zeichnen indem du die Zahl verringerst um den sich der Schleifenzähler ändert pro Schleife? Was wenn du 10 pro Schleife addierst? Es würde dann so zählen: 30, 40, 50, 60... Kannst du das probieren?",
jp: "<span class=tutor-code>for</span>ループがふえることによってもっと三角形を作れるかな? 10ごとに足されることによって、何が起こるかな、30、40、50、60…と変わっていくよ。ためしてみようか。"
}
},
{
message: {
en: "Aieee! Look at this! Forty green triangles!",
de: "Cooool! Schau mal! Vierzig grüne Dreiecke!",
jp: "ほらほら、みて! 40の緑の三角形ができた!"
},
code: "c.strokeStyle = \"green\";\nc.beginPath();\nfor (var i = 10; i <= 210; i = i + 5) {\n c.moveTo(70 + i, i);\n c.lineTo(120 + i, 85 + i);\n c.lineTo(20 + i, 85 + i);\n c.lineTo(70 + i, i);\n}\nc.stroke();\n"
},
{
message: {
en: "Play with it more! Can you change the color? Can you make even more triangles?",
de: "Spiel damit! Kannst du die Farbe ändern? Kannst du noch mehr Dreiecke machen?",
jp: "もっともっと遊んでみて! 色をかえられるかな? もっとたくさんの三角形を作れるかな?"
}
},
{
message: {
en: "Two boxes, one using<span class=tutor-code>strokeRect()</span>, the other using four lines.",
de: "Zwei Quadrate. Eins mit<span class=tutor-code>strokeRect()</span>und eins mit vier Linien",
jp: "二つの四角形だよ。一つは<span class=tutor-code>strokeRect()</span>を使っていて、もう一つは線を使ってるんだね。"
},
code: "var size = 100;\n// First box\nc.strokeRect(30, 30, size, size);\n// Second box\nc.beginPath();\nc.moveTo(80, 80);\nc.lineTo(80 + size, 80);\nc.lineTo(80 + size, 80 + size);\nc.lineTo(80, 80 + size);\nc.lineTo(80, 80);\nc.stroke();\n",
lessonSection: {
en: "Coding It Easy",
de: "Coding ist einfach",
jp: "コーディングってかんたんだね。"
}
},
{
message: {
en: "Sure takes a lot more code to draw it with lines. Can you add a third box?",
de: "Es braucht deutlich mehr Code um mit Linien zu zeichnen. Kannst du ein drittes Quadrat hinzufügen?",
jp: "よーし、もっと線を引いちゃおう。3つ目の四角形も足せる?"
},
code: "var size = 100;\n// First box\nc.strokeRect(30, 30, size, size);\n// Second box\nc.beginPath();\nc.moveTo(80, 80);\nc.lineTo(80 + size, 80);\nc.lineTo(80 + size, 80 + size);\nc.lineTo(80, 80 + size);\nc.lineTo(80, 80);\nc.stroke();\n// Third box?\n"
},
{
message: {
en: "<span class=tutor-code>strokeRect()</span>is easier, isn't it? Here are three boxes all using<span class=tutor-code>strokeRect()</span>. Can you add a fourth?",
de: "<span class=tutor-code>strokeRect()</span>ist einfacher, gell? Hier sind drei Quadrate mit<span class=tutor-code>strokeRect()</span>. Kannst du ein viertes hinzufügen?",
jp: "<span class=tutor-code>strokeRect()</span>の方がかんたんじゃない? こっちの3つの四角形は<span class=tutor-code>strokeRect()</span>を使っているよ。4つ目も足せる?"
},
code: "var size = 100;\n\nc.strokeRect(30, 30, size, size);\nc.strokeRect(80, 80, size, size);\nc.strokeRect(130, 130, size, size);\n"
},
{
message: {
en: "What if we want even more boxes? Lots of copying. Yuck-o.",
de: "Was wenn wir mehr Quadrate möchten? Viel Code zu kopieren. Bäh...",
jp: "もっと四角形がほしい時はどうする? どんどんコピーする? うへー!"
},
lessonSection: {
en: "Avoid Repeating Code",
de: "Vermeidung von Wiederholungen",
jp: "コードをくり返すのはよくないね。"
}
},
{
message: {
en: "I know! Use<span class=tutor-code>for</span>loop! Can you make more boxes for Code Monster?",
de: "Ich weiss!<span class=tutor-code>for</span>Schleifen! Kannst du mehr Quadrate für mich machen?",
jp: "わかってる! <span class=tutor-code>for</span>ループを使おう! コードモンスターのためにもっと四角形を作ってくれる?"
},
code: "var size = 100;\n\nfor (var x = 30; x <= 80; x = x + 50) {\n c.strokeRect(x, x, size, size);\n}\n"
},
{
message: {
en: "Can you make more than ten boxes? And still fit all of them on the screen?",
de: "Kannst du mehr als 10 Quadrate machen? Und passen die noch auf den Bildschirm?",
jp: "10こ以上作れる? わくの中に入るかな?"
}
},
{
message: {
en: "Is it easier now to make more boxes? Why is that?",
de: "Ist es jetzt einfacher mehr Quadrate zu machen? Warum ist das so?",
jp: "前よりも四角形を作るのがかんたんじゃない? なんでだろう?"
},
code: "var size = 100;\nvar num = 3;\nvar offset = 30;\n\nfor (var i = 1; i <= num; i = i + 1) {\n c.strokeRect(i * offset, i * offset, size, size);\n}\n",
lessonSection: {
en: "Variables Make It Easy Too",
de: "Variable machen es leichter",
jp: "変数を使うとかんたんにできるね。"
}
},
{
message: {
en: "This works by having<span class=tutor-code>i</span>count up 1, 2, 3... then putting each box's (left, top) at<span class=tutor-code>i * offset</span>, so, since<span class=tutor-code>offset</span>is 30, the top left of the first box is (30, 30), the second is at (60, 60), then (90, 90) ...",
de: "Das funktioniert indem wir<span class=tutor-code>i</span>von 1, 2, 3... zählen lassen, und jedes Quadrat (links, oben)<span class=tutor-code>i * offset</span>sein lassen, und weil<span class=tutor-code>offset</span>30 ist, ist (links, oben) vom ersten Quadrat (30, 30), vom zweiten ist es (60, 60), dann (90, 90)...",
jp: "これは<span class=tutor-code>i</span>に 1、2、3…と数字がじゅんばんに入っていくことで、うまくいくんだ。それから、四角形の(左,上)を<span class=tutor-code>i * offset</span>にしよう。<span class=tutor-code>offset</span>が30だから、さいしょの四角形の(左,上)は(30, 30)、2番目は(60, 60)、次は(90, 90)…。"
}
},
{
message: {
en: "Try changing<span class=tutor-code>size</span>,<span class=tutor-code>num</span>, and<span class=tutor-code>offset</span>. See what happens? Play with it!",
de: "Ändere<span class=tutor-code>size</span>,<span class=tutor-code>num</span>, und<span class=tutor-code>offset</span>und sieh was passiert.",
jp: "<span class=tutor-code>var size</span>、<span class=tutor-code>var num</span>、<span class=tutor-code>var offset</span>の数字をかえてごらん。何が起こるかな? ためしてみて!"
}
},
{
message: {
en: "It's often good to have variables that control things (like<span class=tutor-code>size</span>,<span class=tutor-code>num</span>, and<span class=tutor-code>offset</span>) together so they are easy to change. Like it?",
de: "Es ist oft sinnvoll Variablen Sachen zusammen kontrollieren zu lassen (wie<span class=tutor-code>size</span>,<span class=tutor-code>num</span>und<span class=tutor-code>offset</span>) damit sie einfacher zu ändern sind. Magst du das auch?",
jp: "まとめて命れい(<span class=tutor-code>size</span>とか<span class=tutor-code>num</span>とか<span class=tutor-code>offset</span>とか)したいときは、<ruby>変数<rp>(</rp><rt>へんすう</rt><rp>)</rp></ruby>を使うと、かんたんにかえられるね。気に入った?"
}
},
{
message: {
en: "Can you show me some of what you know? Draw a box. <br>Hint:<span class=tutor-code>c.strokeRect(<i>left, top, width, height</i>);</span>draws a box.",
de: "Kannst du mir zeigen was du weisst? Zeichne ein Quadrat. <br>Tip:<span class=tutor-code>c.strokeRect(<i>links, oben, weite, höhe</i>);</span>zeichnet ein Rechteck.",
jp: "キミの知っていることを、やってみせてくれる? まず四角形をかいてみて。<br>ヒント:<span class=tutor-code>c.strokeRect(<i><ruby>left<rp>(</rp><rt>上</rt><rp>)</rp></ruby>, <ruby>top<rp>(</rp><rt>上</rt><rp>)</rp></ruby>, <ruby>width<rp>(</rp><rt>はば</rt><rp>)</rp></ruby>, <ruby>heibght<rp>(</rp><rt>高さ</rt><rp>)</rp></ruby></i>);</span>は四角形をかくよ。"
},
code: "",
lessonSection: {
en: "Quiz: For Loops",
de: "Quiz: For Schleifen",
jp: "クイズ : forループ"
}
},
{
message: {
en: "Now draw four boxes. Hint: Making four boxes is easy using<span class=tutor-code>for</span>. Remember,<span class=tutor-code>for</span>loop look like this:<span class=tutor-code>for (var i = 0; i < 3; i += 1) {</span>",
de: "Jetzt zeichne 4 Quadrate. Tip: Es ist einfach mit der<span class=tutor-code>for</span>Schleife.<span class=tutor-code>for</span>Schleifen sehen so aus:<span class=tutor-code>for (var i = 0; i < 3; i += 1) {</span>",
jp: "今度は4つの四角形をかいて。<br>ヒント:4つの四角形をつくるには、<span class=tutor-code>for</span>を使うとかんたんだよ。<br><span class=tutor-code>for (var i = 0; i < 3; i += 1) {</span>みたいな<span class=tutor-code>for</span>ループを思い出してね。"
},
code: ""
},
{
message: {
en: "Can you make it so you can change the size of all your boxes all at once? Hint: To make a variable named<span class=tutor-code>size</span>set to 50, you use<span class=tutor-code>var size = 50;</span>",
de: "Kannst du es ändern dass du die Grösse aller Quadrate auf einmal ändern kannst? Tip: Damit du eine Variable mit dem Namen<span class=tutor-code>size</span>mit dem Wert 50 bekommst, schreib<span class=tutor-code>var size = 50;</span>",
jp: "いっぺんに四角形の大きさを全部かえるってできる? <br>ヒント:<span class=tutor-code>size</span>という<ruby>変数<rp>(</rp><rt>へんすう</rt><rp>)</rp></ruby>を作って、それを50にするんだよ。<br>こんなふうにね →<span class=tutor-code>var size = 50;</span>"
}
},
{
message: {
en: "Wow, you're learning to program! Lots of ways you could do this, but did you get something like this? If not, try changing some stuff, figure out how it works!",
de: "Super! Wir lernen programmieren! Es gibt viele Möglichkeiten das zu machen. Hier ist eine Lösung.",