iPhone - Umclaydet of our days. Burns all the free time for the execution of programmer desires.
Yesterday there were many desires, but today there was one less. Why. Because I made a toy based on the Voronoi diagram.

Has the world become better from this, and people more kind?
')
Under habracut 3 light pictures, 2 jokes and 1 code fragment.
Formulation of the problem
On the iField 320x460, dots are scattered almost randomly. Points 35.
Mathematicians say that you can throw a grid on these points. So that in each grid cell there will be only 1 point.

Of course, we immediately color the 35 grid cells in 6 different colors of the rainbow (except for red, it is clear why).
Say the cells in the picture are not 35? This is a jpeg loss.
We get a beautiful picture in the style of the 60s Pablo Picasso. We admire.
Something to notice. Altruistic cells are woven into fancy colored chains. Misanthropic cells stand apart.
Goal of the game
Your task, reader, is simple.
Living life so that it was not painfully painful To touch your finger to the grid cell - from your touch it will tremble and melt. And with it all the neighboring cells of the same color will disappear.
On the remaining points the grid is again thrown. According to the old rule. By the way, if that, scientifically, this rule is called the Voronoi diagram.
Your task is to
clear the field of points for the minimum number of touches .
Everything.
Ladybugs
I played this puzzle with a month for 1000 in advance of the given hands. I realized that the game is too complicated for blondes and officials. And too simple for aYTishnikov - no animation, beer, girls.
And why not make some points dynamic? Let them run around the field at random, reflecting off the hedge.
The fleeing points depicted beautiful Ladybugs, which the Onglechans call ladybugs || ladybirds.
Girl dragon, then in our opinion, in Mordovian (c) Shrek.

With girls The game has become more dynamic and fun.
Added background music. Chose, of course, Chizh.
I once listened to his disc once in a car for half a year and did not get bored.
On the iPhone, Siskin tired of this week.
Replaced Chizh on Bach, well tempered. I hope Siskin will not be offended.
Especially since Bach got tired faster. Made it quieter by 75%. It became calm.
A little bit of code, since we only use the avfoundation framework to play background music.
#import <AVFoundation/AVAudioPlayer.h>
#import <AVFoundation/AVFoundation.h>
NSString *soundPath = [[NSBundle mainBundle] pathForResource:@"chiz" ofType:@"mp3"];
self.player =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:soundPath] error:NULL];
player.delegate = self;
[player play];
Round out
Especially for the comments, Reader, I made the game free for two days.

I hope this post is appropriate to publish in the topic Development for iOS?
Promised anecdote
At parting, as usual, a bearded joke, but in the subject.
Sits on Habré Ladybug, exhausted vuzmert, just no.
-What happened?
- Fucking habraeffekt - Ladybird, fly to the sky, bring us bread, got just ...
Do not switch
In a month I will write about the continuation of this game, in which I used the mechanism of purchasing in app.