February 2018
Beginner
200 pages
4h 37m
English
Programming language entities and data types are not enough when you’re building a larger application. We need to create new data entities to express the application domain. In Elixir, we employ structs. We covered how to use them in Matching Structs, but now we’ll see how to create them. We’ll create a struct that represents the player’s hero. Then we’ll organize our application, separating the domain entities from CLI code by listing the heroes’ options to the player. Then we’ll use some Mix command-line functions to let the player choose a hero. The first step is to build a struct to describe the Character domain entity.
We’ll build a struct that will hold all the character’s ...
Read now
Unlock full access