3 ms·
I would like to see this done in C
by plg 10y ago
I would like to see this done in C
- sinisterstuf 10y agoI'd been following along in C, and I was very surprised to see how similar some solutions were, e.g. as mentioned above[1], drawing a map of the keypad with special characters for edge detection. I've never finished an Advent of Code though, and I don't think I'd get further in another language than C, I just spend most of my Christmas/December time with family instead of coding; maybe if there was a February of Code I'd participate more actively. I actually think C is an _ideal_ language for challenges like these: parse a simple input file, do one or two things and write out a number. In fact (with a small number of very big exceptions) my code is usually quite short and concise, even compared to solutions my friends write in higher level languages. I originally picked C, not because I thought I'd be finish blazing fast in it, but because I wanted to learn to use it better (also for work and fun), so with that said, what little code I've written is publicly displayed on GitHub[2] for (as Hungarians say) spitting at. It has some comments and sometimes longish explanations about "design decisions" in the commit messages. I really did end up learning a lot and I am much more fluent in C now than before (no more Google/StackOverflowing every single statement, hooray!), but perhaps the most surprising thing was: You don't need a Makefile to build `thing` from `thing.c` if you don't need to pass any fancy arguments or anything, you can just write `make thing` without a Makefile and if there's a `thing.c` there it'll run gcc on it and produce your binary! I'd like to finish these challenges someday. Let's see. 1: https://news.ycombinator.com/item?id=13259460 https://news.ycombinator.com/item?id=13259460 2: https://github.com/sinisterstuf/adventofcode https://github.com/sinisterstuf/adventofcode