The
Color Lines aka “Balls” game probably doesn’t need a special presentation: the computer floods the 9 * 9 board with balls of different colors, a person can move them around the free cells, arranging them in rows. Rows of 5 or more balls of the same color self-destruct; if this happens after a person’s move, points are awarded to him and another move is given; if in the process of adding from the computer, the glasses self-destruct together with the balls.
The game has a large number of clones, from those included in the delivery of Gnome and KDE to
JavaScript implementations in 30 lines . However, most implementations do not take into account one interesting feature that is present in the original DOS game, and noticeably influences the gameplay.
Experienced players (whose competence did not allow their records to be doubted, much larger than mine) assured that the computer chooses places for new balls is not accidental, but in order to “break” the horizontal and vertical rows and, as a result, recommended concentrating on the alignment of the diagonal rows. It is clear that the natural realization of the choice of place “to take a random field from free” is indifferent to the direction of the rows. What is under the hood of a DOS implementation?
IDA knows everything. It turns out that the choice of a place for a new ball happens like this. First we select a random field from the whole board. If it is free, we take it. If it is occupied - we
go, starting from the selected field, from left to right from top to bottom, until we find a free field . (If we have reached the lower right corner of the board, we continue from the upper left). This method leads to the fact that different free fields get sharply different chances depending on the number of occupied fields in front of them - and fields that continue horizontal rows automatically fall into the risk zone. What about comparing vertical and diagonal rows? I suppose there is a psychological effect here - in the case of diagonal rows, I intuitively want to leave free fields on all sides, in the case of vertical rows, the “obstruction” of fields on the left is perceived normally.
')
* except, for some reason, the lower right corner. There are only two complex things in Computer Science - clearing caches, choosing names and errors per unit.
Have a good Friday!