One exercise, once a day, for 30 days!
Progress: 30 / 30 (100%)
01 Hello World - Hello world!
02 Fibonacci - Comparing compiled speeds of the recursive and iterative Fibonacci functions, written in Crystal's easy and elegant syntax.
03 Math IO Interface - A simple CLI application that evaluates mathematical expressions, with a couple exciting options.
04 Concurrency - An illustration of Crystal's easy-to-use concurrency feature (fibers), and a discussion of its appropriate use.
05 HTTP Server - Building an HTTP Server in Crystal is awesomely intuitive! This one serves static files, too.
07 JSON Mapping - Creating and rendering objects with the Crystal JSON API, introducing a very powerful feature of the language.
08 Bank Account - Exploring class variables, instance variables, and private methods through an application that keeps track of your bank account and its operations.
09 Pascal's Triangle - Generates and prints a number of rows from Pascal's Triangle using the nCk definition of the pattern.
10 Run-length Encoding - Simple data compression and expansion with RLE. Useful for languages with very repetitive words.
11 Quine - Turns out, quines in Crystal are pretty difficult
without string dumping. String literals didn't work at all
12 Vector - Creating vectors - the mathematical object, not
the data structure - with Crystal's efficient
13 Sieve of Eratosthenes - A fun and quick one - searching for primality with an ancient formula!
14 Balanced Brackets - Checking for balanced brackets in a string. @atom come at me!
15 Geometric Center - Approximating the geometric center of a set of points with a bounded Newtonian search.
16 Monty Hall - Proving the solution to the Monty Hall Problem with simple experimentation.
18 Bindings - C bindings in Crystal are elegant and easy; here, we write and bind a primality function. (Unfortunately, C++ is not (yet) supported!)
21 Dot Plot - Basically 15% of AP Stats in 20 lines of Crystal code. Bored? Try to rewrite this app in a more functional style, or save stdout to a file!
22 Line Graph - Dot plots ain't but a thing. Line graphs are way more fun (and a lot tougher, too)! Procs, blocks, and progress-tainting rocks are all over this project.
23 Brainfuck - You can't say you know a language until you write an interpreter for a ridiculous, esoteric language (that somehow also manages to be Turing complete) with that language. At least that's what they say.
25 Ordering Game - A simple CLI order-swapping game. It's an easy project to go through and a great introduction to command-line applications!
26 Password Storage - Password storage with Crystal's native Bcrypt implementation and a simple database in the form of an untyped text file. Not for use in production.
27 WebSockets - As we wrap up, it's time to do something fun. In this example, we play with WebSockets, HTTP handlers, and Procs (which also introduce closures!).
28 Map - A map of the Vanderbilt commons and first-year housing, with integrated directions between any two houses. More Procs, arrays, and module properties in this one!
29 Sum of Multiples - Sum up the multiples of any set of numbers, up to any limit you like. This program also introduces Crystal's free variables, a feature similar to C++ type templates.
30 Macros with Low-level operations - For our last day, we explore one of Crystal's more powerful features - macros - and look at the low-level operations available in Crystal.