Skip to content

Instantly share code, notes, and snippets.

View Sephi-Chan's full-sized avatar

Romain Tribes Sephi-Chan

  • Nîmes, France
View GitHub Profile
class Location
attr_reader :x, :y
def self.find_available_location
begin
location = Location.new(rand(1..10), rand(1..10))
end until location.empty?
location
end
module Attacker
def attack(target)
end
end
module Attacker
def attack(target)
end
end
require 'spec_helper'
describe CharacterAttacksAnotherCharacter do
before do
@luke = stub
@vader = stub
@attack = CharacterAttacksAnotherCharacter.new(@luke, @vader)
end
describe "constructor" do
module Attacker
# def attack(foo)
# end
end
module Attacker
def attack(foo)
end
end
@Sephi-Chan
Sephi-Chan / dci_experiment.rb
Created February 1, 2012 14:55
DCI experimentation
class AttacksController
def create
attacker = current_users.characters.find(params[:attacker_id])
target = Character.find_by_x_and_y(params[:x], params[:y])
attack = CharacterAttacksAnotherCharacter.new(attacker, target)
attack.execute!
end
end
require "rubygems"
require "sinatra"
require "oauth2"
get "/" do
haml :index
end
window.BadgeView = Backbone.View.extend
model: Territory
tagName: "li"
events:
"click" : "handleClick"
initialize: ->
@model.bind("change:unitsCount", @unitsCountChanged, @)
.badges {
li {
width: 32px;
height: 32px;
text-align: center;
line-height: 34px;
font-size: 12px;
background: black;
border-radius: 50%;
border: 2px solid #333;