Enum


Sep. 12, 2022

Swift enums

I’ve started on the refactoring for Rock, paper, scissors . One of the things I didn’t like was using Ints to signal which shape (I’m calling the rock, or paper, or scissors hand shape a shape) was being handed around. The Int I was using was also the index into an array of the emoji’s - so if I did an off-by-one I was risking an out of bounds on the array.