Very appreciative for the gentle encouragement of @PHolder to embark on the Advent of Code Challenge. I complete the first day of challenges using C.

One thing I was wondering is ok to post solutions to the challenges or no?

TIL:
- IBM has easy to understand C documentation that's less opaque than the Linux documentation for me. Example: ibm.com/docs/en/i/7.4?topic=fu
- sorting an array is not that easy. the function I used was qsort() and you have to implement a comparator. I adapted the comparator from here: en.cppreference.com/w/c/algori. The only difference is I used uint64_t for everything(not sure if it was the best choice but it had all the room I needed).
- To read a bunch of numbers from a file I couldn't get fscanf) to work well because it skipped over blank lines I read in as uint64_t so I couldn't figure out where each set of numbers ended. I had better luck with a combo of fgets() and stroull().

I actually really couldn't believe I finished it. The satisfaction of eventually getting something working in C is real!

@derickflorian > One thing I was wondering is ok to post solutions to the challenges or no?

Sure. I post my on a forum that supports hiding behind spoiler tags, but by the time the first hour or two has past, the hard-core coders have already gotten the top prizes and us regular folks are just plodding along. The Reddit for AoC has guidelines for the posting of code, and they follow the stats to see when all of the top 100 have be claimed.
reddit.com/r/adventofcode/
#AdventOfCode

Follow

@PHolder ok, great, thank you! That makes sense that I’m not really spoiling the competition for anyone! I will post my repo tomorrow.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.