Skip to content

JayCesar/java-chess-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bg

GitHub Top Language size banner

♟️ Java Chess System

→ This java chess system runs through the terminal!

Chess is a two-player strategy board game played on a checkerboard consisting of 64 squares of alternating colors. The objective of chess is to checkmate the opponent's king. Checkmate occurs when the king is under attack and has no legal move to escape capture. At the beginning of a game, each player starts with 16 pieces, resulting in a total of 32 pieces on the board.The pieces have specific movement rules, and their positions can influence the game's outcome.


🎮 How to play this game:

Online:

You can play it on my Replit: Obs: it might take a few minutes to load the board and the pieces.

1) Click on the link: Replit Java Chess System

2) Click on the “Run” button

On desktop:

1) First you need to install Java on your computer;

2) You can download or clone this repository to your local computer;

3) Open a terminal interface inside the folder /bin then run the following command:

java application/Program

gif-java-chess-system


▶️ Pieces on this Java Chess System


The Pawn ‘’P” (Peão)

In this game the Pawn is the letter ‘’P”

The Bishop ‘’B” (Bispo)

In this game the Bishop is the letter ‘’B”

The Knight “N” (Cavalo)

In this game the Knight is the letter ‘’L”

The Rook “R” (Torre)

In this game the Rook is the letter ‘’R”

The Queen “Q” (Rainha)

In this game the Queen is the letter ‘’Q”

The King “K” (Rei)

In this game the King is the letter ‘’K”


🧠 How The Chess Pieces Move:


King “K”

Moves one square in any direction: vertically, horizontally, or diagonally.

Queen “Q”

Moves any number of squares diagonally, horizontally, or vertically: in other words, it can move in any direction for any number of squares.

Rook “R”

Moves any number of squares horizontally or vertically: it can move in a straight line either horizontally or vertically for any number of squares.

Bishop “B”

Moves any number of squares diagonally: it can move in a straight line diagonally for any number of squares.

Knight “N”

Moves in an 'L-shape': it moves two squares in a straight direction (horizontally or vertically) and then one square perpendicular to that direction. The knight is the only chess piece that can jump over other pieces.

Pawn “P”

Moves one square forward: it can move one square straight forward towards the opponent's side of the board.

  • On its first move, a pawn can move two squares forward instead of one.
  • Pawn captures diagonally: when capturing an opponent's piece, the pawn moves one square diagonally forward.

📖 Movements:

To move a piece you first need to select it, for that you type the column letter and row number of its position respectively.

For example, to move a pawn, you could enter the letter “d” (column d) and the number 2 (row 2). After that, the possibilities of moves will be highlighted on the board and it's up to you to type again the column letter and the line number of the position you want to move that piece.

Note: if you select something wrong or that restricts the game rules, one will be launched and an exception message will appear to the user.


🎨 Pieces Colors (Yellow and White)

In this game, the black pieces from tradicional chess are represented by the yellow colour and white pieces are represented by white colour.


📝 Chess system design

chess-system-design


📌 Topics covered:

  • Object Oriented Programming (OOP);

  • Constructors;

  • Overriding;

  • Encapsulation;

  • Memory behavior;

  • Enumerations and Composition;

  • Inheritance and Polymorphism;

  • Exceptions;

  • Static members;

  • List;

  • Layers pattern;

  • Overloading.


💻 Developer:

Júlio César
Full-stack Developer

About

[🚧 Project ] This a chess game developed using Java, covering the topics learned thus far along the Nélio Alves' Java/Spring course.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages