-
• #103
I write C code for a job (mostly) so I write C in perl.
It tends to come out cleaner than resorting to squishing 8 lines of stuff into one by using implicit $_, map and other such tricks.
-
• #104
Yeah, I didn't see that until the end of the first part, and in any case expected the second part to be different.
-
• #105
Yep. Just because you can doesn't mean you should.
I keep trying to teach some people on my team that 'it works' isn't a sufficient end state in code. -
• #106
Out of interest, in what capacity do you teach into Haskell?
At Durham. As a day job, I do applied maths and computational science.
-
• #107
Can you do this in BASIC?
-
• #108
I would imagine that rhowe would swap ansible for BASIC any day :-)
Has anyone seen a LaTeX submission?
-
• #109
I realised that after I finished, but I still think I would prefer separate row and column numbers to find my seat. :D
-
• #110
rhowe always uses programming languages I've never heard of. I think he does it on purpose*.
*It's not too hard to use a programming language I've never heard of.
-
• #111
Calling ansible a programming language is a bit of a stretch
-
• #112
Told you I'd never heard of it.
-
• #113
Would have been far slower if I hadn't known about dictionaries. :)
-
• #114
Indeed, this is why I like perl as it gives you fewer options for data structures.
If I was writing in python and I'd looked at part 1 and chosen a Set then I'd have needed to rewrite it as a Dict for part 2 where I needed to keep counts against the entries.
With perl there's no Set data type, you've got scalars, arrays and hashes (equivalent of python dicts) so I tend to default to hashes anyway.
Also with AoC you get used to the times where the optimal choices for part 1 often mean a bit of rewrite for part 2. I do the challenges to get the answer as fast as possible (not worrying about leaderboards, hence my 9.30am lie in this morning). Then I can go back and pretty it up and rewrite it in other languages at a later point in time.
-
• #115
I still haven't written any code this month.
Day 5:
https://docs.google.com/spreadsheets/d/1urBVcFFAz4HzJshKldFKtgobE_Zi8DGGNgY4Na5ATHw/edit?usp=sharingDay 6:
https://docs.google.com/spreadsheets/d/1VXcXG-N5KLMXUIs0Tdb7ObusNgZVVFaLnjdTCfD4AsA/edit?usp=sharing -
• #116
Still sticking to functional Python, although not sure it's necessarily the most clear today. Will probably have to commit to binding variables soon.
https://gist.github.com/wence-/7d2a722fba29c94149a75beebfd5333c#file-day06-py
-
• #117
-
• #118
I didn't know this ! Thanks for the discovery ! I had fun catching up this weekend.
I was too lazy to spin up a proper project folder for this.
So I went for the terrible strategy of doing all the problems in a single colab....
Let's see how long it take for it to come back to bite me... :-D -
• #119
Bit behind now... but arf
1 Attachment
-
• #120
I've cycled through that place, there's a lovely pub.
-
• #121
Day 7: Yes, you can recursively traverse a linked list using only basic spreadsheet functions.
https://docs.google.com/spreadsheets/d/11cUvSGYl9NT2-3prdotWaXyiD_-DfIFLJmeRujuxXwQ/edit?usp=sharing
(Even when two of those functions are VLOOKUP() and MATCH(), which are designed to not do what you expect them to)
-
• #122
Ha, good work for persevering.
Still waiting for a bigger meatier problem.
-
• #123
I misread the instructions multiple times today, which was the cause of most wrong answers. Eventually https://gist.github.com/wence-/7d2a722fba29c94149a75beebfd5333c#file-day07-py
-
• #124
Day 4 in ansible took me far too long: https://gist.github.com/rhowe/1059f9da52850f942e7e120d7b11bf80#file-aoc2020day04part2
OK, time to do some catching up I think
-
• #125
Day 5 was a shit ton easier to do: https://gist.github.com/rhowe/1059f9da52850f942e7e120d7b11bf80#file-aoc2020day05part2
Squeezed in a small amount of time to get today's finished (using Scala again):
https://gist.github.com/dmckennell/6645ad73208043f403481e780ae49ea2
...didn't read the second part too much and just plumped for some logic which seems to work