mirror of
https://github.com/onyx-and-iris/aoc2025.git
synced 2025-12-07 22:57:50 +00:00
upd
This commit is contained in:
parent
65934bcaa0
commit
c0152a39b2
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user