This repository was archived by the owner on Oct 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Tatiana_Dzenzura #34
Open
tmandreeva1
wants to merge
35
commits into
master
Choose a base branch
from
feature/TatianaDzenzura
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Tatiana_Dzenzura #34
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
a09f13c
master stuff returned back to compilable
tmandreeva1 2b15633
homework_1's done
tmandreeva1 591f8fe
Merge remote-tracking branch 'origin/master' into feature/TatianaDzen…
tmandreeva1 e9f4c14
README.md added
tmandreeva1 d487f32
different streams output fixed
tmandreeva1 b7b3c70
style hm1 fixed
tmandreeva1 b3fa7aa
white spaces hm1 fixed
tmandreeva1 9d12265
HM2 traffic light added
tmandreeva1 4a7ce6d
HM2 pyramid printer added
tmandreeva1 e1ab4b2
HM2 traffic light refactored
tmandreeva1 4c05ca0
HM2 random char table added
tmandreeva1 74c907e
HW2 README.md changed for hw2
tmandreeva1 d532415
HW2 refactored as required in HW3
tmandreeva1 4c37a38
Merge remote-tracking branch 'origin/master' into feature/TatianaDzen…
tmandreeva1 ef2cbb5
HW2 fixed style issues
tmandreeva1 fab3075
HW3 Immutable class and test added
tmandreeva1 6b543ca
HW3 README.md updated
tmandreeva1 4bda0da
HW4 CustomFileReader with tests added
tmandreeva1 40d6fd5
HW4 Singleton with tests added
tmandreeva1 94a4ebb
HW4 CustomAnnotation with tests added
tmandreeva1 c971308
HW4 README.md updated
tmandreeva1 114b259
HW5 done (by verbal task description)
tmandreeva1 8c050c3
HW5 README.md updated
tmandreeva1 7869122
HW5 change PowerOfNumber according to written task in teams
tmandreeva1 dd78016
HW5 custom regex matcher done
tmandreeva1 0240b4a
HW6 done
tmandreeva1 1666f86
Course project basics, setting ships
tmandreeva1 4f9da66
main functionality implemented
tmandreeva1 1653fe4
HW 7 done
tmandreeva1 1c7b420
HW 7 done (added forgotten file)
tmandreeva1 4129cf9
Course Project Tests added
tmandreeva1 2a48d11
Course Project refactored a bit
tmandreeva1 a86d72c
Course Project local README.md added
tmandreeva1 1844e26
Course Project README.md updated
tmandreeva1 48f1050
Course Project ui simplified and more convenient
tmandreeva1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,30 @@ | ||
| # Java Core June 2021 | ||
|
|
||
| ## *Nikolaev Artem* | ||
| ## *Dzenzura Tatiana* | ||
|
|
||
| | Number | Solution | Short description | ||
| | --- | --- | --- | | ||
| | HW1 | [Console printer](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/master/src/main/java/homework_1) | The app that reads input arguments and prints them, until "error" argument | | ||
| | HW 1 | [Console printer](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/main/java/homework_1) | The app that reads input arguments and prints them, until "error" argument | | ||
| | HW 2.1 | [Traffic light](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/main/java/homework_2/traffic_light) | The app that reads number of seconds from the beginning of the day from the console and calculates color of the traffic light | | ||
| | HW 2.2 | [Pyramid printer](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/main/java/homework_2/pyramid_printer) | The app that prints pyramid of 'x' chars based on user input | | ||
| | HW 2.3 | [Random Chars Table](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/main/java/homework_2/random_chars_table) | The app that reads length, width and strategy from the console and generates table of random chars and prints even/odd letters according to strategy | | ||
| | HW 3 | [Immutable Class Cat](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/main/java/homework_3) | The app that reads length, width and strategy from the console and generates table of random chars and prints even/odd letters according to strategy | | ||
| | HW 4.1 | [Custom File Reader](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/main/java/homework_4/custom_file_reader) | Class with three read-from-file approaches implementations: BufferedReader, NIO, Scanner | | ||
| | HW 4.2 | [Singleton](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/main/java/homework_4/singleton) | Singleton pattern implementation | | ||
| | HW 4.3 | [Custom Annotation](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/main/java/homework_4/custom_annotation) | Custom annotation and its use with class cat | | ||
| | HW 5.1 | [Power of Number](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/main/java/homework_5/power_of_number) | Power function implementation with recursion | | ||
| | HW 5.2 | [Custom Regex Matcher](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/main/java/homework_5/custom_regex_matcher) | Custom regex matcher to check passport data of Russian Federation citizen | | ||
| | HW 6 | [MapProblemsGenerator](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/main/java/homework_6) | Map problems generators | | ||
| | HW 7 | [KittenToCatFunction](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/main/java/homework_7) | KittenToCat Functional Interface | | ||
| | Course Project | [Sea Battle Course project](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/main/java/course_project) | Sea Battle Course Project | | ||
| | | | | | ||
| | Tests HM 1 | [Tests for HM 1 Console Printer](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/test/java/homework_1) | JUnit tests for console printer from homework 1 | | ||
| | Tests HW 2 | [Tests for HM 2 Traffic Light, Pyramid Printer and Random Chars Table](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/test/java/homework_2) | JUnit tests for apps from homework 2 | | ||
| | Tests HW 4 | [Tests for HM 4 Custom File Reader, Singleton and Custom Annotation](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/test/java/homework_4) | JUnit tests for apps from homework 4 | | ||
| | Tests HW 5 | [Tests for HM 5 Power of Number, Custom Regex Matcher](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/test/java/homework_5) | JUnit tests for app from homework 5 | | ||
| | Tests HW 7 | [Tests for HM 7 KittenToCat](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/test/java/homework_7) | JUnit tests for app from homework 7 | | ||
| | Tests HW 7 | [Tests for course project](https://github.com/NikolaevArtem/Java_Core_June_2021/tree/feature/TatianaDzenzura/src/test/java/course_project) | JUnit tests for course project | | ||
|
|
||
| [Link to markdown giude](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) | ||
| [Link to markdown guide](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) | ||
|
|
||
| [Link to CodingBat](https://codingbat.com/done?user=tatiana22d@gmail.com&tag=53255552) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| package course_project; | ||
|
|
||
| import course_project.sea_battle.Game; | ||
| import homework_2.WrongInputException; | ||
|
|
||
| import java.io.IOException; | ||
|
|
||
| public class GameLauncher { | ||
|
|
||
| void launch() { | ||
| try { | ||
| new Game().play(); | ||
| } catch (InterruptedException | IOException | WrongInputException e) { | ||
| System.out.println(e.getMessage()); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package course_project; | ||
|
|
||
| public class Main { | ||
| public static void main(String[] args) { | ||
| new GameLauncher().launch(); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <h1>Sea Battle Game</h1> | ||
| <br> | ||
|
|
||
| Sea Battle Game project for Java Core June 2021. | ||
|
|
||
| Please, input 'letter minus digit' without spaces for the correct cell data. <br> | ||
| Example of the correct input: <br>A-3<br>B-9<br>... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| package course_project.sea_battle; | ||
|
|
||
| import course_project.sea_battle.input_readers.InputConsoleReader; | ||
| import course_project.sea_battle.input_readers.InputFileReader; | ||
| import course_project.sea_battle.players.ComputerPlayer; | ||
| import course_project.sea_battle.players.HumanPlayer; | ||
| import course_project.sea_battle.players.Player; | ||
| import homework_2.WrongInputException; | ||
|
|
||
| import java.io.FileNotFoundException; | ||
| import java.io.IOException; | ||
|
|
||
| public class Game { | ||
| private final Player player; | ||
| private final Player computer; | ||
|
|
||
| private final InputConsoleReader inputConsoleReader; | ||
| private final InputFileReader inputFileReaderComp; | ||
| private final InputFileReader inputFileReaderPlayer; | ||
|
|
||
| public Game() throws FileNotFoundException { | ||
| this.inputConsoleReader = new InputConsoleReader(); | ||
| try { | ||
| this.inputFileReaderComp = new InputFileReader("computer_ships_sets"); | ||
| this.inputFileReaderPlayer = new InputFileReader("computer_ships_sets"); | ||
| } catch (FileNotFoundException e) { | ||
| throw new FileNotFoundException("Input files might be damaged. Please look at resources folder"); | ||
| } | ||
|
|
||
| this.player = new HumanPlayer(inputFileReaderPlayer, inputConsoleReader); | ||
| this.computer = new ComputerPlayer(inputFileReaderComp); | ||
| } | ||
|
|
||
| public void play() throws InterruptedException, IOException, WrongInputException { | ||
| System.out.println("Hi there, ready to play?"); | ||
| Player winner; | ||
|
|
||
| try { | ||
| Gameplay gameplay = new Gameplay(player, computer); | ||
| gameplay.setShips(); | ||
|
|
||
| // gameplay.printPlaygrounds(); | ||
|
|
||
| winner = gameplay.getWinner(); | ||
| gameplay.printCongratsToWinner(winner); | ||
|
|
||
| } catch (IOException e) { | ||
| throw new IOException("Please check input files in resources folder", e); | ||
| } catch (InterruptedException e) { | ||
| throw new InterruptedException("Couldn't simulate computer thinking, it got interrupted"); | ||
| } finally { | ||
| try { | ||
| inputConsoleReader.close(); | ||
| inputFileReaderComp.close(); | ||
| inputFileReaderPlayer.close(); | ||
| } catch (IOException e) { | ||
| throw new IOException("Couldn't manage to close resources", e); | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| package course_project.sea_battle; | ||
|
|
||
| import course_project.sea_battle.players.ComputerPlayer; | ||
| import course_project.sea_battle.players.HumanPlayer; | ||
| import course_project.sea_battle.players.Player; | ||
| import course_project.sea_battle.playground.CellData; | ||
| import course_project.sea_battle.utils.ShotResultCode; | ||
| import homework_2.WrongInputException; | ||
|
|
||
| import java.io.IOException; | ||
|
|
||
| public class Gameplay { | ||
| private final Player player; | ||
| private final Player computer; | ||
|
|
||
| public Gameplay(Player player, Player computer) { | ||
| this.player = player; | ||
| this.computer = computer; | ||
| } | ||
|
|
||
| public void setShips() throws IOException, WrongInputException, InterruptedException { | ||
| player.setShips(); | ||
|
|
||
| System.out.println("Setting ships for computer and you...\n"); | ||
| computer.setShips(); | ||
|
|
||
| //imitating AI thinking while setting ships | ||
| Thread.sleep(2000); | ||
| } | ||
|
|
||
| public void printPlaygrounds() { | ||
| System.out.println("Computer's playground:"); | ||
| System.out.println(computer.getPlayground().toStringOthers()); | ||
| System.out.println("Your playground:"); | ||
| System.out.println(player.getPlayground().toStringMine()); | ||
| } | ||
|
|
||
| public Player getWinner() throws IOException, WrongInputException, InterruptedException { | ||
| while (true) { | ||
| makeMove(player, computer); | ||
| if (computer.isLoser()) { | ||
| return player; | ||
| } | ||
|
|
||
| makeMove(computer, player); | ||
|
|
||
| if (player.isLoser()) { | ||
| return computer; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| private void makeMove(Player p1, Player p2) throws IOException, WrongInputException, InterruptedException { | ||
| while (true) { | ||
| if (p1 instanceof HumanPlayer) { | ||
| printPlaygrounds(); | ||
| } | ||
| System.out.println("\n======= " + p1.toStringWhose() + " MOVE ======="); | ||
|
|
||
| CellData cellData = p1.makeMove(); | ||
| ShotResultCode code = p2.checkOwnField(cellData); | ||
|
|
||
| if (p1 instanceof ComputerPlayer) { | ||
| System.out.println("Computer made a move: " + cellData); | ||
| System.out.println(code); | ||
| Thread.sleep(2000); | ||
| } else { | ||
| System.out.println(code); | ||
| } | ||
|
|
||
| if (code == ShotResultCode.MISS || p2.isLoser()) { | ||
| break; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| public void printCongratsToWinner(Player winner) { | ||
| System.out.println("\n\n********************"); | ||
| System.out.println(" " + winner + " WIN!"); | ||
| System.out.println("********************"); | ||
| } | ||
| } |
29 changes: 29 additions & 0 deletions
29
src/main/java/course_project/sea_battle/input_readers/InputConsoleReader.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package course_project.sea_battle.input_readers; | ||
|
|
||
| import course_project.sea_battle.playground.CellData; | ||
| import homework_2.WrongInputException; | ||
|
|
||
| import java.io.*; | ||
|
|
||
| public class InputConsoleReader extends InputReader { | ||
| private BufferedReader br; | ||
|
|
||
| public InputConsoleReader() { | ||
| super("Can't parse input. Please, follow the format: [char A-J]-[integer 1-10]"); | ||
|
|
||
| // temporary reading user ships set from file (for quick debugging and testing) | ||
| // br = new BufferedReader(new FileReader(new File("src/main/resources/course_project/sea_battle.txt"))); | ||
| br = new BufferedReader(new InputStreamReader(System.in)); | ||
| } | ||
|
|
||
| @Override | ||
| public CellData readShotData() throws WrongInputException, IOException { | ||
| String input = br.readLine(); | ||
| return parseInput(input); | ||
| } | ||
|
|
||
| @Override | ||
| public void close() throws IOException { | ||
| br.close(); | ||
| } | ||
| } |
32 changes: 32 additions & 0 deletions
32
src/main/java/course_project/sea_battle/input_readers/InputFileReader.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package course_project.sea_battle.input_readers; | ||
|
|
||
| import course_project.sea_battle.playground.CellData; | ||
| import course_project.sea_battle.utils.RandomGenerator; | ||
| import homework_2.WrongInputException; | ||
|
|
||
| import java.io.*; | ||
|
|
||
| public class InputFileReader extends InputReader { | ||
| private final int NUMBER_OF_COMPUTER_SHIPS_SETS = 3; | ||
| private final BufferedReader br; | ||
|
|
||
| public InputFileReader(String pack) throws FileNotFoundException { | ||
| super("Can't set computers ships. Check resource folder for sets text files."); | ||
| br = new BufferedReader(new FileReader("src/main/resources/course_project/" + pack + "/" + getFileName())); | ||
| } | ||
|
|
||
| @Override | ||
| public CellData readShotData() throws WrongInputException, IOException { | ||
| String input = br.readLine(); | ||
| return parseInput(input); | ||
| } | ||
|
|
||
| @Override | ||
| public void close() throws IOException { | ||
| br.close(); | ||
| } | ||
|
|
||
| private String getFileName() { | ||
| return "set" + RandomGenerator.getRandomInRange(1, NUMBER_OF_COMPUTER_SHIPS_SETS) + ".txt"; | ||
| } | ||
| } |
40 changes: 40 additions & 0 deletions
40
src/main/java/course_project/sea_battle/input_readers/InputReader.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| package course_project.sea_battle.input_readers; | ||
|
|
||
| import course_project.sea_battle.playground.CellData; | ||
| import homework_2.WrongInputException; | ||
|
|
||
| import java.io.IOException; | ||
|
|
||
| public abstract class InputReader { | ||
| private final String ERROR_MSG; | ||
|
|
||
| protected InputReader(String error_msg) { | ||
| ERROR_MSG = error_msg; | ||
| } | ||
|
|
||
| public abstract void close() throws IOException; | ||
|
|
||
| public abstract CellData readShotData() throws WrongInputException, IOException; | ||
|
|
||
| protected CellData parseInput(String input) throws WrongInputException { | ||
| try { | ||
| String[] data = input.split("-"); | ||
| if (data.length != 2) { | ||
| throw new WrongInputException(ERROR_MSG); | ||
| } | ||
| if (data[0].length() != 1) { | ||
| throw new WrongInputException(ERROR_MSG); | ||
| } | ||
|
|
||
| char line = data[0].charAt(0); | ||
| int col = Integer.parseInt(data[1]); | ||
|
|
||
| if (col < 1 || col > 10) { | ||
| throw new WrongInputException(ERROR_MSG); | ||
| } | ||
| return new CellData(line, col); | ||
| } catch (NumberFormatException e) { | ||
| throw new WrongInputException(ERROR_MSG); | ||
| } | ||
| } | ||
| } |
51 changes: 51 additions & 0 deletions
51
src/main/java/course_project/sea_battle/players/ComputerPlayer.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| package course_project.sea_battle.players; | ||
|
|
||
| import course_project.sea_battle.input_readers.InputFileReader; | ||
| import course_project.sea_battle.playground.CellData; | ||
| import course_project.sea_battle.playground.Playground; | ||
| import course_project.sea_battle.ships.Ship; | ||
| import course_project.sea_battle.ships.ShipType; | ||
| import homework_2.WrongInputException; | ||
| import lombok.Getter; | ||
|
|
||
| import java.io.IOException; | ||
|
|
||
| @Getter | ||
| public class ComputerPlayer extends Player { | ||
|
|
||
| private final Playground playground; | ||
|
|
||
| public ComputerPlayer(InputFileReader inputReader) { | ||
| super(inputReader); | ||
| this.playground = new Playground(); | ||
| } | ||
|
|
||
| @Override | ||
| public void setShips() throws IOException, WrongInputException { | ||
| final int SHIP_AMOUNT = 5; | ||
| Ship[] ships = new Ship[SHIP_AMOUNT]; | ||
|
|
||
| for (int i = 0; i < SHIP_AMOUNT; i++) { | ||
| ships[i] = new Ship(ShipType.values()[i], playground); | ||
| new Helper().setShip(ships[i]); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public CellData makeMove() { | ||
| // TODO: might be some more complex logic | ||
| // check if it is hit or missed at least | ||
| CellData cellData = CellData.generateCellData(); | ||
| return cellData; | ||
| // return RandomGenerator.getRandomCellData(); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "COMPUTER"; | ||
| } | ||
|
|
||
| public String toStringWhose() { | ||
| return "COMPUTER'S"; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's pretty uncomfortable to play... especially to put ships. Also, what rules did you use? I strongly remember there should be 1 4-cells ship and 4 1-cell ships...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rules: https://www.hasbro.com/common/instruct/Battleship.PDF
Also, we were free to choose ui, as I remember
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of wrong input app shuts down...

Hitting the same cell is allowed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interface is nice though, but the app is buggy. I'm sorry I can't accept that