Technical requirements
To perform the tasks in this chapter, you will need the following:
- A working installation of Crystal
- A text editor configured to use Crystal
You can refer to Chapter 1, An Introduction to Crystal, for instructions on getting Crystal set up and to Appendix A, Tooling Setup, for instructions on configuring a text editor for Crystal.
Every example in the chapter (and in the rest of the book as well) can be run by creating a text file with the .cr
extension for the code and then using the crystal file.cr
command in a terminal application. The output or any errors will be shown on the screen.
You can fetch all the source code used in this chapter from the book's GitHub at https://github.com/PacktPublishing/Crystal-Programming/tree/main/Chapter02.