o
odin.langpkg.dev
packages / library / odin-cc

odin-cc

86287ddlibrary

Odin Coding Challenges

No license · updated 3 months ago

Odin Coding Challenges

This contains solutions to selected coding challenges from codingchallenges.fyi, implemented in the Odin programming language.

The goal is to learn Odin's unique features, such as its type system, explicit error handling, and low-level memory model while solving interesting problems.

Structure

Each challenge is organized in its own directory.

Challenges

  • wc — Unix wc tool: count lines, words, characters, and bytes
  • json-parser — JSON parser with span-based error reporting

How to Run

You'll need Odin installed. If you use Nix, a flake.nix is provided with Odin and the OLS language server. With direnv the environment is activated automatically when entering the directory — otherwise run nix develop manually.

To run a challenge:

cd <challenge-directory>
odin run . -- <args>

To run tests:

odin test <challenge-directory>/tests