AdventOfCode
1.0.0
该存储库包含我使用常见的LISP对代码难题出现的实现。并不是说我为分享它们而感到自豪,这更像是我玩得开心,我可能会通过公开此代码来学习新技巧。
我打算玩这款游戏的是要玩得开心,并迅速做拼图。我不会在这里扩展有关编程最佳实践的任何严肃的事情,因此它大多会表现出我自己的反射和习惯。否则它不再有趣了,是吗?
我准备了一些工具,以在此处输出拼图计时和结果的摘要,以供有兴趣的读者快速概述。我的打算是将其保持为每天再次运行的数据。
我正在为这些黑客使用Clozure Common LISP版本1.12-DEV DARWINX8664,众所周知,SBCL可能会增强结果,或者在其他情况下,可能ECL或剪辑甚至更快。我应该在乎吗?好吧,我当然不会。
PARSER> (advent/2018:summary)
Day 1: Chronal Calibration
Puzzle 1: sum of frequency changes
3.958ms 520
Puzzle 2: first frequency read twice
699.040ms 394
Day 2: Inventory Management System
Puzzle 1: checksum of box ids
4.857ms 5000
Puzzle 2: common letters in box ids one letter apart
9.060ms ymdrchgpvwfloluktajxijsqmb
Day 3: No Matter How You Slice It
Puzzle 1: find squares claimed more than once
819.373ms 101565
Puzzle 2: find the only claim asked of only once
739.283ms 656
Day 4: Repose Record
Puzzle 1: Most Sleepy Guard, Strategy 1
5.472ms 35623
Puzzle 2: Minute Most Slept by a single guard, Strategy 2
7.761ms 23037
Day 5: Alchemical Reduction
Puzzle 1: Polymer reactions
2.609ms 10250
Puzzle 2: Time to improve the polymer.
100.259ms 6188
Day 6: Chronal Coordinates
Puzzle 1: dangerous, keep away, largest finite area
2132.732ms 4342
Puzzle 2: safe, keep close, within manhattan sum threshold
445.090ms 42966
Day 7: The Sum of Its Parts
Puzzle 1: order instruction steps (dependency graph)
0.330ms ABLCFNSXZPRHVEGUYKDIMQTWJO
Puzzle 2: time to complete steps in parallel with 5 workers
1.728ms 1157
Day 8: Memory Maneuver
Puzzle 1: read software license file
4.990ms 40701
Puzzle 2: value of the root node
2.295ms 21399
Day 9: Marble Mania
Puzzle 1: What is the winning Elf's score?
31.307ms 385820
Puzzle 2: What is the score with 100 times as many marbles?
5293.371ms 3156297594
Day 10: The Stars Align
Puzzle 1: KFLBHXGK
Puzzle 2: 10659s
Day 11: Chronal Charge
Puzzle 1: Find the 3x3 square with the largest total power
22.850ms 243,34
Puzzle 2: Find the square with the largest total power
413351.220ms 90,214,15
Day 12: Subterranean Sustainability
Puzzle 1: sum of indexes of pots with plants after 20 generations
2.283ms 2736
Puzzle 2: sum of indexes of pots with plants after 50000000000 generations
18.050ms 3150000000905
Day 14: Chocolate Charts
Puzzle 1: scores of the ten recipes immediately after 323081
139.835ms 7162937112
Puzzle 2: how many recipes to the left of 323081
12671.771ms 20195890
Day 15: Beverage Bandits
TO BE DONE LATER, lacking motivation for this one at the moment
Day 16: Chronal Classification
Puzzle 1: Count samples matching exactly 3 opcodes
20.406ms 529
Puzzle 2: Run given program with found opcodes
13.033ms 573
仅仅是为了踢它,而且由于我如今与普通LISP的GUI工具包McClim一起玩,这是我在64条常见的LISP代码中迅速进行的可视化面料拼图:
这次,我有一个错误,可以找到正确的测试结果,但在给出输入时找不到正确的结果。那让我感到困惑。我决定要画2D区域以获取线索。哦,现在很明显,边界框计算是错误的。修复此问题,重新计算,良好的结果!
感谢麦克林再次使我的生活变得轻松;-)
这个难题是非常视觉的,因为您需要模拟恒星运动,直到您可以读取星星形成的一些字母,就像它们是显示器上的像素一样。你说的视觉吗?麦克林再次营救!
这次,不仅可以提供拼图的确认或调试能力,还可以使用可视化来解决难题。我互动地进行了时间,并报告了我点击快进的按钮的时间数,直到我拥有完美的框架!