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
### Keybase proof | |
I hereby claim: | |
* I am mgates on github. | |
* I am mgates (https://keybase.io/mgates) on keybase. | |
* I have a public key ASCV7FBXzr9moaH-DaMuR1r37ah3laWozCoc7I5GXxkbhQo | |
To claim this, I am signing this object: |
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
digraph euclid { | |
"I-1" -> "po-3" | |
"I-1" -> "po-1" | |
"I-1" -> "de-15" | |
"I-1" -> "cn-1" | |
"I-2" -> "po-1" | |
"I-2" -> "po-2" | |
"I-2" -> "po-3" | |
"I-2" -> "cn-3" |
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 Thing | |
def do_it_all(input) | |
opts = [] | |
[0,1,2,3,4].permutation.each do |perms| | |
out = 0 | |
#puts perms.inspect | |
(0..4).each do |amp| | |
inp = [perms[amp], out] | |
#puts inp.inspect | |
out = do_it(inp, input) |
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
require "set" | |
class Thing | |
def paint_it(nums) | |
@painted = {} | |
@blarf = Set.new | |
@dir = :up | |
@loc = [0,0] | |
@first_panel = true | |
@last_out = :direction | |
do_it([], nums, [], "foo") |
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 Thing | |
def game(nums) | |
@screen = {} | |
nums[0] = 2 | |
do_it([], nums, [], :foo) | |
end | |
def par_mode(par, is_addr, nums, pos, offset) | |
if is_addr | |
nums[pos + offset] |
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
require 'set' | |
class Blerg | |
# test | |
# x repeat is 2028 | |
# y repeat is 5898 | |
# z repeat is 4702 | |
# | |
# Actual | |
# x repeat is |
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
require 'set' | |
class Ug | |
def foo(input) | |
astroids = Set.new | |
input.lines.map(&:chomp).each_with_index do |line, x| | |
line.chars.each_with_index do |char, y| | |
astroids << [y,x] if char == "#" | |
end | |
end | |
counts = {} |
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 Blarg | |
def ug(input) | |
layer = input.chars.each_slice(25*6).min_by{|l| l.count("0") } | |
puts layer.inspect | |
puts layer.count("1") * layer.count("2") | |
end | |
def blerg(input) | |
output = Array(25 * 6) | |
input.chars.each_slice(25*6).to_a.reverse.each do |layer| |
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 Thing | |
def do_it_all(input) | |
opts = [] | |
[0,1,2,3,4].permutation.each do |perms| | |
out = 0 | |
#puts perms.inspect | |
(0..4).each do |amp| | |
inp = [perms[amp], out] | |
#puts inp.inspect | |
out = do_it(inp, input) |
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 Orbits | |
def do_it(lines) | |
@orbits = lines.lines.map(&:chomp).map {|s| s.split(")")} | |
total = 0 | |
@orbits.map(&:first).each do |o| | |
total += count_orbits(0, o) | |
end | |
puts total | |
end | |
def count_orbits(count, orbit) |
NewerOlder