The card reader

When we think about a finite amount of states, we usually consider using an enum. While this is not wrong, it forces you to pack all the logic either in your context or your enum itself. Let's explore this with an example.