It is not that the task was so difficult, for me it was more that debugging it was very complicated.
That and understanding the assignment was not easy for me toady.
- Log in to post comments
It is not that the task was so difficult, for me it was more that debugging it was very complicated.
That and understanding the assignment was not easy for me toady.
There are some videos on https://www.reddit.com/r/adventofcode/ doing speed runs.
They are mostly using python wich is very good at mapping functions to inputs.
some playlists below:
https://www.youtube.com/playlist?list=PLqhjTZS4RhCe-TMJlGvlXu7X_NmZaUtDe
https://www.youtube.com/watch?v=bCnTOC5l7TY&list=PLqLJjAz977SsDLGLmDx5sZcyD4JkmVxO0&index=2
Oke,
The guys on the leaderboard are pretty insane.
I got up 2 mornings at 6am. (Thats when it starts for me.)
Started programming but being done and making no mistakes in 10 minutes or less to get on the leaderboard is just nuts.
I implemented a simple hash function for it. I just created a new word from all the letters in alphabetical order.
If it's the same word. tadaaa. Code is found in my bitbucket above.
Not getting up at 5 am here either.
But seeing different solutions in cache is worth it.
They will still be there on christmass :p
Where is Danny when you need him? I guess he got a bit tired by doing 2016 one :)
My solutions are here: https://bitbucket.org/bertsarens/advent2017/
I joined it :)
PS.: you can have multiple private leaderboards, in case you wonder.
The argumentless-For is the worst in showing intent of the code.
A quit statement can be anywhere in the code. There is no clear definition as to where to put the condition for ending the loop.
What is wrong with a while that shows clear intent:
while (struct'="") {
s struct = $ORDER(TABEL(struct),1,data)
}
I don't like the fact that u use for loops to traverse a global.
In most programming languages for loops are for when you know the number of iterations needed in advance.
see quote below straight from stackoverflow: http://stackoverflow.com/a/2950945
The main difference between the
for's and thewhile's is a matter of pragmatics: we usually useforwhen there is a known number of iterations, and usewhileconstructs when the number of iterations in not known in advance. Thewhilevsdo ... whileissue is also of pragmatics, the second executes the instructions once at start, and afterwards it behaves just like the simple while.
I don't think the above code proves anything.
The first time you run trough it it gets cached, so the second time is bound to be faster.
Try to run another 2 full runs and another 2 zn runs and you should see they are way closer.