Skip to content

Commit 8bfdab9

Browse files
committed
comment out some unused functions
1 parent 6d19b64 commit 8bfdab9

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

manifest.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
packages = [
55
{ name = "birl", version = "1.8.0", build_tools = ["gleam"], requirements = ["gleam_regexp", "gleam_stdlib", "ranger"], otp_app = "birl", source = "hex", outer_checksum = "2AC7BA26F998E3DFADDB657148BD5DDFE966958AD4D6D6957DD0D22E5B56C400" },
66
{ name = "envoy", version = "1.0.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "envoy", source = "hex", outer_checksum = "95FD059345AA982E89A0B6E2A3BF1CF43E17A7048DCD85B5B65D3B9E4E39D359" },
7-
{ name = "filepath", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "filepath", source = "hex", outer_checksum = "67A6D15FB39EEB69DD31F8C145BB5A421790581BD6AA14B33D64D5A55DBD6587" },
7+
{ name = "filepath", version = "1.1.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "filepath", source = "hex", outer_checksum = "B06A9AF0BF10E51401D64B98E4B627F1D2E48C154967DA7AF4D0914780A6D40A" },
88
{ name = "gleam_deque", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_deque", source = "hex", outer_checksum = "64D77068931338CF0D0CB5D37522C3E3CCA7CB7D6C5BACB41648B519CC0133C7" },
9-
{ name = "gleam_erlang", version = "0.33.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "A1D26B80F01901B59AABEE3475DD4C18D27D58FA5C897D922FCB9B099749C064" },
10-
{ name = "gleam_otp", version = "0.16.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "FA0EB761339749B4E82D63016C6A18C4E6662DA05BAB6F1346F9AF2E679E301A" },
11-
{ name = "gleam_regexp", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_regexp", source = "hex", outer_checksum = "A3655FDD288571E90EE9C4009B719FEF59FA16AFCDF3952A76A125AF23CF1592" },
12-
{ name = "gleam_stdlib", version = "0.52.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "50703862DF26453B277688FFCDBE9DD4AC45B3BD9742C0B370DB62BC1629A07D" },
9+
{ name = "gleam_erlang", version = "0.34.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "0C38F2A128BAA0CEF17C3000BD2097EB80634E239CE31A86400C4416A5D0FDCC" },
10+
{ name = "gleam_otp", version = "0.16.1", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "50DA1539FC8E8FA09924EB36A67A2BBB0AD6B27BCDED5A7EF627057CF69D035E" },
11+
{ name = "gleam_regexp", version = "1.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_regexp", source = "hex", outer_checksum = "9C215C6CA84A5B35BB934A9B61A9A306EC743153BE2B0425A0D032E477B062A9" },
12+
{ name = "gleam_stdlib", version = "0.60.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "621D600BB134BC239CB2537630899817B1A42E60A1D46C5E9F3FAE39F88C800B" },
1313
{ name = "gleam_yielder", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_yielder", source = "hex", outer_checksum = "8E4E4ECFA7982859F430C57F549200C7749823C106759F4A19A78AEA6687717A" },
14-
{ name = "gleeunit", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "F7A7228925D3EE7D0813C922E062BFD6D7E9310F0BEE585D3A42F3307E3CFD13" },
14+
{ name = "gleeunit", version = "1.4.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "12A8A2B510D7063547CD73AE5345544AE92124247A82F46B05F5B0913EE28BC8" },
1515
{ name = "ranger", version = "1.4.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "gleam_yielder"], otp_app = "ranger", source = "hex", outer_checksum = "C8988E8F8CDBD3E7F4D8F2E663EF76490390899C2B2885A6432E942495B3E854" },
16-
{ name = "simplifile", version = "2.2.0", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "0DFABEF7DC7A9E2FF4BB27B108034E60C81BEBFCB7AB816B9E7E18ED4503ACD8" },
16+
{ name = "simplifile", version = "2.2.1", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "C88E0EE2D509F6D86EB55161D631657675AA7684DAB83822F7E59EB93D9A60E3" },
1717
]
1818

1919
[requirements]

src/day14/solution.gleam

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -147,35 +147,35 @@ fn print_robot_map(rlist: List(Robot), x_size: Int, y_size: Int) {
147147
// At first I went thousands and thousands of iterations looking for symmetry
148148
// thinking it would be centered, but it was not. Eventually I decided to check
149149
// the reddit, so I did not come up with the no overlap idea.
150-
fn step_and_check_overlap(
151-
rlist: List(Robot),
152-
x_size: Int,
153-
y_size: Int,
154-
v: Int,
155-
// ) -> List(Robot) {
156-
) -> Int {
157-
let rnext = list.map(rlist, fn(r) { step(r, x_size, y_size) })
150+
// fn step_and_check_overlap(
151+
// rlist: List(Robot),
152+
// x_size: Int,
153+
// y_size: Int,
154+
// v: Int,
155+
// // ) -> List(Robot) {
156+
// ) -> Int {
157+
// let rnext = list.map(rlist, fn(r) { step(r, x_size, y_size) })
158158

159-
// case left_right_symmetry(rnext, x_size, y_size) {
160-
case no_overlaps(rnext) {
161-
True -> v + 1
162-
_ -> step_and_check_overlap(rnext, x_size, y_size, v + 1)
163-
}
164-
}
159+
// // case left_right_symmetry(rnext, x_size, y_size) {
160+
// case no_overlaps(rnext) {
161+
// True -> v + 1
162+
// _ -> step_and_check_overlap(rnext, x_size, y_size, v + 1)
163+
// }
164+
// }
165165

166-
fn no_overlaps(rlist: List(Robot)) -> Bool {
167-
rlist
168-
|> list.fold(dict.new(), fn(rpos, r) {
169-
dict.upsert(rpos, r.p, fn(existing) {
170-
case existing {
171-
Some(v) -> v + 1
172-
_ -> 1
173-
}
174-
})
175-
})
176-
|> dict.values()
177-
|> list.all(fn(v) { v == 1 })
178-
}
166+
// fn no_overlaps(rlist: List(Robot)) -> Bool {
167+
// rlist
168+
// |> list.fold(dict.new(), fn(rpos, r) {
169+
// dict.upsert(rpos, r.p, fn(existing) {
170+
// case existing {
171+
// Some(v) -> v + 1
172+
// _ -> 1
173+
// }
174+
// })
175+
// })
176+
// |> dict.values()
177+
// |> list.all(fn(v) { v == 1 })
178+
// }
179179

180180
// However later I came up with an idea based on shapefinders to find vertical
181181
// and horizontal edges of structure based on scanning through robot counts in

0 commit comments

Comments
 (0)