Advent of code, in several languages for fun
(But mainly in Haskell)
Execute the build_day.sh file to generate the necessary files depending on the chosen language
You need to execute it like
. build_day.sh [hs]Build the Haskell Docker Image:
docker build -t haskell-aoc .
Create a haskell Docker
docker run -it --rm --name haskell-aoc haskell-aocKeep it running in the background in order to launch your solutions on it
make profilingwhich will run the profiling on the docker and create the result file as DayXX.prof
You can also use the flame graph viewer SpeedScope
In which case you will need to run this.
$ ghc -prof -fprof-auto -rtsopts Main.hs # replace with source file
$ ./Main +RTS -pj -RTS input.txtYou can run it locally, but if you have any issue, it should work on the Docker.
then you just need to do
docker cp haskell-aoc:/home/haskell/Main.prof .Started coding in Shell, was too difficult, so finished in Python..
For More details
Starting in shell and Haskell, will see how it goes
For More details
For More details
Continuing in haskell
Having fun trying to automate stuff as well
For More details
Still in haskell, trying to explain my thoughts and clean the code as much as possible by using the language's design
For More details