Advent of Nim 2020 megathread

2020-12-24 Thread e
Hah! There are so many options for hexagonal coordinates. I sketched it on paper this morning and chose what I now know (following @lscrd's link) is a "double-width" horizontal layout. See [this site.](https://www.redblobgames.com/grids/hexagons/) For e, w, se, sw, ne, nw...

Advent of Nim 2020 megathread

2020-12-24 Thread e
I needed a hint for Day 23, and went to reddit where I saw the SPOILER from [u/3urny](https://www.reddit.com/user/3urny/) "use a flat integer array of ints, length 1M, where at index at n you put which number comes after n in the ring." So, no linked list, no hash table. [My solution](https://g

Advent of Nim 2020 megathread

2020-12-18 Thread e
Sharing an audacious hack from the FORTRAN I compiler described on [this Wikipedia page](https://en.wikipedia.org/wiki/Operator-precedence_parser#Alternative_methods) Prepare the input as follows, and the part 1 no-precedence solution works with the specified precedence: proc repa

Advent of Nim 2020 megathread

2020-12-12 Thread e
My repo: I'm on the Jabba Laci leaderboard as `dougcurrie`

Advent of Nim 2020 megathread

2020-12-03 Thread e
Thanks, @miran \-- it turns out I had two AoC accounts, one tied to github and one to reddit. I started this year with the "wrong one." So, I restarted with the other account and now see the private leaderboard. Thanks!

Advent of Nim 2020 megathread

2020-12-02 Thread e
Is there some secret in rejoining the Nim leaderboard? I was active last year (top 10 I believe), but I don't have access this year.

Why is the implicit `result` so widely used?

2020-11-20 Thread e
Many coding standards, e.g., MISRA, mandate only one return point from a function. It is claimed that this leads to easier, less error prone maintenance. I'm not sold on the idea, especially in short functions, but I'm no expert in average programmer aptitude. Since I do write software to comply

Update on --gc:arc

2020-09-29 Thread e
Will immutable imply isolated? The [RFC244](https://github.com/nim-lang/RFCs/issues/244) doesn't say so, but [write-tracking](https://nim-lang.org/blog/2020/09/01/write-tracking.html) is coming, and would make sharing immutable structures possible.