title: How do I save newly made pictures with a prefix name and an iteration number
body: <p>i am creating a function to create coloured square tiles dependent on the function createSquareTile(numTiles, prefix). How do i make sure that the file is saved under a certain prefix mentioned when calling the function and also the number of times it has been made. Also, how do i loop these codes according to the number of times that is mentioned in 'numTiles'?</p>
  
  <p>Eg. createSquareTile(2, squaretile), it will create 2 tiles and saved as squaretile1, squaretile2</p>
  
  <p>numTiles = number of tiles to be made</p>
  
  <p>prefix = prefix name for tiles to be saved as</p>
  
  <p>code:</p>
  
  <pre><code>def createSquareTile(numTiles, prefix):
    current = 1 #iteration number
    if current == 1: #Checks if first tile created
      size = requestNumber("Please input a positive number")
      sizeI = int(size)
  
    while (sizeI &lt; 0): #If invalid input 
        showError("Your input number" + str(sizeI)+ "is not valid. Do it again!")
        size = requestNumber("Please input a positive number")
  
      if (sizeI &gt; 0): #if input number is positive
        current = current + 1
        color = pickAColor()
        newTile = makeEmptyPicture(sizeI, sizeI, color)
        setMediaPath()
        writePictureTo(newTile, getMediaPath(string(prefix) + current))
  
    elif current &gt; 1: #Checks if not first tile created
      previousChoice = requestString("Same size as pervious tile? (Y/N)")
  
      while (previous != "N") and (previous != "Y"):
        showError("Your input character" + previousChoice + "is not valid. Do it again!")
        previousChoice = requestString("Same size as previous tile? (Y/N)")
  
      if (previousChoice == "Y"): #If user wants to create the next tile with the same size as the previous
        current = current + 1
        colorY = pickAColor()
        newTileY = makeEmptyPicture(sizeI, sizeI, colorY)
        setMediaPath()
        writePictureTo(newTileY, getMediaPath(string(prefix)+ current))
  
  
      elif (previousChoice == "N"): #If not the first title made and user does not want previous size
        sizeN = requestNumber("Please input a positive size number")
        sizeNI = int(numTilesN)
        current = current + 1
        colorN = pickAColor()
        newTileN = makeEmptyPicture(sizeNI, sizeNI, colorN)
        setMediaPath()
        writePictureTo(newTileN, getMediaPath(string(prefix)+ current))
  </code></pre>