이 저장소에는 공통 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
단지 그것의 발 차기를 위해, 그리고 오늘날 나는 Common LISP의 GUI 툴킷 인 McClim과 놀고 있기 때문에, Fabrics 퍼즐을위한 64 줄의 일반적인 LISP 코드에서 신속하게 한 시각화가 있습니다.
이번에는 올바른 테스트 결과를 찾을 수있는 버그가 있었지만 입력이 주어지면 올바른 결과를 찾지 못합니다. 그것은 나를 꽤 당황스럽게했다. 나는 단서를 얻기 위해 2D 영역을 그리겠다고 결정했다. 아, 이제는 분명합니다. 경계 박스 계산이 잘못되었습니다. 이것을 고치고, 재판매하고, 좋은 결과를 얻으십시오!
내 인생을 다시 쉬게 해주신 맥 클림에게 감사합니다 ;-)
이 퍼즐은 마치 모니터의 픽셀 인 것처럼 별이 형성된 문자를 읽을 수있을 때까지 별 움직임을 시뮬레이션해야하므로 매우 시각적입니다. 당신이 말한 시각? McClim은 다시 구조를 위해!
이번에는 퍼즐에 대한 단순한 확인 또는 디버깅 능력을 제공하기보다는 시각화를 사용하여 퍼즐을 해결하는 데 사용됩니다. 나는 대화식으로 시간을 거쳤으며 완벽한 프레임이있을 때까지 빠른 버튼을 클릭 한 시간을보고했습니다!