I really don't want to sleep (it's 3:12 a.m.), I want to work on hangman, but the responsible thing to do is to get some rest, so I'm going to do that, then I'll start on hangman in the morning.
Good night, I'll make an effort to write more in the blog, since I've been so busy with coding I haven't been blogging as much.
Here's a forEach loop from class:
zooAnimals.forEach(function(n){
console.log(n);
})
Having fun today. We made a paper, rock, scissors game in class today:
<!DOCTYPE html>
<html>
<head>
<title>Rock Paper Scissors Part 1</title>
</head>
<body>
<p>Press r, p, or s to start playing</p>
<div id="game">
</div>
<script type="text/javascript">
// Create an array that lists out all of the options
var options = ['r','p','s'];
var wins = 0;
var losses = 0;
var ties = 0;
var html =
"<p>wins: " + wins + "</p>" +
"<p>losses: " + losses + "</p>" +
"<p>ties: " + ties + "</p>";
document.querySelector("#game").innerHTML = html;
// Captures Key Clicks
document.onkeyup = function(event) {
// Determines which exact key was selected. Make it lowercase
var userGuess = String.fromCharCode(event.keyCode).toLowerCase();
// Alerts with user guess
alert(userGuess);
// Create code to randomly choose one of the three options (Computer)
var computerGuess = options[Math.floor(Math.random()*options.length)];
// Alerts with Computer guess
alert(computerGuess);
function updateScore() {
var html =
"<p>wins: " + wins + "</p>" +
"<p>losses: " + losses + "</p>" +
"<p>ties: " + ties + "</p>";
document.querySelector("#game").innerHTML = html;
}
var compare = function(choice1, choice2) {
if (choice1 === choice2) {
ties++;
updateScore();
return("The result is a tie!");
}
else if(choice1 === "r") {
if(choice2 === "s") {
wins++;
updateScore();
return("You win!");
}
else {
losses++;
updateScore();
return("Computer wins");
}
}
else if(choice1 === "p") {
if(choice2 === "r") {
wins++;
updateScore();
return("You win!");
}
else {
losses++;
updateScore();
return("Computer wins");
}
}
else if(choice1 === "s") {
if(choice2 === "r") {
losses++;
updateScore();
return("Computer wins");
}
else {
wins++;
updateScore();
return("You win!");
}
}
};
console.log(compare(userGuess, computerGuess));
}
</script>
</body>
</html>
That was fun.
I started work on the Hangman project also, check out a screenshot:
So I'll be trying to complete the Hangman project tomorrow, so I can learn about React.
SUMMARY OF CODING SKILLS
Books: Status
"Head First HTML and CSS," by E. Robson & E. Freeman Complete
"Head First HTML and CSS," by E. Robson & E. Freeman Complete
"A Smarter Way to Learn JavaScript," by Mark Myers Complete
"HTML and CSS," by Jon Duckett Complete
"JavaScript and JQuery," by Jon Duckett Complete
Team Treehouse (Front End Web Dev Track Complete): Status
How to Make a Website Complete
HTML Complete
HTML Forms Complete
HTML Tables Complete
HTML Video and Audio Complete
CSS Foundations Complete
CSS Basics Complete
CSS Layout Techniques Complete
CSS Layout Basics Complete
CSS Selectors Complete
Responsive Layouts Complete
CSS Flexbox Layout Complete
Framework Basics (Bootstrap and Foundation) Complete
Framework Basics (Bootstrap and Foundation) Complete
Git Basics Complete
Console Foundations Complete
Introduction to Programming Complete
JavaScript Basics Complete
JavaScript Loops, Arrays, & Objects Complete
AJAX Basics Complete
JQuery Basics Complete
Interactive Web Pages With JavaScript Complete
Object-Oriented JavaScript Complete
Accessibility Complete
Website Optimization Complete
Front End Performance Optimization Complete
Aesthetic Foundations Complete
Design Foundations Complete
Adobe Photoshop Foundations Complete
Adobe Illustrator Foundations 66% Complete
Other Courses: Status
HTML and CSS (Codecademy) Complete
Introduction to Web Dev (The Odin Project) Complete
Web Dev 101 (The Odin Project) 33% Complete
Free Code Camp (FCC) Status
1. Get Started with Free Code Camp Complete
2. HTML5 and CSS Complete
3. Responsive Design with Bootstrap Complete
4. Gear up for Success Complete
5. jQuery Complete
6. Basic Front End Development Projects Complete
7. Basic JavaScript Complete
8. Object Oriented and Functional Programming Complete
9. Basic Algorithm Scripting Complete
10. JSON API's and Ajax Complete
11. Intermediate Front End Development Projects Complete
5. jQuery Complete
6. Basic Front End Development Projects Complete
7. Basic JavaScript Complete
8. Object Oriented and Functional Programming Complete
9. Basic Algorithm Scripting Complete
10. JSON API's and Ajax Complete
11. Intermediate Front End Development Projects Complete
12. Intermediate Algorithm Scripting Complete
13. Advanced Front End Development Projects Complete
14. Claim Your Front End Development Certificate Complete
The Coding Boot Camp at UT Austin Status (starts 4/19/2016)
Week 1-6: Mastering the Browser (HTML, CSS, JavaScript, JQuery) In Progress
Week 7-10: API & JSON (RESTful API"s, parsing JSON, AJAX)
Week 11-14: Server Side (Node.js, MySQL, MongoDB)
Week 15-18: PHP (WordPress, CodeIgniter, Laravel)
Week 18-21: Full Stack Coding
Week 22-24: Final Project
My Web Dev Portfolio: www.adamcamacho.com
CodePen Projects: http://codepen.io/Adancode/
Week 22-24: Final Project
My Web Dev Portfolio: www.adamcamacho.com
CodePen Projects: http://codepen.io/Adancode/
GitHub Projects: https://github.com/Adancode
LinkedIn Profile: https://www.linkedin.com/in/adamcamacho1
Team Treehouse Profile: https://teamtreehouse.com/adamcamacho
Free Code Camp Profile: http://www.freecodecamp.com/adancode
Team Treehouse Profile: https://teamtreehouse.com/adamcamacho
Free Code Camp Profile: http://www.freecodecamp.com/adancode
Hours Spent Coding Today: 6
Total Hours Coding: 1,244
No comments:
Post a Comment