Skip to content

Instantly share code, notes, and snippets.

View kfontes's full-sized avatar

Kellie Fontes kfontes

View GitHub Profile
@kfontes
kfontes / race.css
Created March 3, 2015 07:55
Webpage for the Turtle and Rabbit race
body {
background: #efefef;
text-align: center;
}
header {
max-width: 40em;
margin: auto;
}
@kfontes
kfontes / Outline
Last active August 29, 2015 14:15
medium.com
1. Medium
1. Untitled Section
1. Staff picks
2. Culture
3. Humor
4. Tech
5. Design
6. This Happened
7. I.M.H.O
8. Long Reads
@kfontes
kfontes / race
Created February 12, 2015 07:30
Enter 'Sandra' the snake, who will make crossing the finish line for either competitor a little more difficult.
<script>
//This version of the race introduces a new animal - 'Sandra', the garter snake. The turtle and rabbit are too big to be brought down by the snake, but a bite can still do damage. The snake will strike when it is at the same position as either of the competitors. Since Sandra is not a true competitor the race will not be deemed complete if she is the first to cross the finish line.
var Animal = function(name, speed, distance) {
this.name = name;
this.speed = speed;
this.distance = distance;
this.position = 0;
this.report = function(){
@kfontes
kfontes / guessinggame
Created February 12, 2015 00:25
Code review of the Guessing Game assignment
<script>
/*The following is a guessing game where a user will be asked to guess a number between 1 and 10, which the computer will randomly generate beforehand*/
var play = prompt("Welcome to the game! You will need to correctly guess the randomly selected number between 1 and 10 in order to win. Enter in 'Yes' if you want to play or 'No' to exit.");
if (play.toLowerCase() == "yes"){
var number = Math.floor(Math.random() * 10); //Generates the random number
var answer = prompt("Great! Guess the number the computer has selected. Your options are from 1 to 10.");
//Analyzing answer to see if it matches number