Writing menu systems for games can be easily overcomplicated. In this article I go through writing a simple and robust menu system based around functions without using any data structures. The upshot is robust, readable, scalable code that flows logically, produces fewer bugs, and is easy to debug and work with.
&AV-Racer
https://wassimulator.com/blog/programming/av-racer/devlog_6.html