This commit is contained in:
onyx-and-iris 2025-12-01 21:18:05 +00:00
parent 65934bcaa0
commit c0152a39b2
2 changed files with 2 additions and 4 deletions

View File

@ -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

View File

@ -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