The sample code for the book is available from Pragmatic[5] and at GitHub.[6]
Throughout the book, listings begin with their filename, set apart from the actual code by a gray or light teal background. For example, the following listing comes from code/crystal_new/variables.cr:
| str = "What a beautiful mineral!" |
| str1 = "What a |
| beautiful mineral!" # multi-line string |
If you are reading the ebook, clicking the little gray box above the code extracts directly downloads that snippet. With the sample code in hand, you are ready to get started.