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> | |
Deck of Cards | |
</title> | |
<style> | |
body { | |
font-family: arial; | |
} |
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
<script> | |
var random, result; | |
var findDifference = function(answer, guess) { | |
if (answer > guess) { | |
return answer - guess; | |
} | |
else { | |
return guess - answer; | |
} | |
} |
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
<script> | |
var usa, ghana, portugal, germany, miles; | |
function Racer(name, speed, intelligence, luck) { | |
this.name = name; | |
this.speed = speed; | |
this.intelligence = intelligence; | |
this.luck = luck; | |
this.position = 0; | |
this.race = 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
<script> | |
function Deck() { | |
this.cards = []; | |
this.count = function() { | |
return this.cards.length; | |
} | |
this.init = function() { | |
for (s = 1; s <= 4; s++) { | |
for (r = 1; r <= 13; r++) { | |
this.cards.push(new Card(r, s)); |
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> | |
Deck of Cards | |
</title> | |
</head> | |
<body> | |
<ul id="deck" class="collection"> | |
</ul> |
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>JavaScript & jQuery - Chapter 7: Introducing jQuery - Looping</title> | |
<link rel="stylesheet" href="css/c07.css" /> | |
</head> | |
<body> | |
<div id="page"> | |
<h1 id="header">List</h1> | |
<h2>Buy groceries</h2> |
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> | |
Deck of Cards | |
</title> | |
<style> | |
#deck { | |
width: 52em; | |
background-color: purple; |
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> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | |
</head> | |
<body> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.min.js"></script> |
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
function serve { | |
port="${1:-4000}" | |
ruby -r webrick -e "s = WEBrick::HTTPServer.new(:Port => $port, :DocumentRoot => Dir.pwd); trap('INT') { s.shutdown }; s.start" | |
} |
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
class BinarySearchTree | |
constructor: () -> | |
@val = null | |
@size = 0 | |
@right = null | |
@left = null | |
insert: (val) -> | |
if @val == val |
OlderNewer