8000 GitHub - alexandreyc/adventofcode2022: A few Advent of Code puzzles (2022 edition) in C
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

alexandreyc/adventofcode2022

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Just a couple of Advent of Code puzzles solved in C. When possible I try to use non obvious ways to solve the puzzle, to make things more creative:

  • Day 1 makes use of a simple streaming algorithm to retain top-N max entries.
  • Day 2 turns the logic of Rock, Paper, Scissor into a simple equation modulo N.
  • Day 3 makes use of bitmaps.
  • Day 4 shows abstracting with C structures.
  • Day 5 shows linked lists are useful.
  • Day 6 will solve in O(N) instead of O(N*M).
  • Day 7 uses recursion and building ad-hoc data structures.
  • Day 8 walks data structures using a velocity vector.
  • Day 9 has nothing special. Just plain C code to simulate the rope.
  • Day 10 Simple but fun. Nothing special. Hints at cycles-exact emulation.
  • Day 11 Is an example of how you should not do parsing, assuming tons of stuff about your input. The program uses the LCM to avoid overflow. Yet I had to change int to long, and I did it brutally in 2.c, with vim search and replace.
  • Day 12 implements the worst queue you'll ever see.
  • Day 13 uses a recursive parser that generates nested objects.

About

A few Advent of Code puzzles (2022 edition) in C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 98.0%
  • Makefile 2.0%
0