Someone is embroidering a cross, someone with a toe, and I had such a hobby, although then it became a course work. But the development of the game was carried out entirely on a voluntary basis just for lulz.
I hope the modern generation does not install on obsolete technologies, unlike us, who studied at the turn of the century in the days of graphical interfaces and network technologies and studied Turo Paskal 7.0
However, then the success of Delphi was only upcoming, perhaps this technology was not so old. There was no computer at home, no one will give a sufficient amount of time at the correspondence department of the ess-no education, so the development was conducted at the place of work for almost half a year. Colleague and the only tester Dmitry Rossinsky rendered feasible assistance in finding bugs and prompted ideas for Easter eggs. Sources were later stolen along with a bunch of equipment from the office by unknown persons ..
I knew graph3 and before the sea battle, but the project was decided in text mode on a pseudo-graphic. At that time, I was more interested in computer progress algorithms, ship placement mechanisms and other technical details, rather than pictures. But despite the pseudographics in the game there are dynamic screensavers including starting
Заставка Морской бой from art fainder on Vimeo.
Of course today, when almost any program can be written in Java in 30 lines of code, such a project is not of interest, and spelling errors only serve as an additional stimulus for a smile, but firstly it's just a story about an episode of my youth, and secondly, it is possible , that someone will find interesting solutions in particular with arrays or a timer. Yes, and no one canceled nostalgia.
The game starts with a dynamic splash screen and then the timer is repeatedly used in the game, the speed of which in those times was determined by the clock frequency. not time, because of what the differences were colossal from too slow on old machines to unnecessarily fast on more powerful ones. The problem was solved by replacing the standard delay with its own wait. At startup, the time to milliseconds was checked before and after the start of delay (1000). Thus, having obtained the exact value it was possible to achieve more or less the same speed of timers.
The second problem was the manual placement of the player's ships. this procedure required a serious development, and hands were asked to proceed to the computer, so the first implementation was very primitive and inconvenient and the good placement of the ships was postponed ... but this was not realized. If anyone wants to download and play, I recommend using the automatic placement of the player's ships.
At the start, you can not choose the complexity of the game - it is set to 2 (0-minimal, 9- "impossible"), but its change becomes available after the first passage of the game regardless of whether the player won or not. The complexity is determined by the computer game algorithm. Denote it for convenience - dif.
At the beginning of the new move, the algorithm selects a random number from the interval 0-9 and if this number is less than or equal to the parameter dif, then the coordinates for the shot are also determined randomly. If the number is greater than dif, then the computer will certainly fall into your ship. Also, the computer remembers the history of its moves and fires the neighborhood when hit. A simple, but effective way and on the difficulties of 4 and above to win is really problematic.
The screen shows an ordinary 10 * 10 field and the player can not use cells outside this field. The computer also does not use them. Invisible coordinates were required to mark the already drowned ship. Since the ships can not touch each other according to the rules of the game, the zone in 1 square around the ship should always be free and this should be taken into account both when placing and when attacking. Therefore, having sunk a ship on A1, you know that there can not be a ship on A2, and the algorithm for marking unused cells in addition to A2, B1 uses the previous indices as well (-1 cells in each direction, even if it is the first cell)
Input filtering allows you to use Cyrillic regardless of the layout and register, thus f8, A8, 8F, 8A, etc. are the same coordinates. The remaining keys are ignored. The input function will wait until it receives a set of letters and numbers. You can give a try to play your cat
The game allows you to customize the colors of all game elements. I remember thinking about the setting of the fields, but I refused it. It's unclear why the game process was not saved, or maybe just forgot the reason for abandoning this idea. But one way or another playing on the emulator is unlikely to enjoy the conservation
The game built in a lot of jokes from the "Russian Radio", which were popular at the time. They change from any key. Also after the passage prizes are available in the form of built-in games "Tic-Tac-Toe" and a pair of dynamic screensavers. True, since they were written before the Naval battle and wait there is not yet their dynamics is virtually indistinguishable from statics.
In case of victory, depending on the number of moves, the game opens passwords for some cheats. All passwords open when you win with 23 or less moves
I post the game on Mega in several variants. The simplest is a self-extracting archive with an emulator and a boot floppy image with the game. Start, select an image and play by pressing Control-> Press Ctrl + Alt + Del, i.e. restarting the emulated system
The Russian original of this article
.