このリポジトリには、一般的なLISPを使用して、コードパズルの出現の実装が含まれています。私がそれらを共有したいことを誇りに思っているわけではありません。それは私が楽しんでいるようなものであり、このコードを公開することで新しいトリックを学ぶかもしれません。
このゲームの私のプレイの意図は、楽しんでパズルをすばやく行うことです。ここでは、ベストプラクティスをプログラミングすることについて真剣に拡張するつもりはないので、それは主に私自身の反射と習慣を示します。そうでなければ、それはもう楽しくありませんよね?
興味のある読者が簡単な概要を持っているために、パズルのタイミングと結果の概要を出力するためのいくつかのツールを用意しました。私の意図は、それを毎日再び実行しているデータに保つことです。
これらのハッキングにClozure Common Lispバージョン1.12-DEV Darwinx8664を使用しています。SBCLは結果を後押しする可能性があることが知られています。気にする必要がありますか?まあ私は確かにしません。
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と遊んでいるので、ここでは、ファブリックパズルのコモンLISPコードの64行ですぐに視覚化を行いました。
今回は、正しいテスト結果を見つけるが、入力が与えられたときに正しい結果を見つけることができないバグがありました。それは私をかなり困惑させていました。手がかりを得るために2Dエリアを描くことにしました。ああ、それは今では明らかです、境界ボックスの計算は間違っています。これを修正し、再計算、良い結果を修正してください!
再び私の人生を楽にしてくれてありがとうMcClim ;-)
このパズルは、星によって形成された文字がモニターのピクセルになるかのように読むことができるまで、星の動きをシミュレートする必要があるため、非常に視覚的です。あなたが言った視覚?再び救助するマクリム!
今回は、パズルに単なる確認またはデバッグ能力を提供するだけでなく、視覚化を使用してパズルを解きます。私はインタラクティブに時間を過ごし、見るのに最適なフレームができるようになるまで、私の早速ボタンをクリックした時間を報告しました!