📜 ⬆️ ⬇️

Contest results

So, here are the results of our last contest . Thanks to everyone who participated.
In principle, the task was not complicated at all (it was planned like this) and 56 people coped with it. Here are the names of the people who did this first:



Under the cut, you can find a solution to the problem and related links.

')
So, the problem is in the picture . Download the picture and consider. Zoom By the way, speaking, it matters what it is to zoom. For example, Paint zumit this picture correctly, but Irfan View and the standard viewer from the Microsoft Office package are beginning to "fantasize" and their "vision" of this picture could make it very difficult to determine what, strictly speaking, we see here.



Looking closely at the version enlarged in Paint, we see some vaguely familiar figures of dots. What is it, where did I see it? Surely! In the picture above, the classic “glider” (or “glider”) from the game “Life” is a no less classic example of a cellular automaton.



Another hint of the game "Life" was the placement of the topic in the hub "Game Development" - well, not because of the type of prizes, he was there. Accordingly, the entire picture as a whole probably represents the state of the population at some point in time. The most logical in this place of reasoning would be to transfer it from the image to some program that allows you to start the generation process of the next generations and watch what is happening. True Jedi in this place could write their own parser png-files and their implementation of "Life". Slightly more practical people would convert png to bmp (it is easier to parse it anyway), read it and get an array that can be fed to any of the existing game implementations. And quite lazy (in a good sense of the word) could suggest that, probably, there are already implementations capable of opening graphic files with populations and launching them. And such programs really exist. One of the best is Golly . It calmly opens the proposed image and this is what we see when starting the generation of the next generations:



And here is the text - " HI TO @INFOPULSE_UKR FROM #HABR! "

Now a couple of explanations to what is happening on the screen. We already know what a “glider” is (see above). It is from the gliders and the text consists, the movement of which we see on the screen.

However, how did the text? Again, a “glider gun” was invented quite a while ago - a figure capable of generating an infinite number of gliders by firing them into space. The first guns simply generated a stream of gliders.



What we see in this case is a modification of the standard gun, called the “Golly-gun” (at least this figure I first met under this name). It allows you to generate a stream of gliders with gaps, which are determined by the number and position of the gliders in the "magazine" - the initial state of the gun. In fact, we have a binary code. On the website of the previously mentioned Golly program in the header you can see an example of such a gun.



But how to write a free text? Manually create such a gun for a very long time. Fortunately, this is not necessary. First, there is a ready-made shotgun template with a “full magazine”. You can take it and simply remove the extra gliders, getting gaps in the generated flows. Secondly, you can not do this - there is a Ruby script that allows you to generate a gun for a specific text. It was he who was used to prepare this task. It's simple, right?

Congratulations to the winners - in order to agree on the receipt of the prizes, please contact me (via the Habr lichku or mail tangrofromhabr \\ gmail.com (\\ = @)).

Thanks to all who are interested - I hope you liked the task.

Source: https://habr.com/ru/post/141755/


All Articles