This file contains hidden or 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
STATE_CHOPPING_FRONT = 0 | |
#STATE_ITERATING_END = 1 | |
STATE_CHOPPING_END = 2 | |
STATE_FINISHED = 3 | |
def strip(array) | |
state = STATE_CHOPPING_FRONT | |
loop do | |
if state == STATE_CHOPPING_FRONT then | |
if array[0].white_space? |
This file contains hidden or 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>Bubble Gum Game</TITLE> | |
<SCRIPT type="text/javascript"> | |
//<![CDATA | |
function bubble() | |
{ | |
var answer = Math.floor(Math.random()*21); | |
var guess = parseInt(prompt("How many blows before this bubble bursts?")); |
This file contains hidden or 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>JQuery Homework</TITLE> | |
<SCRIPT type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></SCRIPT> | |
<SCRIPT type="text/javascript"> | |
var x = parseFloat(prompt("Please give me a number.")) | |
var y = parseFloat(prompt("Please give me a number.")) | |
var z = parseFloat(prompt("Please give me a number.")) |
This file contains hidden or 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
<!-- | |
Write a program that accepts three numbers from the user | |
and alerts back the the user: the sum of the numbers, | |
the total of the numbers multiplied together, the average | |
of the numbers, and, for extra credit, figure out how to | |
find the largest number and smallest number. | |
--> | |
<!DOCTYPE HTML> | |
<HTML> |
This file contains hidden or 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
// Written by Rachel Myers as a introduction to test-first javascript development. | |
// Inspired by and very nearly lifted from Jim Weirich's Ruby Koans, which are awesome. | |
// Replace the nulls to make the specs pass and reach javascript enlightenment. | |
describe('Strings', function () { | |
// Creating Strings | |
it('should create a new string with either single or double quotes', function() { |
This file contains hidden or 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
// Written by Rachel Myers as a introduction to test-first javascript development. | |
// Inspired by and very nearly lifted from Jim Weirich's Ruby Koans, which are awesome. | |
describe("Strings", function() { | |
describe("Creating Strings", function() { | |
var double_quote_string; | |
var single_quote_string; | |
var talking_string; | |
var apostrophe_string; |
This file contains hidden or 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
def substring(haystack, needle) | |
i = 0 | |
while i <= haystack.length | |
if haystack[i,(needle.length)] == needle | |
return i | |
else | |
i += 1 | |
end | |
if i == haystack.length | |
return nil |
NewerOlder