From ce1a16d7da89d086d9f6414342476c79fbf4fdfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Jarocki?= Date: Tue, 20 Jun 2023 21:12:54 +0200 Subject: [PATCH] feature: add readme --- .idea/workspace.xml | 29 +++++++++-------------- readme.md | 27 +++++++++++++++++++++ src/com/jarocki/stanislaw/chess/Game.java | 3 ++- src/com/jarocki/stanislaw/chess/Test.java | 4 ++++ 4 files changed, 44 insertions(+), 19 deletions(-) create mode 100644 readme.md diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 7df2d00..17f28c9 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,14 +6,7 @@ - - - - - - - - @@ -59,17 +52,17 @@ - { + "keyToString": { + "RunOnceActivity.OpenProjectViewOnStart": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "last_opened_file_path": "/home/stanlee77/code/stanchezz", + "project.structure.last.edited": "Project", + "project.structure.proportion": "0.0", + "project.structure.side.proportion": "0.0", + "settings.editor.selected.configurable": "editor.preferences.fonts.default" } -}]]> +} diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..59beed5 --- /dev/null +++ b/readme.md @@ -0,0 +1,27 @@ + +# Stanchezz + +Is it a chess? Is it a Stan's chess? Is it a Sanchez's chess? + +It's a OOP project of working chess implemented in Java. + + +## Features + +- castling (long and short). +- en passant. +- check detection. +- pawn promotion to queen. + +- checkmate detection (in progress) + +## Deployment + +To run this project download the repository, compile it and run. +- In Game.java when you grep for "@tests" you'll find section where you can uncomment predefined sets of moves. Try at least one! For default there is none (getNoPredefinedMoves()). +- After the predefined set of moves run you can start type your own - the input format is e.g. "e2 e4". + +## Author + +[@Stanisław Jarocki](https://www.github.com/stanlee77) + diff --git a/src/com/jarocki/stanislaw/chess/Game.java b/src/com/jarocki/stanislaw/chess/Game.java index 2dc8888..d89aff9 100644 --- a/src/com/jarocki/stanislaw/chess/Game.java +++ b/src/com/jarocki/stanislaw/chess/Game.java @@ -21,6 +21,7 @@ public class Game { // for @tests int iteration = 0; + String[] testMoves = Test.getNoPredefinedMoves(); // String[] testMoves = Test.getOnlyPawnsOpening(); // String[] testMoves = Test.getWrongPawnMoves(); // String[] testMoves = Test.takeQueenOut(); @@ -30,7 +31,7 @@ public class Game { // String[] testMoves = Test.takeKingOut(); // String[] testMoves = Test.getCastlingMoves(); // String[] testMoves = Test.getPawnPromotion(); - String[] testMoves = Test.getOpeningMoves(); +// String[] testMoves = Test.getOpeningMoves(); // end of tests while(getIsGameOn()) { diff --git a/src/com/jarocki/stanislaw/chess/Test.java b/src/com/jarocki/stanislaw/chess/Test.java index a12ef58..6def0a7 100644 --- a/src/com/jarocki/stanislaw/chess/Test.java +++ b/src/com/jarocki/stanislaw/chess/Test.java @@ -24,6 +24,10 @@ public class Test { }; } + static public String[] getNoPredefinedMoves() { + return new String[]{}; + } + static public String[] takeRookOut() { return new String[]{ "h2 h4", "g7 g5",