How can I make random image visible?

Hie there. I want to set 10 images at the same position but everyone unvisible in the begining. When the user touch the play button, a random image must be visible on the screen. Then the user have to decide between yes or no buttons. After then, the user clicks the forward button, The first image will be unvisible and a random next image is shown on the screen. Every image should just 1 time visible. At the end, if every image showed visible, the game is end. How can I write these code blocks? If anyone write it for me, I would be very thankfull.

You need an image component, a Next button, and maybe a restart button.
You also need 3 global variables:

  • ALL_IMAGES: all image file names (constant)
  • REMAINING: a list of image files left to be shown, initially copied from the constant list of image files
  • IMAGE_NUMBER: The index in the remaining image file list for the next image to be shown

At Screen1.Initialize and in the restart button Click event, copy list ALL_IMAGES into REMAINING.

when NEXT button Click,

  • check if REMAINING is an empty list
    • if it is empty, stop
    • else pick a random number from 1 to length of list REMAINING and save it in IMAGE_NUMBER
      • set the picture of the image component to the file name at position IMAGE_NUMBER in list REMAINING
      • remove item IMAGE_NUMBEr from list REMAINING

Thanks a lot. This was very helpful. I wil try it to code.