View heyo.rb
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
heyo = 'heyo'.scan(/./) | |
heyo.each do |c1| | |
(heyo-[c1]).each do |c2| | |
(heyo-[c1, c2]).each do |c3| | |
(heyo-[c1, c2, c3]).each do |c4| | |
puts "#{c1} #{c2} #{c3} #{c4}" | |
end | |
end | |
end |
View heyo.py
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
heyo = set(['h', 'e', 'y', 'o']) | |
for c1 in heyo: | |
for c2 in (heyo - set([c1])): | |
for c3 in (heyo - set([c1, c2])): | |
for c4 in (heyo - set([c1, c2, c3])): | |
print (" ".join([c1, c2, c3, c4])) |
View wires.txt
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
wire_a: 956 | |
wire_aa: 221 | |
wire_ab: 1021 | |
wire_ac: 84 | |
wire_ad: 65451 | |
wire_ae: 937 | |
wire_af: 2025 | |
wire_ag: 680 | |
wire_ah: 64855 | |
wire_ai: 1345 |
View circuits3.rb
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 | |
class Circuit | |
def initialize(doc) | |
@doc = doc.split("\n").map(&:strip) | |
program = create(@doc) | |
File.open('program.rb', 'w'){|f| f.puts program} | |
puts | |
eval(program.join("\n")) | |
end |
View circuits2.rb
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 | |
class Circuit | |
def initialize(doc) | |
@doc = doc.split("\n").map(&:strip) | |
program = create(@doc) | |
File.open('program.rb', 'w'){|f| f.puts program} | |
puts | |
eval(program.join("\n")) | |
end |
View circuits.rb
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 | |
class Circuit | |
def initialize(doc) | |
@doc = doc.split("\n").map(&:strip) | |
program = create(@doc) | |
eval(program.join("\n")) | |
end | |
def create(doc) |
View Static variables in CoffeeScript
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
class MapGenerator | |
@tileSize: 20 # width and height of a tile | |
# should this be a power of 2 for WebGL TilingSprite? | |
@tile: | |
floor: 0 # clear floor that objects can move through | |
wall: 1 # wall, creating an obstacle | |
deadspace: -1 | |
constructor: (width, height) -> |