Skip to content

Commit 2da359d

Browse files
update todo
1 parent 2b70a2f commit 2da359d

File tree

2 files changed

+5
-38
lines changed

2 files changed

+5
-38
lines changed

2024/ruby/.rubocop_todo.yml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,3 @@ Metrics/BlockLength:
2121
# Configuration parameters: CountComments, CountAsOne.
2222
Metrics/ClassLength:
2323
Max: 120
24-
25-
# Offense count: 2
26-
# Configuration parameters: EnforcedStyle, AllowedPatterns.
27-
# SupportedStyles: snake_case, camelCase
28-
Naming/MethodName:
29-
Exclude:
30-
- 'lib/advent_04_ceres_search.rb'
31-
- 'test.rb'
32-
33-
# Offense count: 2
34-
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
35-
# SupportedStyles: snake_case, normalcase, non_integer
36-
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
37-
Naming/VariableNumber:
38-
Exclude:
39-
- 'lib/advent_04_ceres_search.rb'
40-
41-
# Offense count: 4
42-
# Configuration parameters: AllowedConstants.
43-
Style/Documentation:
44-
Exclude:
45-
- 'spec/**/*'
46-
- 'test/**/*'
47-
- 'lib/advent_01_hystorian_hysteria.rb'
48-
- 'lib/advent_02_red_nosed_reports.rb'
49-
- 'lib/advent_03_mull_it_over.rb'
50-
- 'lib/advent_04_ceres_search.rb'

2024/ruby/lib/advent_04_ceres_search.rb

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ def match?(str)
7676
def cross_word_at?(row, col)
7777
cross_word = "MAS"
7878

79-
diag_1 = letter_at(row - 1, col - 1) + letter_at(row, col) + letter_at(row + 1, col + 1)
80-
diag_2 = letter_at(row + 1, col - 1) + letter_at(row, col) + letter_at(row - 1, col + 1)
79+
diag1 = letter_at(row - 1, col - 1) + letter_at(row, col) + letter_at(row + 1, col + 1)
80+
diag2 = letter_at(row + 1, col - 1) + letter_at(row, col) + letter_at(row - 1, col + 1)
8181

82-
diag_1_match = [cross_word, cross_word.reverse].any? { |str| str == diag_1 }
83-
diag_2_match = [cross_word, cross_word.reverse].any? { |str| str == diag_2 }
82+
diag1_match = [cross_word, cross_word.reverse].any? { |str| str == diag1 }
83+
diag2_match = [cross_word, cross_word.reverse].any? { |str| str == diag2 }
8484

85-
diag_1_match && diag_2_match
85+
diag1_match && diag2_match
8686
end
8787

8888
def cross_word_count
@@ -147,9 +147,3 @@ def render
147147
end
148148
end
149149
end
150-
151-
def badName
152-
return unless something
153-
154-
test
155-
end

0 commit comments

Comments
 (0)