

In any mobile game, regular grids are used, they are also matrices. One grid is always in sight - this is a MxN-sized phone screen In addition, in the
Tetrises and Lines clearly visible, and other game grids. In AAA games, the matrices are hidden, but we know that they exist. And, yes, green - the most dangerous.
When working with grids, there are so many sweet tasks that from the desire to solve them as soon as possible, sweat drips from the fingers on the keyboard. One of these tasks is to fill the matrix with random values. For example, there is a 5x5 grid, which must be filled with 24 balls of 4 colors. There should be 6 balls of each color and one hole. Pseudo-code like this:
')
var items = [Int]() let nItems = 25 let nColors = 4
Let's make the code and algorithm more beautiful. The word
more beautiful sounds frightening, agree. Sometimes, the more beautiful the code, the closer the
crash .
let nItems = 25 let nColors = 4 var items = [Int]()
On the last 4 lines, Phil grins, php has a method
items.shuffle()
However, the text has become shorter by 2 times. Code - 40 times faster. Probably, you can redo the algorithm for the balls for a long time. But, to be honest, the balls have nothing to do with it. The main theme is squares, which are divided diagonally into two equal halves in two ways. The resulting halves need to fill in the matrix and get a good game at the output.
Meet the Halves 2048 .
In the game you just need to collect back the squares of the halves and clear the entire field. Managing the game is absolutely the same as in applications like 2048 - we drag our finger across the screen either up and down or left and right.
When creating a game, I became a different person, suddenly realizing that artists are people too and need a material evaluation of their work. That's why I bought pictures and backgrounds from a girl artist for $ 15. Musicians are another matter. They can earn in underground passages.
Okay. Of course, I had to edit the images a little, but I think I didn’t spoil them much.
In the purchased pictures there was a menu designed for 15 levels. I had to match the design and make 15 different
gameplays . Playboys and Gameplays. Funny surnames might be. As a result of fabrications at different levels of the game, the matrix size 3x3, 5x5, 7x7, 9x9 and the type of gameplay began to change. The first option - the classic puzzle - to clean the board for the minimum number of movements. The second option - dynamic - after each movement 2, 4 or 6 halves fall on the board, trying to overwhelm the playing field. We must hold out as long as possible. The first option takes 1 minute of player's life. The second option sometimes takes up to 1 hour flight between Belgrade and Ljubljana.
Blinding the code quickly, I started testing. It was necessary to adjust the levels - to get an approximate number of moves, for which you can add puzzles and arrange ratings. For example, I was able to solve the board 5x5 in 8 moves, which at first seemed incredible.
I dare to offer a task to those without an iPhone

Unixoids Solution4,3,5,2,4,3,5,2,5,2,
2-left
3-right
4-up
5-down
For an endless game, it was necessary to pick up the number of falling halves - surprisingly, but for board 9 by 9, 7-8 drop-down items are needed after each player's turn, otherwise the game actually becomes endless and boring in half an hour.
There were no problems with the publication. January 22, I laid out the game for review. 24 in the evening she was in review and in another hour she was ready for sale. Especially for local yablofilov she declared free and is waiting for your records. I collect all the results in the cloud, including secretly storing sequences of the best solutions.
Thanks for attention.