What are you coding?

I can relate to this. I learnt vi(m) a long time ago, and it still does a better job for me than anything else I’ve tried. Emacs Lisp is far cooler than vim scripting though, I have to admit (although I know I’m supposed to be on the other side of the Holy War).

1 Like

Heh. When it comes to arguing about editors, I think vi and emacs users are both on the same side nowadays : ) I think anyone using either has made a fine decision.

FWIW I see some Vim users transitioning to Emacs on the basis that there’s pretty good emulation available, and so they can get many of the benefits of both editors that way, and use some of the great tools that people have written in elisp; but I suspect that any long-time Vim user would probably need to be pretty motivated to make it worth getting used to the differences.

Well I’m a weirdo because I like vi (well, nvi now) but not vim. vim insists that it has an “insert mode”, but that’s wrong: it’s an insert command, that happens to take a particularly long parameter. (Being serious for a moment: this doesn’t actually matter, but it would irk me every time I used it.)

But I’m now mostly using emacs, and the reason was org-mode, which I use for everything vaguely hierarchical or tabular.

1 Like
AoC 19

I am writing Perl. All shall be regular expressions! But I followed the advice and didn’t try to universalise part 2.

1 Like

On a machine at work, I’ve been using UNIX “ed” because it’s there, and I haven’t got round to building our in-house editor for it. I have not touched ed for about 40 years, but since so many UNIX conventions sprang from it, I’ve found it amusingly easy to pick up again.

5 Likes

I think you win the archaic text editor competition by a distance. I hope you write email using telnet

4 Likes

Well, I still subscribe to CIX, and the client I use for that uses Telnet to talk to the server. I have used older and worse editors than ed, in my interesting trek through the bowels of the British computer industry. The nadir was the GEORGE 3 line editor, designed for use from punch cards, which some fool had ported to GEC OS4000 for use on glass teletypes.

The editor I need to build when I get fed up of using ed is a re-write of the folding editor for the Occam programming language, in my employers’ domain-specific language, which is an extended C (not C++). I don’t like IDEs much.

3 Likes
AoC 19

Part 1 took me about 30 minutes. I used Python with class inheritance and deductive, recursive matching

Part 2 took me about 2 hours and I solved for the general case rather than the given cases. I’m pretty proud of that.

AoC 20

Well, I solved Part 1 by just looking for tiles where 2 of their sides had no match, but not actually stitching the entire picture together.

So… in addition to the actual challenge of Part 2, I also now have to go back and write the actual stitching bit… Oh well, I suspected it would bite me.

But I don’t have the brain to do it tonight, so it’ll have to wait.

1 Like
AoC 20

Yeah, I had a look through the Reddit thread and there seems to have been a split in approaches:

  1. “OK, let’s stitch these tiles together. Right, corner values are this, and part 2 adds on to what I’ve already done.”

  2. “Hey, I don’t need to go through all the tedium of stitching, I can just count the number of times each border value appears. Oh bother, for part 2 I have to do the stitching after all.”

I took the second course and suffered a thorough enthusiasm failure when it came to part 2.

1 Like
AoC 21

I thought I’d spotted a short cut, but the easiest way to solve part 1 that actually worked was to derive what turned out to be the part 2 solution and build backwards from there.

1 Like

AoC 20 took me waaaaay too long to solve. But, in the end, I’m happy with my approach and solution (even though in its current (and forever) state, it’s nigh impossible to read).


I blasted through AoC21

Essentially solved part 2 when solving part 1, except for having to use a keyed sorted() call to produce the answer


AoC 22

I really feared they were going to get exponentially harder as we approached Christmas. Well, so much for that. Part 1 was a breeze. Part 2 just requires more concentration than I can give at midnight:04

AoC 22: I did manage to produce a possibly-infinite loop on part 2 by failing to implement the “subset” part of the constraint, but agreed - this was pleasantly lightweight.

1 Like

I may have jinxed it. I am at a complete and utter loss as to how to approach Day 23 Part 2. I need to mull it over, to say the least.

1 Like

Not a solution, but a path to a solution

23.2

Last year there were lots of questions that looked like this, which had a part 1 “do the simple thing” and part 2 “now do it vastly scaled up, i.e. you don’t really do it at all, you work out how to do just the bit you need”.

This one isn’t like that. (At least as far as I can see.) They really do want you to iterate it out in full. You just need the right data structure so that the repeated operations are fast.

1 Like
AoC 23.2

Thanks for the hint! It really forced me to reconsider my approach and identify that churning a python list multiple times per step was just foolhardy from the outset. I hacked a super-simplified linked list using a dict() object

AoC 24.2

[sigh] Oooooh, it’s hexagonal grid Life… waaaay different. Well, I suppose as long as everyone already used a hexagonal coordinates system… otherwise it may be a challenge

Yeah. Basically I was able to recycle some of my code from an earlier challenge, but I’ve done hex grid calculations before so I knew some tricks to fit them into 2-dimensional arrays.

in short

if east is +x, then a move of “e” gives you x+=2, while “se” gives you x+1 and y-1, etc.; and that set of coordinates mapped to directions then gives a convenient set of neighbour calculations. Code worked first time, took a few decaseconds to run but as usual with AoC I started it running while I thought about a better way of doing it and it had finished before I came up with one.

1 Like
AoC 24.2

Once again, I went with a sparse data mapping using a custom coordinates class that took care of the math for me (coord.go(‘e’) returns a new coord that represents one tile east), so it was simple to implement a 3d coordinate system (mapping 2d hex tessellation as though it was a 3D grid)

AoC 25.1 and 2

Fun, but not exactly climactic? Eh, probably I’m being unreasonable to feel let down.

AoC 25.1 and 2

Anticlimactic was exactly my thoughts. I did have fun doing the My First Diffie-Helman puzzle.

1 Like