ที่เก็บนี้มีการใช้งานการถือกำเนิดของปริศนารหัสโดยใช้ Lisp Common ไม่ใช่ว่าฉันภูมิใจมากที่ฉันต้องการแบ่งปันพวกเขามันเหมือนกับว่าฉันสนุกและฉันอาจเรียนรู้เทคนิคใหม่โดยการเปิดเผยรหัสนี้
ความตั้งใจของการเล่นเกมนี้คือการสนุกและทำปริศนาอย่างรวดเร็ว ฉันจะไม่ขยายขอบเขตที่ร้ายแรงเกี่ยวกับการเขียนโปรแกรมแนวปฏิบัติที่ดีที่สุดที่นี่ดังนั้นมันจะแสดงปฏิกิริยาตอบสนองและนิสัยของตัวเองเป็นส่วนใหญ่ มิฉะนั้นจะไม่สนุกอีกต่อไปใช่ไหม?
ฉันเตรียมเครื่องมือบางอย่างเพื่อส่งออกสรุปเวลาปริศนาและผลลัพธ์ที่นี่สำหรับผู้อ่านที่สนใจที่มีภาพรวมอย่างรวดเร็ว ความตั้งใจของฉันคือให้ข้อมูลนั้นทำงานได้อีกครั้งในแต่ละวัน
ฉันใช้ 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
สำหรับการเตะมันและเนื่องจากทุกวันนี้ฉันเล่นกับ McClim, ชุดเครื่องมือ GUI สำหรับ Lisp Common นี่คือการสร้างภาพข้อมูลที่ฉันทำอย่างรวดเร็วในรหัส LISP ทั่วไป 64 บรรทัดสำหรับปริศนาผ้า:
ครั้งนี้ฉันมีข้อผิดพลาดที่ฉันจะพบผลการทดสอบที่ถูกต้อง แต่ไม่พบผลลัพธ์ที่ถูกต้องเมื่อได้รับอินพุต นั่นค่อนข้างทำให้ฉันงง ฉันตัดสินใจว่าจะวาดพื้นที่ 2 มิติเพื่อรับเบาะแส โอ้ตอนนี้เห็นได้ชัดว่าการคำนวณกล่องที่มีขอบเขตผิด แก้ไขสิ่งนี้อีกครั้งผลลัพธ์ที่ดี!
ขอบคุณ McClim ที่ทำให้ชีวิตของฉันง่ายขึ้นอีกครั้ง ;-)
ปริศนานี้ค่อนข้างจะมองเห็นได้เนื่องจากคุณต้องการจำลองการเคลื่อนไหวของดาวจนกว่าคุณจะสามารถอ่านตัวอักษรที่เกิดขึ้นโดยดวงดาวราวกับว่าพวกเขาจะเป็นพิกเซลบนจอภาพของคุณ ภาพที่คุณพูด? McClim เพื่อช่วยเหลืออีกครั้ง!
เวลานี้แทนที่จะเป็นเพียงการยืนยันหรือการดีบักความสามารถในการปริศนาการสร้างภาพข้อมูลจะใช้ใน การไข ปริศนา ฉันใช้เวลาโต้ตอบและรายงานจำนวนเวลาที่ฉันคลิกที่ปุ่มที่รวดเร็วไปข้างหน้าจนกว่าฉันจะมีเฟรมที่สมบูรณ์แบบให้ดู!