JavaRush /Java Blog /Random EN /The first project "Sea Battle"!
Kashey
Level 11
Olomouc

The first project "Sea Battle"!

Published in the Random EN group
Hello Javarashovites! I am slowly starting to collect a portfolio, and I present to you my first project “Battleship”. Sources on GitHub compiled here. Explanations and hints in the code are written in a quick hand and most likely with errors. The game has one level of difficulty so far, the computer still shoots randomly, and even when it hits it still continues to hit randomly. While it seems to me that the Battle class is heavily overloaded, maybe it’s worth moving the filling of the field with ships and the printing of fields from it into separate classes? The JCDP library allows you to highlight with color what is printed in cmd or the terminal, only for some reason when using ColoredPrinterWIN in Windows it prints normally, but in IDEA the color is ignored, if you use ColoredPrinter then vice versa)) I will be glad to advice from more experienced programmers on improvements, beauty of the code, identification of possible bugs etc.
Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION