-2,0|-1,0|0,0|1,0#0,-2|0,-1|0,0|0,1
0,0|1,0|0,-1|1,1
-1,0|0,0|1,0|0,-1#0,-1|0,0|0,1|1,0#-1,0|0,0|1,0|0,1#0,-1|0,0|0,1|-1,0
-1,0|0,0|0,-1|1,-1#-1,-1|-1,0|0,0|0,1
-1,-1|0,-1|0,0|1,0#0,1|0,0|1,0|1,-1
-1,0|0,0|1,0|1,1#0,1|0,0|0,-1|1,-1#-1,0|-1,1|0,1|1,1#-1,1|0,1|0,0|0,-1
-1,1|-1,0|0,0|1,0#1,1|0,1|0,0|0,-1#-1,1|0,1|1,1|1,0#0,1|0,0|0,-1|-1,-1
With 4 levels of token:
a line break (newline) separates each shapes
a # separates each possible rotation
a | separates each block coordinates
a , separates X and Y coordinates.
Then I just had to select a random line, and to make it simple I just used the first rotation on spawn.
Also note that in tetris all shapes are made of 4 blocks that made things easier too.
Then I just had to know the current shape and move the blocks accordingly.
Tetris always have one shape moving at a time so it made things easy to. I just had to flag the blocks as moving or not (boolean)