klsmithphd / aoc-clj Goto Github PK
View Code? Open in Web Editor NEWSolutions to Advent of Code challenges implemented in Clojure
License: Apache License 2.0
Solutions to Advent of Code challenges implemented in Clojure
License: Apache License 2.0
Some thoughts on speeding things up:
Either there's a recurrence in the pattern so you don't need to simulate 400,000 rows, or there's a much faster implementation of figuring out the next row values (likely just using bit operations instead of the string checks I'm doing now.)
I think I had worked this out by hand back in the day.
The iterative approach to generating the fill string is probably the thing that's too slow, particularly the part that reverses the initial string.
An alternative implementation ought to be able to generate the entire string in one go (without iteration/recursion), which could avoid the intermediate creation of temp string sequences.
I'm marking the test as slow, but it might be worth just living with.
Places where this would be handy:
The description that accompanies part2 hints that you probably need to actually interpret the "assembunny" code and figure out what it's essentially doing or else the operations are going to take forever.
It says, "As you run the program with this new input, the prototype computer begins to overheat. You wonder what's taking so long, and whether the lack of any instruction more powerful than "add one" has anything to do with it. Don't bunnies usually multiply?"
Letting the program run, I did eventually get the correct solution, but it takes a long time.
Part 1 is slower than it needs to be, but it's at least usable. Part 2 takes far too long to run as-is
On my old mac's devcontainer, it took close to 35s to complete part 2.
When the game self-plays, timing issues can cause the "player" to lose sometimes.
Each run can result in a different outcome, whereas it ought to be possible for the solution to be
completely deterministic.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.