This file contains 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
rake routes | |
Prefix Verb URI Pattern Controller#Action | |
decks_sim GET /decks/sim(.:format) decks#sim | |
decks GET /decks(.:format) decks#index | |
POST /decks(.:format) decks#create | |
new_deck GET /decks/new(.:format) decks#new | |
edit_deck GET /decks/:id/edit(.:format) decks#edit | |
deck GET /decks/:id(.:format) decks#show | |
PATCH /decks/:id(.:format) decks#update | |
PUT /decks/:id(.:format) decks#update |
This file contains 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
Started PATCH "/decks/8" for ::1 at 2015-02-14 11:47:19 +0000 | |
Processing by DecksController#update as HTML | |
Parameters: {"utf8"=>"✓", "authenticity_token"=>"Xspb+SDnJoX1v+oOVHn7s42b2m34qtRajUJkwCPKgDxXkGT8wMepySokziI8Rqpceh0YuegNvBQfInc2RtCzYA==", "deck"=>{"name"=>"HH", "cards"=>"Headless Horseman,Headless Horseman,Headless Horseman,Headless Horseman,Headless Horseman,Headless Horseman,Headless Horseman,Headless Horseman,Headless Horseman,Headless Horseman", "runes"=>"Nimble Soul, Arctic Freeze,Leaf,Tsunami", "demon_name"=>"SeaKing"}, "commit"=>"Update Deck", "id"=>"8"} | |
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]] | |
Deck Load (0.3ms) SELECT "decks".* FROM "decks" WHERE "decks"."id" = ? LIMIT 1 [["id", 8]] | |
Unpermitted parameter: demon_name | |
(0.1ms) begin transaction | |
(0.1ms) commit transaction | |
Redirected to http://localhost:3000/decks/8 | |
Completed 302 Found in 122ms (ActiveRecord: 0.9ms) |
This file contains 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
#!/usr/bin/ruby | |
require 'pp' | |
$rows | |
$cols | |
class Sokoban | |
attr_accessor :crates, :empty_storage, :filled_storage, :playing_grid, :crate_id, :man_id, :wall_id, :floor_id, | |
:storage_id, :crate_on_storage_id, :man_on_storage_id, :symbols, :workman, :move_coords | |
This file contains 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
def play | |
puts "Welcome to Sokoban! The aim of the game is to put all of the crates, which are the \'" + @crate_id + "\' symbols onto the storage pallets, which are the \'" + @storage_id + "\' symbols! A list of all the symbols is available if you type \"help\", and the status of the game is available if you type \"status\"." | |
status() | |
loop do | |
input = gets.chomp() | |
pp input | |
case input.downcase! | |
when "help" | |
help() | |
when "move" |
This file contains 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
def move(direction) #Returns what the new coords would be, Sokoban.handle_move then checks if these are valid | |
pp @coordinates | |
case direction.downcase! | |
when "up" | |
move_up() | |
when "down" | |
move_down() | |
when "right" | |
move_right() | |
when "left" |
This file contains 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'gosu' | |
require 'pp' | |
class GameWindow < Gosu::Window | |
def initialize | |
super 640, 480, false |
This file contains 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'gosu' | |
require 'pp' | |
class GameWindow < Gosu::Window | |
attr_accessor :bullets, :stars |
This file contains 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
#!/usr/bin/env ruby | |
require 'gosu' | |
require 'pp' | |
class GameWindow < Gosu::Window | |
attr_reader :tilemap | |
def initialize |
This file contains 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
#!/usr/bin/env ruby | |
require 'gosu' | |
require 'pp' | |
class GameWindow < Gosu::Window | |
attr_reader :tilemap | |
def initialize |
This file contains 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
#!/usr/bin/env ruby | |
require 'gosu' | |
require 'pp' | |
class GameWindow < Gosu::Window | |
attr_reader :tilemap | |
def initialize |
OlderNewer