Skip to content

Instantly share code, notes, and snippets.

View patio11's full-sized avatar

Patrick McKenzie patio11

View GitHub Profile
def open_flash_chart(height, width, data_url, div_name = nil)
options = {}
options[:height] = height
options[:width] = width
options[:swf_file_name] = "flash/open-flash-chart.swf"
options[:div_name] = div_name unless div_name.nil?
open_flash_chart_object_from_hash(data_url, options)
end
#This solves the maze using regular expressions, because I am too
#lazy to worry about arrays, darn it. It is inefficient as heck and designed
#purely to demonstrate perversion of sound CS principals.
#
# Code by Patrick McKenzie, 2010. I release this work unto the public domain.
class Maze
def initialize(maze_string)
@width = maze_string.split("\n")[0].length #width of maze in characters
@guts = maze_string.gsub("\n", "") #maze as a flat string -- no newlines
hoge = "これは例である。"
puts hoge[1]