How to initialise and use array in game assignment

I know there are append and shorten functions to do this but I have trouble coding them here. Also, I don’t know what should be the class of a void function such as showNumber.