Quick question on the technical side for anybody interested in helping with code

So with my current setup, I have the Arduino hooked up to the lights, and a push buttons as an input.
Apart from the setup and loop, I have three other functions. The first function rainbow() makes the strip of lights scroll through rainbow colors. The second function random() makes a random light turn on for .5 seconds, turn off, and then repeats itself. The final function is button() and uses a variation of this code https://www.arduino.cc/en/Tutorial/StateChangeDetection to work. As of now, this function only returns a value of true or false, where true lights up the whole strip and false turns it off.

I want to accomplish something simple, but I am not sure how to use nested functions to get this to work, as I have little experience with arduino and the C++ language.

What I want to do is have the button() function be a master command of sorts, where I can make the arduino switch between rainbow() or random() at the push of the button without delay. How would I go about using the button to select which function to run, where 1 push = rainbow(), 2 pushes = random(), n pushes = //functionname(), and after the last push the counter resets itself.

Something like this (not the real code obviously)
if button == 1
if button == 2
if button == etc...
if button == total # of functions
button = 1

Thanks again for any help!
Shared publicly