JavaRush /Java Blog /Random EN /Battleship and Swing
zor07
Level 31
Санкт-Петербург

Battleship and Swing

Published in the Random EN group

Good day

While still a schoolboy and learning programming from a tutor (Pascal), like everyone else, I wanted to write a toy. With a tutor, I wrote a console game Bulls and Cows, but the bloated emergency required something more serious. The choice settled on a naval battle. I started writing it in Pascal. The plans included a console game in which the computer simply tells the player the address of the cell at which he is shooting, and the player, in turn, tells the computer the address of his cell. Everything then stalled because I couldn’t teach the computer to “finish off” wounded ships, and I didn’t want to finish writing a game in which the computer randomly shoots across the field. 9 years passed, I discovered javarush, at level 21 the emergency woke up and demanded a sea battle. The main goals were:
  • Availability of interface
  • Adequate shooting of the computer (it should finish off wounded ships)
I achieved the first goal with the help of the Swing library. And the second with the help of the CrutchBicycleAndFaithInGod library. I suggest everyone who is interested try this Frankenstein on GitHub . I must admit, I’m dissatisfied with the quality of the code myself, but I don’t know how to do it better yet. So I would appreciate constructive criticism and any comments. Thanks to all!
Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION