- samfrons.com
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
var attacker = prompt("What\'s the easiest assailant to fend off- a NARWHAL with a cane, a SHRUB with gun, or a MONK in a funk? ").toUpperCase(); | |
switch(attacker) { | |
case 'NARWHAL': | |
var strong = prompt("How courageous! Are you strong (YES or NO)?").toUpperCase(); | |
var smart = prompt("Are you smart?").toUpperCase(); | |
if(strong === 'YES' || smart === 'YES') { | |
console.log("You only need one of the two! You beat the troll--nice work!"); | |
} else { | |
console.log("You're not strong OR smart? Well, if you were smarter, you probably wouldn't have tried to fight a troll. You lose!"); | |
} |
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
net = require('net') | |
Array.prototype.remove = (element) -> | |
for e, i in this when e is element | |
return this.splice(i, 1) | |
class Client | |
constructor: (stream) -> | |
@stream = stream | |
@name = null |
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
var http = require("http"); | |
sys = require('sys'); | |
var server = http.createServer(function(request,response) { | |
request.addListener('end' , function () { | |
response.writeHead(200, { | |
"Content-Type": "text/plain" | |
}); | |
response.write(sys.inspect(request)); |