This commit is contained in:
2025-12-01 08:34:02 -08:00
parent 517dede130
commit 064dc676cd
5 changed files with 4066 additions and 1 deletions

1
2025/.tool-versions Normal file
View File

@@ -0,0 +1 @@
ruby 3.4.7

25
2025/01.rb Normal file
View File

@@ -0,0 +1,25 @@
input = File.readlines('input/01')
pos = 50
p1 = 0
p2 = 0
input.each do |line|
dir = line[0]
n = line[1..].to_i
(1..n).each do
if dir == 'R'
pos = (pos - 1 + 100) % 100
else
pos = (pos + 1) % 100
end
if pos.zero?
p2 += 1
end
end
if pos.zero?
p1 += 1
end
end
puts p1
puts p2

3
2025/README.md Normal file
View File

@@ -0,0 +1,3 @@
# 2025
Ruby 3.4.7

4036
2025/input/01 Normal file

File diff suppressed because it is too large Load Diff