Link.FYI

Pastebin

Create New My Pastes

Code (Text) pasted on 2019-01-30, 18:13 Raw Source

  1. Contrary to popular belief, the tetromino pieces you are given in a modern game of Tetris are not randomly selected. Instead, all seven pieces are placed into a "bag." A piece is randomly removed from the bag and presented to the player until the bag is empty. When the bag is empty, it is refilled and the process is repeated for any additional pieces that are needed.
  2.  
  3. In this way, it is assured that the player will never go too long without seeing a particular piece. It is possible for the player to receive two identical pieces in a row, but never three or more. Your task for today is to implement this system.
  4.  
  5. For simplicity, we use letters to identify the different pieces:
  6.  
  7.     #
  8.     #             #     #
  9. ##  #   ##  ##    #     #   #
  10. ##  #  ##    ##   ##   ##  ###
  11.  
  12. O   I   S    Z    L    J    T
  13.  
  14.  
  15. Let's pretend a player will go through a very fast game of Tetris and in order to win, they have to place 50 tetrominos. Return a string with 50 characters that describes the order of tetrominos that will appear.