You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
advent-of-code/2023/ruby/day_15.rb

13 lines
186 B

input = ARGF.read.strip.split(?,).map(&:chars)
# part one
p input.sum {|str|
current = 0
str.each do |c|
current += c.ord
current *= 17
current %= 256
end
current
}