This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ADINA: This structure works but a constructor object would help you avoid repeating code. It would look something like this: | |
// var questions = []; | |
// function question(question, answers, correctAnswer) { | |
// this.question = question; | |
// this.answers = answers; | |
// this.correctAnswer = correctAnswer; | |
// questions.push(this); | |
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
var globalCount = 0; | |
var RED = 0; | |
var PURPLE = 0; | |
var GREEN = 0; | |
var CLEAR = 0; | |
// ADINA: Why start WINS and LOSSES at 1? | |
var WINS = 1; | |
var LOSSES = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Crystal Collector HW</title> | |
<link rel="stylesheet" type="text/css" href="assets/css/crystal.css"> | |
<link rel="stylesheet" type="text/css" href="crystal.css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ADINA: In order to avoid repeating this code, you could use a function like this: | |
// function crystalNumber() { | |
// return Math.floor((Math.random() * 12) + 1); | |
// } | |
// function targetScore() { | |
// return Math.floor((Math.random() * 120) + 19); | |
// } | |
// var crystals = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ADINA: | |
// First, a couple notes on your index.html: | |
// The layout looks good but it might be nice to see everything on one screen (now I have to scroll down to see the crystals). | |
// The problem with linking to your js script file was that this linke: | |
// <script type="text/javascript" src="assets/javascript/game.js"></script> | |
// should always be placed directly before your closing </body> tag. This is because of the order in which the page loads. | |
$("#startButton").on("click", function() { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SETUP: | |
# 1. sudo chmod +x push_unsolved_activites.sh | |
# 2. Change 'activities' and 'classDir' paths to correspond to full path of local directories. | |
# 3. Run the script from the directory where it is located: ./push_unsolved_activities.sh 06-ajax | |
if [[ -z "$1" ]]; then | |
echo "Please pass in the week name. Ex: 10-nodejs" | |
exit 1 | |
else | |
week=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SETUP: | |
# 1. sudo chmod +ox push_unsolved_activites.sh | |
# 2. Change 'activities' and 'classDir' paths to correspond to local directories. | |
# 3. Run the script from the directory where it is located: ./push_unsolved_activities.sh 06-ajax | |
if [[ -z "$1" ]]; then | |
echo "Please pass in the week name. Ex: 10-nodejs" | |
exit 1 | |
else | |
week=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ADINA: I noticed you have categories with a name, words, and hint which you have to keep track of by juggling the index of a bunch of different arrays. This is a great opportunity to use a constructor function, which would look like this: | |
// | |
// function category( words, hint ) { | |
// this.words = words; | |
// this.hint = hint; | |
// } | |
// var Films = new category( ["the-matrix", "scarface", "wonder-woman", "finding-dory", "zootopia"], ["Neo", "Cocaine, guns, and a whole lotta swearing", "Feminist superhero", "Ellen's film about a forgetful fish", "Disney's animal cops"] ); | |
// Then you could simply use Films.words to get your array of words, or Films.hint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var yourGuesses = []; | |
var possibleWords = ["tiki", "sunscreen", "umbrella", "surf", "beach", "sun", "rum"]; | |
var gameWins = 0; | |
var secretWord = possibleWords[gameWins]; | |
var letterCount = secretWord.length; | |
var mysteryDisplay = ""; | |
var wordArray = secretWord.split(""); | |
var displayArray = []; | |
var lives = 8; | |
var images = ["TikiMan1H6.png", "TikiMan1H5.png", "TikiMan1H4.png", "TikiMan1H3.png", "TikiMan1H2.png", "TikiMan1H1.png", "TikiMan1H0.png", "TikiMan1HB.png"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.getElementById('instructions').innerHTML = 'Press any key to get started!'; | |
var hangmanWords = ['blender', 'oven', 'stove', 'refrigerator', 'microwave', 'table', 'utensils', 'dishwasher', 'sink']; | |
var word = ''; | |
var wrongChar = []; | |
var rightChar = []; | |
var rightCharIndex = []; | |
var triesLeft = 0; |