Something went wrong. Try again.
Code for the Advent of Code event
aoc advent-of-code
Something went wrong. Try again.
258 B · 16 lines
Ruby
at rust
1234567891011121314151617#!/usr/bin/env ruby# frozen_string_literal: true
$position = $depth = $depth2 = 0
def forward(n) $position += n $depth2 += $depth * nend
def down(n) = $depth += ndef up(n) = $depth -= n
eval ARGF.read
puts $position * $depth, $position * $depth2