Code (Text) pasted on 2019-01-30, 18:13 Raw Source
- 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.
- 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.
- For simplicity, we use letters to identify the different pieces:
- #
- # # #
- ## # ## ## # # #
- ## # ## ## ## ## ###
- O I S Z L J T
- 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.