ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
itjsbagg410
1. Build a Guessing GameBuild a Guessing Game
with JavaScriptwith JavaScript
April 2018
codepen.iocodepen.io
1
2. About us
Kati Long
Thinkful Event Host
Thinkful Student
Sean Jun
Web Developer, Intel
Thinkful Grad
Shu Sia
Web Developer, Carvana
Thinkful TA
2
3. About you
What's your name?
What brought you here today?
What is your programming experience?
Wi : MakeOf ces 5Ghz
Password: Internet!23
http://bit.ly/js-game-dc
3
4. About Thinkful
We train developers and data scientists through
1x1 mentorship and project-based learning.
Guaranteed.
4
5. This is what we're making
View example here
Wi : MakeOf ces 5Ghz
Password: Internet!23
http://bit.ly/js-game-dc
5
6. De ning a variable with JavaScript
var numberOfSheep = 20var numberOfSheep = 20
Initialize variable
Name of variable
Value of variable
http://bit.ly/tf-js-game-atlhttp://bit.ly/js-game-dc
Wi : MakeOf ces 5Ghz
Password: Internet!23
http://bit.ly/js-game-dc
6
8. Declaring a function with JavaScript
function greet() {function greet() {
return "Hello world!"; return "Hello world!";
}}
Initialize function Name of function
What the function does
Wi-Fi: IgniteHQ
Password: igniteHQ
http://bit.ly/tf-js-game-atlWi : MakeOf ces 5Ghz
Password: Internet!23 8
http://bit.ly/js-game-dc
10. If/else statements
go to gas stationkeep driving
if false if true
need gas?
family roadtrip
Wi : MakeOf ces 5Ghz
Password: Internet!23
http://bit.ly/js-game-dc
10
11. If/else statements
function familyRoadtrip() {
if (needGas == true) {
getGas();
}
else {
keepDriving();
}
}
http://bit.ly/tf-js-game-atlhttp://bit.ly/js-game-dc
Wi : MakeOf ces 5Ghz
Password: Internet!23
http://bit.ly/js-game-dc
11
13. If/else statements and comparing values
Wi : MakeOf ces 5Ghz
Password: Internet!23
http://bit.ly/js-game-dc
13
14. Parameters within functions
function adder(a, b) {function adder(a, b) {
return a + b; return a + b;
}}
adder(1,2);adder(1,2);
Parameters in declaration
Parameters used
within the function
Wi : MakeOf ces 5Ghz
Password: Internet!23
http://bit.ly/js-game-dc
14
15. Examples of parameters within functions
Wi : MakeOf ces 5Ghz
Password: Internet!23
http://bit.ly/js-game-dc
15
16. Real developers use Google... a lot
Wi : MakeOf ces 5Ghz
Password: Internet!23
http://bit.ly/js-game-dc
16
17. Glitch setup & rst steps!
Wi : MakeOf ces 5Ghz
Password: Internet!23
http://bit.ly/js-game-dc
http://bit.ly/tf-guessing-game
17
20. Thinkful's Free Course
Access to four weeks of curriculum for
two weeks
HTML, CSS and JavaScript
Unlimited mentor-led Q&A sessions
Personal Program Manager
Option to continue on to the full
program at a prorated rate!
bit.ly/web-dev-freebit.ly/web-dev-free
20