-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathslides-en.html
More file actions
783 lines (611 loc) · 24.1 KB
/
slides-en.html
File metadata and controls
783 lines (611 loc) · 24.1 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Canada Learning Code</title>
<link rel="stylesheet" href="framework/css/slideshow.css" data-noprefix>
<link rel="stylesheet" href="framework/css/fonts.css" data-noprefix>
<link rel="stylesheet" href="framework/css/highlightjs/github.css" data-noprefix>
<link rel="stylesheet" href="framework/css/styles.css" data-noprefix>
<link rel="shortcut icon" href="framework/img/favicon.ico">
<!-- Takes care of CSS3 prefixes -->
<script src="framework/scripts/prefixfree.min.js"></script>
<!-- opens all links in a new window -->
<base target="_blank">
</head>
<!-- Timer/progress bar: Define the presentation duration using "data-duration" in minutes. -->
<body class="en" data-duration="360">
<main>
<!--Slide 1-->
<section class="slide welcome highlight">
<h1><img class="logo-stacked" src="framework/img/glc-logo-stacked-white.png" alt="Ladies Learning Code logo">Welcome!</h1>
<div class="instructions">
<!-- ADD WIFI INFO HERE -->
<h2>Get <br>Connected</h2>
<p><strong>Wifi:</strong> wifi network</p>
<p><strong>Password:</strong> wifi password</p>
<hr>
</div>
<footer>
<a class="left" rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/"><img alt="Creative Commons License" src="framework/img/cc-by-nc.png" /></a>
<p class="left">Slides created by <a href="http://christinatruong.com">Christina Truong</a>. Content created by Kassandra Lenters for <a prefix="cc: http://creativecommons.org/ns#" href="http://ladieslearningcode.com" property="cc:attributionName" rel="cc:attributionURL">Ladies Learning Code</a></p>
<p class="right">Use the left <span class="arrow">←</span> and right <span class="arrow">→</span> arrow keys to navigate</p>
</footer>
</section>
<!--Slide 2-->
<section class="slide intro">
<img class="logo" src="framework/img/glc-logo-white.png" alt="Ladies Learning Code logo">
<h1 class="heading-bg">
<span>Programming<br>
with Ruby</span>
</h1>
<ul>
<li><a href="http://twitter.com/learningcode">@learningcode</a></li>
<li><a href="https://twitter.com/search?q=%23girlslearningcode&src=typd">#girlslearningcode</a></li>
</ul>
<!--<div class="sponsor">
<p>In partnership with<br> <img src="framework/img/telus-logo-white.svg" alt="Telus"></p>
</div>-->
<footer>
<a class="left" rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/"><img alt="Creative Commons License" src="framework/img/cc-by-nc.png" /></a>
<p class="left">Slides created by <a href="http://christinatruong.com">Christina Truong</a>. Content created by Kassandra Lenters for <a prefix="cc: http://creativecommons.org/ns#" href="http://ladieslearningcode.com" property="cc:attributionName" rel="cc:attributionURL">Ladies Learning Code</a></p>
<p class="right">Use the left <span class="arrow">←</span> and right <span class="arrow">→</span> arrow keys to navigate</p>
</footer>
</section>
<!--Slide 3-->
<section class="slide title" data-markdown>
<script type="text/template">
#Introductions
</script>
</section>
<!--Slide 4-->
<section class="slide" data-markdown>
<script type="text/template">
# Table of Contents
<div class="table-of-contents"></div>
<!-- Intro + Example Projects + Guest Speaker (10am)
Project Ideation + Wireframing (10:15am)
Intro to HTML + CSS (10:45am)
Lunch (12:30pm)
Building time! (1:15pm)
Demos + Pushing Live (3:30pm) -->
</script>
</section>
<!--Slide 5-->
<!-- Insert Agenda for the workshop -->
<section class= "slide" data-markdown>
<script type="text/template">
#Agenda
Intro to Programming
Coding in Ruby
Break
Choose-Your-Own-Adventure <!--Insert activity name here-->
</script>
</section>
<!--Slide 6-->
<section class="slide centered" data-markdown>
<script type="text/template">

## 1. ASK FOR HELP <!-- .element: class="delayed" -->
## 2. BE PRESENT <!-- .element: class="delayed" -->
## 3. TRY YOUR BEST! <!-- .element: class="delayed" -->
</script>
</section>
<!--Slide 7-->
<section class="slide title" data-toc data-markdown>
<script type="text/template">
# What is Code?
</script>
</section>
<!--Slide 8-->
<section class="slide" data-markdown>
<script type= "text/template">
#Code is..
## A SET OF INSTRUCTIONS THAT TELLS THE COMPUTER WHAT TO DO.
<br>






<p> In code, we call a set of instructions an <strong style="color:#8b31e0;">algorithm</strong>.</p><!-- .element: class="delayed" -->
</script>
</section>
<!--Slide 9-->
<section class="slide title" data-markdown>
<script type="text/template">
# Today's Project
## We're learning how to create games and puzzles using Ruby
</script>
</section>
<!--Slide 10-->
<section class="slide centered" data-markdown>
<script type="text/template">
#Choose-Your-Own-Adventure <!--Insert activity name here-->

<!--replace gif as needed-->
<br>
---
<div class="dropdown">
<button class="dropbtn">Attributions</button>
<div class="dropdown-content">
<a href="http://giphy.com/gifs/happy-celebration-yay-9EVZWCxypKQxi">Adventure Time Gif</a>
</div>
</script>
</section>
<!--Slide 11-->
<section class="slide" data-markdown>
<script type="text/template">
#Example Project
Example: <a href="https://repl.it/F6uN/7">https://repl.it/F6uN/7</a>
<!--Insert link to example project-->
</script>
</section>
<!--Slide 12-->
<section class="slide title" data-toc data-markdown>
<script type="text/template">
# What is Ruby?
</script>
</section>
<!--Slide 13-->
<section class="slide centered" data-markdown>
<script type="text/template">
# Ruby is a Programming Language
<br>

---
<div class="dropdown">
<button class="dropbtn">Attributions</button>
<div class="dropdown-content">
<a href="https://commons.wikimedia.org/wiki/File:Ruby_logo.svg">Ruby image</a>
</div>
</script>
</section>
<!--Slide 14-->
<section class="slide two-col-list" data-markdown>
<script type="text/template">
#RUBY
* When we code in Ruby, it's like text messaging Ruby Robot
* We type our code into the INPUT and Ruby's response shows in the OUTPUT<!-- .element: class="delayed" -->
* We need to speak to Ruby using words that she understands<!-- .element: class="delayed" -->
* 
---
<div class="dropdown">
<button class="dropbtn">Attributions</button>
<div class="dropdown-content">
<a href="https://pixabay.com/en/message-chat-communication-symbol-42929/">Speech Bubble image</a>
</div>
</script>
</section>
<!--Slide 15-->
<section class="slide title" data-toc data-markdown>
<script type="text/template">
#LET'S GET CODING!
</script>
</section>
<!--Slide 16-->
<section class="slide centered" data-markdown>
<script type="text/template">
#Texting with Ruby
##Go to [repl.it](https://repl.it).
##Click on "Log in" (top corner).

</script>
</section>
<!--Slide 17-->
<section class="slide centered" data-markdown>
<script type="text/template">
# Create a New Project
##Select 'ruby' as the language

</script>
</section>
<!--Slide 18-->
<section class="slide" data-markdown>
<script type="text/template">
# Say Hello!
```ruby
puts "Hello World" #Says Hello (this is a comment)
```

</script>
</section>
<!--Slide 19-->
<section class="slide" data-markdown>
<script type="text/template">
#String a Sentence Together
What we call <strong>words</strong>, Ruby calls <strong>strings</strong>.
We type <strong>strings</strong> in "quotations."

</script>
</section>
<!--Slide 20-->
<section class="slide" data-markdown>
<script type="text/template">
#Number Savvy
What we call <strong>numbers</strong>, Ruby calls <strong>integers</strong>.
These are whole numbers (without decimals).

---
<div class="dropdown">
<button class="dropbtn">Attributions</button>
<div class="dropdown-content">
<a href="http://giphy.com/gifs/count-sings-thecount-YGAQAfXtiLqCs">Sesame Street Gif</a>
</div>
</script>
</section>
<!--Slide 21-->
<section class="slide" data-markdown>
<script type="text/template">
# Math Whiz
Ask Ruby some math questions using <strong>operators</strong>!
```ruby
puts 5 + 10 #Adding
puts 5 * 10 #Multiplying
puts 10 / 5 #Dividing
puts 10 - 5 #Subtracting
```

---
<div class="dropdown">
<button class="dropbtn">Attributions</button>
<div class="dropdown-content">
<a href="http://giphy.com/gifs/uofcalifornia-code-java-calculator-3o85xFdBA27p6TJWgM">Calculator Gif</a>
</div>
</script>
</section>
<!--Slide 22-->
<section class="slide" data-markdown>
<script type="text/template">
#Mystery Box
A <strong>variable</strong> is like a box! It stores information for us.
We can store <strong>strings</strong> or <strong>integers</strong> inside of <strong>variables</strong>.

---
<div class="dropdown">
<button class="dropbtn">Attributions</button>
<div class="dropdown-content">
<a href="https://pixabay.com/en/box-open-cardboard-box-cardboard-152428/">Box image</a>
</div>
</script>
</section>
<!--Slide 23-->
<section class="slide" data-markdown>
<script type="text/template">
#Stay Sharp!
Define box as an integer.
* Jump box times<!-- .element: class="delayed" -->
* Wave box times<!-- .element: class="delayed" -->
* Clap box times<!-- .element: class="delayed" -->
Define box as a string.<!-- .element: class="delayed" -->
* Say "My favourite ice cream is box"<!-- .element: class="delayed" -->
* Say "Tell box I found the box that was missing last box"<!-- .element: class="delayed" -->
</script>
</section>
<!--Slide 24-->
<section class="slide two-col-list" data-markdown>
<script type="text/template">
# Create a variable
* Make a variable called `hi`
```ruby
hi = "Wasssup" #Set the variable 'hi' to whatever you want!
puts hi
```
* 
---
<div class="dropdown">
<button class="dropbtn">Attributions</button>
<div class="dropdown-content">
<a href="https://github.com/twitter/twemoji">Waving hand emoji</a>
</div>
</script>
</section>
<!--Slide 25-->
<section class="slide" data-markdown>
<script type="text/template">
# Ask a Question
Ask the user a question:
```ruby
hi = "Wasssup"
puts "What is your name?" #Ask for the user's name
name = gets.chomp #Get answer
puts hi + " " + name #Say hello to the user
```

---
<div class="dropdown">
<button class="dropbtn">Attributions</button>
<div class="dropdown-content">
<a href="https://commons.wikimedia.org/wiki/File:Lol_question_mark.png">Question Mark image</a>
</div>
</script>
</section>
<!--
<section class="slide" data-markdown>
<script type="text/template">
# Which One?
We need to tell Ruby how we want the answer to behave:
* ... like a <strong>string</strong>? Switch using ```.to_s```
* ... like an <strong>integer</strong>? Switch using ```.to_i```
```ruby
puts "What is your age?" #Ask for age
age = gets.chomp #Get answer
age = age.to_i #Switch age to an integer
age = age + 5 #Add 5 to age
age = age.to_s #Switch age to a string
puts "In five years you will be " + age
```
</script>
</section>
-->
<!--Slide 26-->
<section class="slide" data-markdown>
<script type="text/template">
# Loops
##For example...
```ruby
5.times do #Loop the program 5 times
jazz_hands
end #End the loop
puts "That's all, folks!"
```
</script>
</section>
<!--Slide 27-->
<section class="slide" data-markdown>
<script type="text/template">
#Conditionals
<strong>Conditionals</strong> are either <strong>true</strong> or <strong>false</strong>.
<strong>IF</strong> it is a school day... wake up at 7:00.
<strong>ELSE</strong>... sleep in.
<p style="color:#8b31e0">Create your own!</p><!-- .element: class="delayed" -->
<p style="color:#8b31e0">IF ... </p><!-- .element: class="delayed" -->
<p style="color:#8b31e0">ELSE ... </p><!-- .element: class="delayed" -->
</script>
</section>
<!--Slide 28-->
<section class="slide" data-markdown>
<script type="text/template">
# Create a Condition
Write an IF statement:
```ruby
puts "What is your name?"
name = gets.chomp.downcase #Get answer and make all letters lowercase
if name == "bob" #Make a condition for IF the answer is bob
puts "WHAAAAT! We have the same name!" #Say something if this is TRUE
end
```

* But what if the user enters something else?<!-- .element: class="delayed" -->
---
<div class="dropdown">
<button class="dropbtn">Attributions</button>
<div class="dropdown-content">
<a href="http://giphy.com/gifs/dark-thread-after-lCP95tGSbMmWI">Minion Gif</a>
</div>
</script>
</section>
<!--Slide 29-->
<section class="slide" data-markdown>
<script type="text/template">
# Booleans
Ask if something is TRUE or FALSE using these operators:
```
< less than
> greater than
<= less than or equal to
>= greater than or equal to
== equal to
```
For Example:
```ruby
number = 5 #Defining the variable 'number'
number < 2 #Checking if number is less than 2
```
</script>
</section>
<!--Slide 30-->
<section class="slide" data-markdown>
<script type="text/template">
# Create a Condition
We need to think of EVERYTHING:
```ruby
if #Create condition 1
#Put result here
else
#Put result here
end
```
OR
```ruby
if #Create condition 1
#Put result here
elsif #Create condition 2
#Put result here
else
#Put result here
end
```
</script>
</section>
<!--
<section class="slide" data-markdown>
<script type="text/template">
# Guessing Game: Challenge
* Choose a number (create a new variable)
* Ask the user to guess
* Get their answer
* Switch their answer to an integer
* Create an IF condition if they guess too low
* Create an ELSIF condition if they guess too high
* Create an ELSE condition for the correct guess (only other option)
* End your IF, ELSE statement
</script>
</section>
<section class="slide" data-markdown>
<script type="text/template">
# Guessing Game: Solution
Create an IF statement:
```ruby
number = 3 #Choose number
puts "Guess a number between 1 and 10" #Ask user to guess
guess = gets.chomp #Get answer
guess = guess.to_i #Switch guess to an integer
if guess < number #Create condition for lower guess
puts "too small!"
elsif guess > number #Create condition for higher guess
puts "too big!"
else #Create condition for the correct guess (only other option)
puts "just right"
end
```
</script>
</section>
<section class="slide" data-markdown>
<script type="text/template">
# Guessing Game: Random Number
Replace:
```ruby
number = rand 1..10
```
Chooses a random number between 1 and 10

-
<div class="dropdown">
<button class="dropbtn">Attributions</button>
<div class="dropdown-content">
<a href="http://tsaoshin.deviantart.com/art/Part-of-Your-No-388260981">Part of Your No by TsaoShin</a>
</div>
</script>
</section>
<section class="slide" data-markdown>
<script type="text/template">
# Guessing Game: Loop
```ruby
number = rand 1..10 #Keep this at the top
10.times do #Loop the program for 10 rounds
puts "Guess a number between 1 and 10"
guess = gets.chomp
guess = guess.to_i
if guess < number
puts "too small!"
elsif guess > number
puts "too big!"
else
puts "just right"
break #Break the loop when they guess correctly
end
end #End the loop
puts "Game Over" #Tell the user when the game is over
```
</script>
</section>
-->
<!--Slide 31-->
<section class="slide title" data-markdown>
<script type="text/template">
#MAIN PROJECT
</script>
</section>
<!--Slide 32-->
<section class="slide" data-markdown>
<script type="text/template">
#Choose-Your-Own-Adventure<!--insert activity title here-->
Getting Started:<!--insert steps below-->
```ruby
puts "Once upon a time.." #Set up the story
sleep 2 #Add a pause
puts "Do you go left or right?" #Ask a question with two options: A or B
answer = gets.chomp.downcase #Get the answer
if answer.include? "right" #If they choose A (Use 'include' to look for key words)
puts "You turn right, then.."
elsif answer.include? "left" #If they choose B
puts "You turn left, then.."
end
```
*Modification: Create a Fork of this starter code instead of typing it out: [http://bit.ly/ruby-adventure-starter](http://bit.ly/ruby-adventure-starter)*
</script>
</section>
<!--Slide 33-->
<section class="slide" data-markdown>
<script type="text/template">
#Choose-Your-Own-Adventure <!--insert activity title here-->
<!--replace image as needed-->
</script>
</section>
<!--Slide 34-->
<section class="slide" data-markdown>
<script type="text/template">
#Choose-Your-Own-Adventure<!--insert activity title here-->
Keep adding to your story.
Starter code: [http://bit.ly/ruby-adventure-starter](http://bit.ly/ruby-adventure-starter)*
```ruby
puts "Once upon a time.."
sleep 2
puts "Do you go left or right?"
answer = gets.chomp.downcase
if answer.include? "right"
puts "You turn right, then.."
#Paste the starter code here to continue your story
elsif answer.include? "left"
puts "You turn left, then.."
#Paste the starter code here to continue your story
end
```
</script>
</section>
<!--Slide 35-->
<section class="slide title" data-markdown>
<script type="text/template">
#DEMOS
</script>
</section>
<main>
<!--Slide 36-->
<section class="slide" data-toc data-markdown>
<script type="text/template">
# Today I Learned...
<p><strong>I can</strong> create algorithms in Ruby</p><!-- .element: class="delayed" -->
<p><strong>I can</strong> use variables to store information</p><!-- .element: class="delayed" -->
<p><strong>I can</strong> use if statements to control what happens in my program</p><!-- .element: class="delayed" -->
<p><strong>I can</strong> use loops to make things happen more than once</p><!-- .element: class="delayed" -->
<p><strong>I can</strong> use Ruby to KEEP CODING!</p><!-- .element: class="delayed" -->
</script>
</section>
<!-- Last slide -->
<section class="slide last">
<h1>Thank you!</h1>
<h2 class="heading-bg">
<span>Programming<br> with Ruby</span>
</h2>
<ul>
<li><a href="http://twitter.com/learningcode">@learningcode</a></li>
<li><a href="https://twitter.com/search?q=%23girlslearningcode&src=typd">#girlslearningcode</a></li>
</ul>
<p class="attribution">Slide presentation created by <a href="http://christinatruong.com">Christina Truong</a> based on <a href="https://github.com/LeaVerou/csss">Lea Verou's SlideShow</a> and <a href="http://lab.hakim.se/reveal-js/">reveal.js</a>.</p>
</section>
</main><!-- cls main section -->
<script src="framework/scripts/jquery-1.11.0.min.js"></script>
<script src="framework/scripts/slideshow.js"></script>
<!-- Uncomment the plugins you need -->
<script src="framework/scripts/plugins/css-edit.js"></script>
<script src="framework/scripts/plugins/css-snippets.js"></script>
<script src="framework/scripts/plugins/css-controls.js"></script>
<!-- <script src="plugins/code-highlight.js"></script>-->
<script src="framework/scripts/plugins/markdown/marked.js"></script>
<script src="framework/scripts/plugins/markdown/markdown.js"></script>
<script src="framework/scripts/plugins/highlight/highlight-8.4.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="framework/scripts/llc.js"></script>
<script>
var slideshow = new SlideShow();
// Grabs all the .snippet elements
var snippets = document.querySelectorAll('.snippet');
for(var i=0; i<snippets.length; i++) {
new CSSSnippet(snippets[i]);
}
</script>
</body>
</html>