January 2020
Intermediate to advanced
532 pages
13h 31m
English
Throughout this chapter, we will illustrate programming concepts by building parts of a space war game. The design of the game is very simple and straightforward. It consists of game pieces such as spaceships and asteroids that are scattered around a two-dimensional grid. These game pieces are called widgets in our program.
Let's first define our data types as follows:
# Space war game!mutable struct Position x::Int y::Intendstruct Size width::Int height::Intendstruct Widget name::String position::Position size::Sizeend
As data types are central to our design, this warrants a little more explanation:
Read now
Unlock full access