/chrestomathy

Small code samples for various problems and languages

Primary LanguageCommon Lisp

chrestomathy

Implementations of simple programs in multiple languages for practice and entertainment. Contributions are welcome (especially for tasks/languages which other sources haven't covered), though this project is primarily for my own benefit.

(cf. http://www.rosettacode.org/wiki/Rosetta_Code)

I eventually hope to provide sample solutions for the following tasks:

  • Prime number searching
  • Simple ASCII plotting
  • Edit distance computation
  • Arbitrary base arithmetic
  • Magic squares
  • Generalized knight's tour

in each of these languages (subject to change):

  • Rust
  • JavaScript
  • Python
  • Common Lisp
  • C
  • Julia

(and potentially domain-specific languages like sed and jq for entertainment)

Ideally, the solutions will be aligned to each language's style and conventions (e.g., include both functional and imperative examples) rather than simple syntactic translations. I'm aiming to select tasks that encourage clean, readable scripts between 10 and 200 SLOC.