Zdarovo, people with disabilities (people with normal eyesight are not interested in this article). It so happened that I was near-sighted from childhood. Nearsighted not from reading under a blanket, but by inheritance. And my father wore glasses, and grandfather, and even great-grandfather. And I did not want to be a bespectacled person - he loved all sorts of basketball, volleyball, hockey, water polo. In 1998, at the age of 34, vision dropped to -7 on the left and to -14 on the right eyes. Then a miracle, thanks to Japan and Switzerland, invented LASIK, eye surgery - and I was one of the first in Moscow to go under the laser - and became happy, like Odysseus, burst from the clutches of Cyclops. The process of restoring vision after the operation took 2 weeks - the fact is that during these 2 weeks the client is absolutely far-sighted - you see time at the MSU high-rise from anywhere in Moscow, but you cannot read a single line in the new story of Conan Doyle. ?? He died? Sorry, the guy was good at writing detectives.
So, I lived happily for a dozen and a half years, when suddenly the corrected vision began to deteriorate again. Perhaps because that first LASIK was partially made with a scalpel. This is now the 3rd or 4th generation FEMTO-LASIK, when everything is done with a laser. I will not describe in detail the technology of the operation - to nothing. Believe me, the whole process takes 30 seconds and does not bring any physical pain and inconvenience. Especially if you don’t know what they’re doing to you.
And so I decided to re-do LASIK or, as the doctor said:
Raise the flaps in place . It seems that in 17 years of active life, surgical flaps on the cornea slipped. - Patient, why do you have a bandage on your leg? Slipped ...
')
Well, thank God, they made me a repeat procedure (why not recursion?), And I waited 2 weeks, as in my youth.
But no, you mischievous - the process of restoring near vision was delayed for half a year. And even still not over. What is encouraging.
I recommend everyone who decides to undergo surgery before setting off the reference points for the doctors. Select as samples posters with text on the street and on the wall in the apartment. In your favorite toilet hang the API table, in short find stationary text at different distances, which you will recognize before and after the operation. And remember how well you recognize this text BEFORE you visit the doctors. And, second, buy big sunglasses — so that 3-4 days after cutting, neither the sun, nor the dust, nor the wind, nor the occasional dubbing touch your wonderful new eyes. Glasses to take with you for the operation! They will be needed immediately.
The best age to correct vision is 30-45 years. The body will quickly recover. I have got to my 52 in particular, especially the repeated LASIK on my eyes - this is generally a rarity, I don’t know any analogues. Eyes get used to the new state very slowly. Imagine that you do not see anything close - neither the text of books, nor the screen of a smartphone, nor Xcode, nor MSVC. It's horrible. Reading glasses do not help, vision has not stabilized.
At the same time, football, hockey, landscapes, faces of beautiful women - everything is fine, you can see very well in the distance. Pah-pah-pah.
But how to live without reading? I used to get away from problems in coding games, in solving puzzles, in card games. All this I lost. At first I even wanted to get poisoned, but I could not find the poison I needed - not a damn thing is visible what is written on the label. I also did not find the cartridges, some kind of clips came across. I had to ask my friend to set up Xcode for a poor programmer. Settings-fonts-
size 24 instead of 14 . And more or less began to encode.
But here the problem is again - I can’t do a puzzle with small details - a 3 by 3 grid is available to me with large numbers and different colors. Praise be to Allah, I distinguish colors as well as clean socks from used ones. Scent, by the way, has become surprisingly thin.
Okay, 3 colors and 3 digits? Is it possible to come up with a game on such simple terms for 2016 + 6000 year of human existence? Can i. Of course, this puzzle is absolutely not widespread, but among the readers of Habr there are peppers who can play it and even win. It's full of crazy.
So, as the game was born, the code name Crazy Chains, - first there was a field of 3 to 3.

All chips are ordered by color and dignity. Greens 1-2-3. Orange 1-2-3. And blue 1-2-3.
Madly mix all the chips and get this picture.

Now the task is to restore the initial ordered picture in the smallest number of moves. The rule is, you can swap any chips of the same color or the same value.
Everything. Note that to create a game I don’t need to draw pictures - all the chips are displayed with a simple UILabel. The colors I took from the Internet on request are
flat design color set , the font is systemic on the player’s side, the background rounding is done by two operators.
let p: UILabel = itemImage p.layer.backgroundColor = color.CGColor p.layer.cornerRadius = 2
Quickly made a prototype of the game - played - bored. By the end of the day it became uninteresting to play - any deal is going in 20 moves. I tried to increase the board to 4 by 4 and even 5 by 5 (poor eyes!). You learn fast, the game gets boring. And I thought, and maybe allow me to change only 1 chip? How to declare it a transit point. Let's say the bottom right corner. The game is the same, but you can only change the lower right cell to any other of the same color or value.
Began to check for the convergence of the layouts - changed in pairs any two chips. Everything seemed to converge until such an alignment occurred. And here I broke my head.

I fought, fought at him, spat, decided that he was not going. And he began to think about groups and sluggishly change chips - when suddenly, bang, the alignment was formed. I had to strain my brains a lot to learn to think as part of the gameplay, but now I collect any alignment in 22 moves, and, generally speaking, not very much - only 9! .. If you make the game on Android, you can add 4 on 4 and 5 on 5 boards. About 3 on 4 did not think. It may be interesting.
Laid out the game in the store and forgot about it. But suddenly I discovered that my vision had improved a little bit. And you can even pick up glasses for reading. A month later, my eyesight got better again and I changed my glasses to more suitable ones and gored a new game with the size of 5 chips in a row - on the iPhone I now see this resolution without glasses. The game is simple - a mixture of Six Towers and 2048, I called it King Towers and gladly repeated the experiment to create the game without a single picture. To draw stars and faces, I simply used UTF-8 characters.

The code for displaying pictures is pretty simple.
let symb = ["\u{250f}", "\u{2513}", "\u{251b}", "\u{2517}", "\u{2501}", "\u{2503}"] p.text = symb[d]
Primitivism, of course, but isn't this what humanity will come in a couple of years?
See you, brothers)