Skip to content

Instantly share code, notes, and snippets.

View luketlancaster's full-sized avatar
🤷‍♂️
🤷🏻‍♂️

Luke Lancaster luketlancaster

🤷‍♂️
🤷🏻‍♂️
View GitHub Profile
@luketlancaster
luketlancaster / battleship.py
Last active September 15, 2015 21:58
Battleship game made through CodeAcademy
from random import randint
board = []
for x in range(5):
board.append(["O"] * 5)
def print_board(board):
for row in board:
print " ".join(row)
@luketlancaster
luketlancaster / fizzbuzz.cpp
Created July 11, 2015 20:33
FizzBuzz c++
int a = 0;
void setup() {
Serial.begin(9600);
Serial.println("FizzBuzz:");
}
void loop() {
if (a % 15 == 0)
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 + "!"
#############################################################################
# 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
@luketlancaster
luketlancaster / bashprofile
Created January 24, 2015 18:56
Bash Profile for MBP
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
alias ll='ls -l'
alias ~='cd ~'
alias b='cd ..'
@luketlancaster
luketlancaster / game.js
Last active August 29, 2015 14:13 — forked from sscotth/game.js
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;