Implementing the tile merging game