Skip to content

Instantly share code, notes, and snippets.

View Spitigala's full-sized avatar

Sahan Pitigala Spitigala

View GitHub Profile
@Spitigala
Spitigala / jsracer.js
Last active August 29, 2015 14:04
A browser-based JS racing game - To run the game please download the entire repo at https://github.com/Spitigala/javascript-racer
$(document).ready(function() {
prepareGame();
function prepareGame() {
var cellCount = 20;
var board = new drawBoard(cellCount);
var player1 = new Player('Player1');
var player2 = new Player('Player2');
startGame(cellCount, player1, player2);
@Spitigala
Spitigala / 0_reuse_code.js
Created May 7, 2014 13:35
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
class BoggleBoard
def initialize(board)
@board = board
end
def create_word(*coords)
coords.map { |coord| @board[coord.first][coord.last]}.join("")
end