mirror of
https://github.com/onyx-and-iris/aoc2025.git
synced 2026-04-08 19:13:37 +00:00
upd
This commit is contained in:
@@ -13,7 +13,7 @@ class Main
|
||||
when "R"
|
||||
current = (current + magnitude) % 100
|
||||
when "L"
|
||||
current = (current -= magnitude) % 100
|
||||
current = (current - magnitude) % 100
|
||||
end
|
||||
|
||||
if current == 0
|
||||
|
||||
@@ -9,7 +9,7 @@ class Main
|
||||
$stdin.each_line do |line|
|
||||
direction, magnitude = line[0], line[1..].to_i
|
||||
|
||||
while magnitude > 0
|
||||
magnitude.times do
|
||||
case direction
|
||||
when "R"
|
||||
current = (current + 1) % 100
|
||||
@@ -20,8 +20,6 @@ class Main
|
||||
if current == 0
|
||||
count += 1
|
||||
end
|
||||
|
||||
magnitude -= 1
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user