-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathruby-girls.html
896 lines (814 loc) · 29.6 KB
/
ruby-girls.html
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
<!--
Google HTML5 slide template
Original slides by:
Authors: Luke Mahé (code)
Marcin Wichary (code and design)
Dominic Mazzoni (browser compatibility)
Charles Chen (ChromeVox support)
URL: http://code.google.com/p/html5slides/
Modifications by: Dessy Daskalov
-->
<!DOCTYPE html>
<html>
<head>
<title>Girls Learning Code</title>
<meta charset='utf-8'>
<script src='assets/default.js'></script>
</head>
<body style='display: none'>
<section class='slides layout-regular template-default'>
<article>
<h1>
Learning to Program
<br>
with Ruby
</h1>
<p>
Dessy Daskalov
<br>
@dess_e
</p>
</article>
<article id="what-is-ruby">
<style>
#what-is-ruby p { margin: 100px 0px; font-size: 40px; line-height: 50px; };
</style>
<h3>
What is Ruby?
</h3>
<p />
<div>
<p class='large-font'>Ruby is a programming language.</p>
<p class='large-font'>Wait ... what's a programming language?</p>
<p class='large-font'>Let's backtrack a bit.</p>
</div>
</article>
<article id='two-things'>
<style>
#two-things p { margin: 200px 0px; }
</style>
<p class='large-font'>There are two things you should know about your computer.</p>
</article>
<article id='computer-wishes'>
<style>
#computer-wishes h3 { padding-bottom: 10px; }
#computer-wishes img { margin-left: 70px; }
</style>
<h3>
1. Your computer speaks a different language.
</h3>
<p>This is how your computer wishes you could speak to it:</p>
<p />
<img src="assets/images/machine-language.jpg" width="600" height="411" border="1">
</article>
<article id='middle-ground'>
<h3>
This is where a programming language comes in.
</h3>
<style>
#middle-ground p { margin-top: 100px }
</style>
<p>A programming language is <b>easy for you to learn</b>, and <b>your computer also understands it</b>.</p>
<p>It's the <b>half-way point</b> between English and the language that your computer speaks.</p>
</article>
<article id='stupid-computer'>
<style>
#stupid-computer p { margin: 100px 0px; }
</style>
<h3>
2. Your computer is not very smart.
</h3>
<p class='large-font'>Your computer can only do what you tell it to if you give it step-by-step instructions.</p>
</article>
<article id='stupid-computer'>
<h3>People vs. Computers</h3>
<p class='large-font'>
Imagine you have to teach a friend to make a peanut butter sandwich.
</p>
<p class='large-font'>
What would you tell your friend?
</p>
</article>
<article id='ruby-robot'>
<style>
#ruby-robot p { margin: 150px 0px; }
#ruby-robot td { border: none; }
</style>
<h3>
Meet Ruby Robot
</h3>
<table>
<tr>
<td>
<div>
<p class='large-font'>Let's try teaching Ruby Robot to make a peanut butter sandwich.</p>
</div>
</td>
<td><img src="assets/images/robot.png"></td>
</tr>
</table>
</article>
<article id='stupid-computer'>
<h3>People vs. Computers</h3>
<p class='large-font'>People can understand GENERAL instructions.</p>
<p class='large-font'>Computers need EXACT instructions.</p>
</article>
<article id='learned-programming'>
<style>
#learned-programming p { margin-top: 100px; }
#learned-programming b { font-size: 50px }
</style>
<h3>
You've learned what programming is!
</h3>
<p class='large-font'>Programming is writing out <b>step-by-step instructions</b> to speak to your computer.</p>
</article>
<article id='irb-intro'>
<style>
#irb-intro .large-font { font-size: 35px; margin: 50px 0 50px 0; }
</style>
<h3>
Time to see Ruby Robot in action!
</h3>
<section>
<p class='large-font'>You can speak to your computer through Terminal.</p>
</section>
<section>
<pre>irb</pre>
<pre>irb(main):001:0> </pre>
</section>
<p class='large-font'>IRB is like text messaging with Ruby Robot.</p>
</article>
<article>
<p class='large-font'>Let's ask Ruby Robot to do something.</p>
<section>
<pre>> 1 + 1</pre>
<pre>=> 2</pre>
</section>
<section class='build'>
<div>
<pre>> 462 * 86</pre>
<pre>=> 39732</pre>
<p class='large-font'>Ruby can do math very quickly.</p>
</div>
</section>
</article>
<article id='ruby-knows'>
<style>
#ruby-knows .large-font { margin-top: 60px; }
</style>
<pre>> "Girls" + "Learning" + "Code"</pre>
<section class='build'>
<div>
<pre>=> "GirlsLearningCode"</pre>
<p class='large-font'>Ruby Robot knows the difference between a number and a word.</p>
</div>
</section>
</article>
<article id='ruby-robot-world'>
<style>
#ruby-robot-world p { margin: 30px 0px; }
#ruby-robot-world td { border: none; }
</style>
<h3>
Ruby Robot Lives in a Different World
</h3>
<p class='large-font'>Just like in our world, there are many objects in Ruby Robot's world.</p>
<table>
<tr>
<td><p class='large-font'>Every object has a barcode.</p></td>
<td><img src="assets/images/barcode.gif"></td>
</tr>
</table>
<p class='large-font'>Ruby Robot scans the barcode to find out what type of object it is.</p>
</article>
<article id='ruby-robot-world-1'>
<img src='assets/images/ruby-robot-world-1.png'>
</article>
<article id='integer-string'>
<style>
#integer-string .ruby-class { margin: 100px 0px; }
</style>
<h3>
Numbers and Words, Integers and Strings
</h3>
<p>In Ruby Robot's world ...</p>
<p class='ruby-class'>Numbers are called <b>INTEGERS</b>.</p>
<p class='ruby-class'>Letters, words, and sentences are called <b>STRINGS</b>. A String always has quotes around it.</p>
</article>
<article>
<img src='assets/images/ruby-robot-world-2.png'>
</article>
<article id='ruby-instructions'>
<style>
#ruby-instructions .large-font { margin: 150px 0px; }
</style>
<h3>
Ruby Robot's Book of Instructions
</h3>
<p class='large-font'>Ruby Robot has a book full of instructions.</p>
<p class='large-font'>Each page tells Ruby Robot what to do with each type of Object.</p>
</article>
<article>
<img src='assets/images/ruby-robot-world-3.png'>
</article>
<article>
<h3>
Playing with Strings
</h3>
<section class='build'>
<pre>> "girlslearningcode".capitalize</pre>
<pre>=> "Girlslearningcode"</pre>
<pre>> "girlslearningcode".upcase</pre>
<pre>=> "GIRLSLEARNINGCODE"</pre>
<pre>> "girlslearningcode".reverse</pre>
<pre>=> "edocgninraelslrig"</pre>
</section>
</article>
<article id='worksheet-fun'>
<h3>
More Fun With Strings
</h3>
<p class='large-font'>Find your <b>String</b> sheet, and try playing with each of the instructions.</p>
</article>
<article>
<h3>
Playing with Integers
</h3>
<section class='build'>
<pre>> 99.next</pre>
<pre>=> 100</pre>
<pre>> 99.odd?</pre>
<pre>=> true</pre>
<pre>> 99.even?</pre>
<pre>=> false</pre>
</section>
</article>
<article id='worksheet-fun'>
<style>
#worksheet-fun .large-font { margin-top: 175px; }
</style>
<h3>
More Fun With Integers
</h3>
<p class='large-font'>Find your <b>Integer</b> sheet, and try playing with each of the instructions.</p>
</article>
<article id='lazy'>
<style>
#lazy .large-font { margin: 75px 0; }
</style>
<h3>
I'm lazy! I don't want to do all of this typing!
</h3>
<p class='large-font'>What if we could type in <b>"girlslearningcode"</b> only once? We can!</p>
<section>
<pre>> glc = "girlslearningcode"</pre>
<pre>=> "girlslearningcode"</pre></section>
<p class='large-font'><b>glc</b> is called a variable. It's like a nickname for the String.</p>
</article>
<article>
<h3>
Variables Can (And Often Do!) Vary
</h3>
<p>A variable is called just that because it can change.</p>
<section>
<pre>> glc = "learning to code with ruby robot"</pre><pre>=> "learning to code with ruby robot"</pre>
<div>glc <img src='assets/images/arrow.png'> "learning to code with ruby robot"</div>
<p>Now let's ask for glc.</p>
<section class='build'>
<div><pre>> glc</pre><pre>=> "learning to code with ruby robot"</pre></div>
</div>
</section>
</article>
<article>
<p>Let's try some more</p>
<section>
<pre>> glc = 99</pre><pre>=> 99</pre>
<div>glc <img src='assets/images/arrow.png'> 99</div>
<p>Let's ask for glc once again.</p>
<section>
<div><pre>> glc</pre><pre>=> 99</pre></div>
</section>
</section>
</article>
<article>
<h3>The More the Merrier</h3>
<p>Let's introduce another variable.</p>
<section>
<pre>> copycat = glc</pre><pre>=> 99</pre>
<div>glc <img src='assets/images/arrow.png'> 99 <img src='assets/images/back-arrow.png'> copycat</div>
</section>
</article>
<article>
<h3>Let's ask for each variable</h3>
<section>
<pre>> glc</pre><pre>=> 99</pre>
<section class='build'>
<div>
<pre>> copycat</pre><pre>=> 99</pre>
</div>
</section>
</section>
</article>
<article id='variable-reset'>
<style>
#variable-reset .large-font { margin: 100px 0; }
</style>
<h3>Resetting the variable</h3>
<p class='large-font'>Now set glc back to "girlslearningcode"</p>
<section>
<pre>> glc = "girlslearningcode"</pre><pre>=> "girlslearningcode"</pre>
</section>
</article>
<article>
<h3>
Playing With Our Variable
</h3>
<p>You can use this variable like you would have used "girlslearningcode" before.</p>
<section>
<pre>> glc.capitalize</pre>
<pre>=> "Girlslearningcode"</pre>
<pre>> glc.upcase</pre>
<pre>=> "GIRLSLEARNINGCODE"</pre>
<pre>> glc.reverse</pre>
<pre>=> "edocgninraelslrig"</pre>
</section>
</article>
<article id='worksheet-fun'>
<h3>
More Fun With Variables
</h3>
<p class='large-font'>Find your <b>Variable</b> sheet, and try playing with each of the instructions.</p>
</article>
<article id='recap-one'>
<style>
#recap-one .large-font { margin: 75px 0px; text-align: center; font-size: 80px; }
</style>
<h3>
Recap Slide
</h3>
<div class='build'>
<p class='large-font' style='color:#ff9700'>Integer</p>
<p class='large-font' style='color:#4671d5'>String</p>
<p class='large-font' style='color:#68237f'>Variable</p>
</div>
</article>
<article>
<h3>
Let's Try One More
</h3>
<pre>> glc.length</pre>
<div class='build'>
<div>
<pre>=> 17</pre>
<p class='large-font'>
You're probably starting to get a sense of how Twitter knows
how many characters you've typed in.
</p>
</div>
</div>
</article>
<article>
<h3>Doing like Twitter does.</h3>
<pre>> tweet = "I'm coding!"</pre>
<pre>=> "I'm coding!"</pre>
<section class='build'>
<pre>> tweet.length</pre>
<div>
<pre>=> 11</pre>
<p class='large-font'>Try writing some tweets of your own, and check if they're too long!</p>
</div>
</section>
</article>
<article>
<h3>
Writing Our First Program
</h3>
<p>
From your text editor, open the file code.rb in your ruby-girls directory and add the following:
</p>
<section>
<pre>tweet = "I'm coding with Ruby Robot!"<br>puts tweet.length</pre>
</section>
<p>To run your program, type <b>quit</b> to exit from IRB, and then type:</p>
<section>
<pre>ruby code.rb</pre>
</section>
</article>
<article id='ruby-output'>
<style>
#ruby-output .large-font { margin: 50px 0px; }
</style>
<h3>
Outputting Text to the Screen
</h3>
<p class='large-font'>IRB is like back-and-forth text messaging.</p>
<p class='large-font'>A program has to be told when to output something with <b>puts</b>.</p>
<p class='large-font'>Let's try a few more examples together.</p>
</article>
<article id='puzzle-one'>
<style>
#puzzle-one .large-font { margin: 100px 0px; }
</style>
<h3>
Puzzle One - Variables
</h3>
<p class='large-font'>Open puzzle.rb and write down the output you expect to see if you were to run the program.</p>
<p class='large-font'>If you're not sure of something, remember that you can type <b>irb</b> again and try it out.</p>
<p>(Answers in answers/puzzle_answer.txt, but don't look!)</p>
</article>
<article id='real-twitter'>
<style>
#real-twitter .large-font { margin: 60px 0px; }
</style>
<h3>
Getting Input From the User
</h3>
<p>The real Twitter...</p>
<div class='build'>
<p class='large-font'>Asks you to type something.</p>
<p class='large-font'>Tells you how many characters you're working with.</p>
<p>So far, we've just been putting our tweet directly into the program.</p>
</div>
</article>
<article>
<h3>
Asking for Input
</h3>
<p>The <b>puts</b> method is used for output, and the <b>gets.chomp</b> method is used for input. </p>
<p>Let's go back to our program:</p>
<section>
<pre>puts "Write your tweet:"<br />tweet = gets.chomp<br />puts tweet.length</pre>
</section>
<pre>> ruby code.rb</pre>
<p>The gets method warns Ruby that you're about to speak.</p>
</article>
<article id='input-fun'>
<style>
#input-fun .large-font { margin: 70px 0; }
</style>
<h3>
Fun With Inputs
</h3>
<p class='large-font'>Let's try asking for input a few more times.</p>
<p class='large-font'>We'll run the program <b>greeting.rb</b> together.</p>
<p class='large-font'>Do you remember how to run a program?</p>
<pre>ruby greeting.rb</pre>
</article>
<article id='input-madlib'>
<style>
#input-madlib .large-font { margin: 150px 0; }
</style>
<h3>
Inputs for Mad Libs
</h3>
<p class='large-font'>Now let's run <b>madlib.rb</b> together.</p>
<p>The Mad Lib example is from http://www.itsamadlibsworld.com/</p>
</article>
<article id='create-madlib'>
<style>
#create-madlib .large-font { margin: 150px 0; }
</style>
<h3>
Get Creative With Your Own Mad Lib!
</h3>
<p class='large-font'>Create your very own Mad Lib in <b>code.rb</b>.</p>
</article>
<article id='ask-for-tweet'>
<style>
#ask-for-tweet .build { margin-top: 40px; }
</style>
<h3>
Back to your Twitter Program
</h3>
<p>Working with your buddy, write a Twitter program like this:</p>
<div class='build'>
<p>1. Ask (politely!) for a tweet from the user. - <b>puts</b></p>
<p>2. Save the user input with a sticky note with "<b>tweet</b>" on it. - <b>gets.chomp</b></p>
<p>3. Output the tweet the user gave. - <b>puts</b></p>
<p>4. Output the number of characters in the tweet. - <b>puts</b></p>
<p>5. Output how many <b>more</b> characters the user can add until they hit 140 characters. - <b>puts</b></p>
<p>(answers in answers/twitter_2.rb)</p>
</div>
</article>
<article id='conditional-twitter-1'>
<style>
#conditional-twitter-1 .large-font { margin-top: 100px; }
</style>
<h3>
Giving Output Based on Input
</h3>
<p>Twitter...</p>
<p class='large-font'>Lets you send your tweet if it is 140 characters or less.</p>
<p class='large-font'>Tells you that your tweet is too long if it is greater than 140 characters.</p>
</article>
<article id='conditional-twitter-2'>
<style>
#conditional-twitter-2 .large-font { margin-top: 100px; }
</style>
<h3>Giving Output Based on Input</h3>
<p class='large-font'>
So far we know how to print the length of the user's tweet.
</p>
<p class='large-font'>
We don't know how to tell them <b>whether they can or cannot send their tweet, depending on its length</b>.
</p>
</article>
<article id='conditional-logic'>
<style>
#conditional-logic .large-font { margin-top: 100px; }
</style>
<h3>Logic</h3>
<p class='large-font'>Programming is writing out sets of simple instructions for the computer to follow.</p>
<p class='large-font'>Let's break down our tweet logic into simple instructions.</p>
</article>
<article id='conditional-instructions'>
<style>
#conditional-instructions .large-font { margin-top: 80px; }
</style>
<h3>
Logic
</h3>
<p>We want our program to ...</p>
<p class='large-font'><b>if</b> the tweet is <b>greater than 140 characters</b>, tell the user that they <b>cannot send their tweet</b></p>
<p class='large-font'><b>if</b> the tweet is <b>less than 140 characters</b>, tell the user that they can <b>send their tweet</b></p>
</article>
<article id='greater-less-than'>
<style>
#greater-less-than .large-font { margin: 150px 0px; }
#greater-less-than .larger { font-size: 150px; margin-left: 300px; }
</style>
<h3>
Logic: Greater Than
</h3>
<p class='large-font'>The math symbol for <b>greater than</b> is:</p>
<p class='larger'><b>></b></p>
</article>
<article>
<h3>
Logic: Greater Than
</h3>
<p>Try the code below in IRB:</p>
<pre>> tweet = "I'm writing my first program with Ruby Robot at the <br>Intro to Ruby workshop!"</pre>
<pre>=> "I'm writing my first program with Ruby Robot at the <br>Intro to Ruby workshop!"</pre>
<section class='build'>
<pre>> tweet.length > 140</pre><pre>=> false</pre>
<pre>> tweet.length > 10</pre><pre>=> true</pre>
</section>
</article>
<article id='greater-less-than'>
<style>
#greater-less-than .large-font { margin: 150px 0px; }
#greater-less-than .larger { font-size: 150px; margin-left: 300px; }
</style>
<h3>
Logic: Less Than
</h3>
<p class='large-font'>The math symbol for <b>less than</b> is:</p>
<p class='larger'><b><</b></p>
</article>
<article>
<h3>
Logic: Less Than
</h3>
<p>Try the code below in IRB:</p>
<pre>> tweet = "I'm writing my first program with Ruby Robot at the <br>Intro to Ruby workshop!"</pre>
<pre>=> "I'm writing my first program with Ruby Robot at the <br>Intro to Ruby workshop!"</pre>
<section class='build'>
<pre>> tweet.length < 140</pre><pre>=> true</pre>
<pre>> tweet.length < 10</pre><pre>=> false</pre>
</section>
</article>
<article id='conditional-logic'>
<h3>
Logic in Our Simple Twitter
</h3>
<p class='large-font'>Let's simplify our if statements.</p>
<p class='large-font'>Remember that we're storing the user's tweet in the variable tweet.</p>
</article>
<article id='conditional-simplify'>
<style>
#conditional-simplify p { margin: 50px 0px; }
</style>
<h3>
Logic in Our Simple Twitter
</h3>
<p>Original if statements:</p>
<p>if the tweet is greater than 140 characters, tell the user that they cannot send their tweet</p>
<p>if the tweet is less than 140 characters, tell the user that they can send their tweet</p>
<p />
<div class='build'>
<p>if tweet.length > 140 puts "Your tweet is too long!"</p>
<p>if tweet.length < 140 puts "Tweet your heart out!"</p>
</div>
</article>
<article>
<h3>
Try it out!
</h3>
<p>
Replace the puts statements in your Twitter program with the code below.
(see answers/twitter_3.rb if needed)
</p>
<section>
<pre>if tweet.length > 140<br> puts "Your tweet is too long!"<br>end<br><br>if tweet.length < 140<br> puts "Tweet your heart out!"<br>end</pre>
</section>
</article>
<article id='dr-seuss'>
<style>
#dr-seuss .large-font { color: #006363; margin-top: 75px; }
</style>
<h3>
Try Your Program With Some Tweets
</h3>
<p>Try your new program with this tweet:</p>
<p class='large-font'>
You have brains in your head. You have feet in your shoes. You can steer yourself, any direction you choose.
</p>
</article>
<article id='dr-seuss'>
<h3>
Try Your Program With Some Tweets
</h3>
<p>Try your new program with this tweet:</p>
<p class='large-font'>
You'll get mixed up, of course, as you already know. You'll get mixed up with many strange birds as you go. So be sure when you step. Step with care and great tact and remember that Life's a Great Balancing Act. Just never forget to be dexterous and deft. And never mix up your right foot with your left.
</p>
</article>
<article id='dr-seuss'>
<h3>
Try Your Program With Some Tweets
</h3>
<p>Try your new program with this tweet:</p>
<p class='large-font'>
My alphabet starts with this letter called yuzz. It's the letter I use to spell yuzz-a-ma-tuzz.
</p>
</article>
<article id='dr-seuss'>
<h3>
Try Your Program With Some Tweets
</h3>
<p>Try your new program with this tweet:</p>
<p class='large-font'>
Oh the places you'll go! There is fun to be done! The magical things you can do with that ball, will make you the winning-est winner of all.
</p>
</article>
<article id='conditional-instructions'>
<h3>
Your First Bug!
</h3>
<p class='large-font'>What if your tweet is <b>exactly 140 characters</b>?</p>
<p class='large-font'>Our program skips this possibility.</p>
</article>
<article id='greater-less-than'>
<style>
#greater-less-than .large-font { margin: 150px 0px; }
#greater-less-than .larger { font-size: 150px; margin-left: 300px; }
</style>
<h3>
Logic: Equality
</h3>
<p class='large-font'>The symbol for <b>equality</b> is:</p>
<p class='larger'><b>==</b></p>
</article>
<article>
<h3>
Logic: Equality
</h3>
<pre>> tweet = "Oh the places you'll go! There is fun to be done!<br>The magical things you can do with that ball, will make you the<br>winning-est winner of all."</pre>
<pre>=> "Oh the places you'll go! There is fun to be done!<br>The magical things you can do with that ball, will make you the<br>winning-est winner of all."</pre>
<section class='build'>
<pre>> tweet.length</pre><pre>=> 140</pre>
<pre>> tweet.length == 140</pre><pre>=> true</pre>
</section>
</article>
<article>
<h3>
Fix Your Bug!
</h3>
<p>Add this last if statement to the bottom of your file: (Or, use answers/twitter_4.rb)</p>
<section>
<pre>if tweet.length == 140<br> puts "Tweet your heart out!"<br>end</pre>
</section>
<p class='large-font'>
The == operator checks that the value of the objects on either side of it are equal.
</p>
</article>
<article id='dr-seuss'>
<h3>
Test Your Fix
</h3>
<p>Now try running your program with the tweet:</p>
<p class='large-font'>
Oh the places you'll go! There is fun to be done! The magical things you can do with that ball, will make you the winning-est winner of all.
</p>
</article>
<article id='worksheet-fun'>
<h3>
More Fun With Logic
</h3>
<p class='large-font'>Find your <b>Logic</b> sheet, and try playing with each of the instructions.</p>
</article>
<article>
<h3>Hello, Operator?</h3>
<table>
<tr><td>Operator</td><td>True</td><td>False</td></tr>
<tr>
<td>==</td>
<td>99 == 99</td>
<td>99 == 100</td>
</tr>
<tr>
<td>!=</td>
<td>99 != 100</td>
<td>99 != 99</td>
</tr>
<tr>
<td>></td>
<td>100 > 99</td>
<td>99 > 100</td>
</tr>
<tr>
<td><</td>
<td>99 < 100</td>
<td>100 < 99</td>
</tr>
<tr>
<td>>=</td>
<td>99 >= 99</td>
<td>99 >= 100</td>
</tr>
<tr>
<td><=</td>
<td>99 <= 99</td>
<td>100 <= 99</td>
</tr>
</table>
</article>
<article id='new-operators'>
<style>
#new-operators .large-font { margin: 20px 0 80px 0; text-align: center; font-size: 125px; }
#new-operators p { font-size: 40px; }
</style>
<h3>
Many Ways To Compare Objects!
</h3>
<p>Which new operators did you find in your logic worksheet?</p>
<div class='build'>
<p class='large-font' style='color:#ff9700'>>=</p>
<p class='large-font' style='color:#4671d5'><=</p>
<p class='large-font' style='color:#26972D'>!=</p>
</div>
</article>
<article id='new-operators-twitter'>
<style>
#new-operators-twitter .large-font { margin: 75px 0; }
</style>
<h3>
Improve Your Twitter Program!
</h3>
<p class='large-font'>Can you use these new operators to make your Twitter program <b>shorter</b>?</p>
<p class='large-font'>You can remove an <b>if</b> statement by using one of the new operators.</p>
<p>See answers/twitter_5.rb for answers.</p>
</article>
<article id='logic-action'>
<style>
#logic-action .large-font { margin: 75px 0; }
</style>
<h3>
Logic In Action!
</h3>
<p class='large-font'>Let's run the program <b>colours.rb</b> together.</p>
<pre>ruby colours.rb</pre>
</article>
<article id='logic-on-your-own'>
<style>
#logic-on-your-own .build { margin-top: 40px; }
</style>
<h3>
Your Own Logic Program
</h3>
<p>We're going to make our own logic program in the file <b>birthday.rb</b>.</p>
<p>Our program will ...</p>
<div class='build'>
<p>1. Ask which month you're born in. - <b>puts</b></p>
<p>2. Save the user input with a sticky note with "<b>birthday</b>" on it, without \n. - <b>gets</b>, <b>chomp</b></p>
<p>3. Output something different for each possible month. - <b>if</b>, <b>puts</b>, <b>==</b></p>
<p>(answers in answers/birthday_answer.rb, but don't look!)</p>
</div>
</article>
<article id='thank-you'>
<style>
#thank-you .large-font { text-align: center; margin: 60px 0; }
#thank-you .thank-you { font-size: 50px; }
</style>
<h3>
Thank You!
</h3>
<p class='large-font'>A big thank you to the organizers and mentors for their effort and dedication.</p>
<p class='large-font'>Another big thank you to Ladies Learning Code for inspiring the content for this workshop.</p>
<p class='large-font thank-you' style='color:#006363'>The biggest thank you to all of you for spending the day learning to code!</p>
</article>
</section>
</body>
</html>