
In our nuclear laboratory, there are several techniques for modeling physical phenomena on a regular grid. Most of the grids are rectangular, that is, each cell has exactly one neighbor on the right, one on the left, one on top, one on the bottom. Four neighbors. Conveniently, rationally, the cells are not rigid, unlike the triangular ones.
But there is one technique based not on a quadrangular regular mesh — but a hexagonal one. The apologists of the approach claim that nature - from spiders to bees - uses only such a partition.
I decided to take some popular games based on quadrangular grids (
Lines, Tetris, Dots, Panda, Candy Crash Saga ) and rewrite them on a natural hexagonal grid.
The tetris , called
Hetris (from
Hexagonal tetris ), turned out pretty funny and I decided to post it in the
AppStore .
In order to avoid accusations of self-promotion, I screwed to the application
Push Notification , and describe the features of its implementation in this article.
')
Did you know that the word
Tetris is forbidden to be mentioned in vain?
Push notification
Work on the implementation of
Push Notification is divided into four parts.
- Getting certificates
- Code on the client side
- Code on the server side
- Organization of tables and uploading certificates to the server
This process is described
on Habrahabr . Since then, nothing has changed, only the type of notifications has become more fashionable and beautiful.
The only thing that is missed in the article is the removal of red
badges on the icon when you activate your application. I am pleased to fill this gap.
In the file AppDelegate.m must include 1 line
- (void)applicationDidBecomeActive:(UIApplication *)application { [[UIApplication sharedApplication] setApplicationIconBadgeNumber: 0]; }
Funny from Review Team
The process of checking the application in the
AppStore turned out to be ridiculous.
Instead of approval, I received a response.
Your app has been able to post this version
I was accused of violating the three points of the
Criminal Code APPLE and sentenced to death.
Immediately sent the question: - What the hell?
And immediately received an answer
You used the obscene word Tetris in the description of the game. We ourselves have deleted this word and continued to check your application. Shooting is canceled
In fact - the description of the application consisted of two sentences.
Sentence
It's like a Tetris on the hexagonal grid
was thrown out.
I note that
Tetris was not mentioned in the keywords.
After 1 hour, the
free Hetris app was approved.
IOS intelligence

Of course, I wrote a
bot that plays
hetris for you.
To select a move, I minimized the functional of four terms with different weights.
- number of lines eaten
- number of holes formed
- glass height
- column gradient
With a depth of stroke H = 1, the
bot scores from 500 to 2000 points. With a depth of stroke H = 2, it plays almost infinitely. With a depth of H = 3 processor from Apple can not cope. A live player is not able to score more than 6000 points. And this is with a delay of 0.2 seconds at the most difficult 9th level.
Thus, as in chess, the machine defeated man. Alas, we ...