Compare commits

..

No commits in common. "65934bcaa07f824aef79b35cb33c417c586c4740" and "f073b701761d10b4525de9cd42049e4f618a8982" have entirely different histories.

3 changed files with 3 additions and 57 deletions

View File

@ -1,53 +0,0 @@
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
json (2.8.2)
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
parallel (1.26.3)
parser (3.3.6.0)
ast (~> 2.4.1)
racc
racc (1.8.1)
rainbow (3.1.1)
regexp_parser (2.9.2)
rubocop (1.68.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.36.1)
parser (>= 3.3.1.0)
rubocop-performance (1.22.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (1.13.0)
standard (1.42.1)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.68.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.5)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.5.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.22.0)
unicode-display_width (2.6.0)
PLATFORMS
ruby
x86_64-linux
DEPENDENCIES
standard (~> 1.31)
BUNDLED WITH
2.5.22

View File

@ -1,5 +1,4 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
class Main
def run

View File

@ -1,5 +1,4 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
class Main
def run
@ -9,12 +8,12 @@ class Main
$stdin.each_line do |line|
direction, magnitude = line[0], line[1..].to_i
while magnitude > 0
loop do
case direction
when "R"
current = (current + 1) % 100
when "L"
current = (current - 1 + 100) % 100
current = (current - 1) % 100
end
if current == 0
@ -22,6 +21,7 @@ class Main
end
magnitude -= 1
break if magnitude == 0
end
end