Skip to content

Instantly share code, notes, and snippets.

View anitahall102790's full-sized avatar

Anita H anitahall102790

View GitHub Profile
@anitahall102790
anitahall102790 / Array For Loops If Else
Created December 8, 2015 15:21
Search Text for your Name
var text = "Anita, Anita, Anita, Anita, Anita, Anita,Anita,Anita,Anita,";
var myName = "Anita";
var hits = [];
for (i=0; i<text.length; i++) {
if (text[i] === 'A') {
for( j = i; j < (myName.length + i) ; j++){
hits.push(text[j]);
}
}
@anitahall102790
anitahall102790 / Hello Angular
Created December 8, 2015 14:47
First Angular Page
<DOCTYPE html>
<html ng-app>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<body>
<h1>{{hello}}</h1>
<input type="text" ng-model="hello"
</body>
<script type="text/javascript"
@anitahall102790
anitahall102790 / Rock,Paper, Scissors
Created December 7, 2015 19:55
Javascript Rock, Paper, Scissors game
var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice < 0.34) {
computerChoice = "rock";
} else if(computerChoice <= 0.67) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
} console.log("Computer: " + computerChoice);
@anitahall102790
anitahall102790 / Javascript Lesson One Project
Last active December 3, 2015 18:05
Justin Bieber "Game"
// Check if the user is ready to play!
confirm("I am ready to play!");
var age = prompt("What's your age?");
if (age < 13) {
console.log("You are able to play but I am not responsible if you are traumatized")
}
else {
console.log("Lets Play!")
@anitahall102790
anitahall102790 / Javascript Basics 1
Created December 2, 2015 18:47
Summary of Javascript Lesson1
// I learned about the different data types
var myName = "this is a string";
var myNumber = 25;
var myBoolean = (false, 5>4)
//I learned how to output on the console
console.log("myName".length);
// I learned how to check the length of strings and manipulate the variables in different ways
//Modulo