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
puts "Hello, What's your name?" | |
name = gets.chomp.upcase | |
# Loop through each letter in their name and grammar it. | |
for letter in name.split("") do | |
if letter == "A" or letter == "E" or letter == "F" or letter == "H" or letter == "I" or letter == "L" or letter == "M" or letter == "N" or letter == "O" or letter == "R" or letter == "S" or letter == "X" | |
article = "an" | |
else | |
article = "a" | |
end | |
puts "Give me "+ article + "... " + letter + "!" |
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
############################################################################# | |
# https://github.com/github/gitignore/blob/master/Global/Archives.gitignore # | |
############################################################################# | |
# It's better to unpack these files and commit the raw source because | |
# git has its own built in compression methods. | |
*.7z | |
*.jar | |
*.rar | |
*.zip | |
*.gz |
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
function Game(numberOfPlayers){ | |
this.weapons = []; | |
this.weapons.push(new Weapon({name: 'Sword', damage: 0.2, ammo: Infinity})); | |
this.weapons.push(new Weapon({name: 'Shotgun', damage: 0.6, ammo: 1})); | |
this.weapons.push(new Weapon({name: 'Fist', damage: 0.05, ammo: Infinity})); | |
this.players = []; | |
for (var i=0; i < numberOfPlayers; i++){ | |
var player = new Player; |