Skip to content

christianfernandesprofissional/terminal_chess_java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Versões/Versions: Português , English

XADREZ DE TERMINAL ♔ ♕ ♖ ♗ ♘ ♙

O projeto do Xadrez de terminal, foi feito para me ajudar no desenvolvimento de habilidades com Programação Orientada a Objetos utilizando a linguagem Java. No projeto estão contidos todos os pilares da programação (Abstração, Polimorfismo, Encapsulamento e Herança) .


Tecnologias utilizadas

  • JAVA 21
  • Eclipse IDE

Requisitos

  • Java JDK

Como rodar na sua máquina?

  • No terminal do seu computador clone o repositório usando o comando abaixo na pasta desejada:

      git clone https://github.com/christianfernandesprofissional/terminal_chess_java.git
    
  • Após a clonagem entre vá em:

        .\terminal_chess_java\src\application  
    
  • Copie o arquivo Program.java para

        .\terminal_chess_java\src
    
  • Abra o terminal nesta pasta e digite o comando:

        javac Program.java
    
  • Logo após, o jogo estará pronto para ser iniciado, para iniciar o jogo digite:

        java Program.java
    


Como o jogo funciona?

No jogo é possível jogar com dois jogadores, seguindo todas as regras contidas no xadrez, inclusive regras adicionais que são menos conhecidas como o Roque e o En Passant.
As peças do jogo estão representadas pela letra do seu nome em inglês, sendo Peão (P), Cavalo (N), Bispo (B), Torre (R), Rainha (Q), Rei (K).

Game Start

As peças pretas são representadas na cor verde para um melhor contraste.

Para jogar, o jogador deve primeiro selecionar a coordenada da peça que deseja mover, que é a letra que representa a linha onde a peça está, e um número correspondente a coluna.

Game Start Game Start

Após a seleção da peça o jogo irá mostrar os movimentos possíveis com aquela peça, na cor azul.
Caso o jogador selecione um movimento inválido a jogada voltará ao início. As peças capturadas durante a partida serão mostradas em baixo dentro dos colchetes.

Game Start

Caso ocorra um CHEQUE na partida, o jogo anunciará em vermelho, e enquanto o jogador não fizer movimentos que o livrem do CHEQUE, todos os outros movimentos serão inválidos.

Game Start

O jogo também impede que o jogador se coloque em CHEQUE, e caso o rei esteja nessa situação ele é obrigado a se defender.

Game Start


Caso a defesa não seja possível, ocorre um CHEQUE-MATE, e o jogo acaba.

Game Start


Espero que você se divirta! 😃

Caso você tenha alguma sugestão de melhoria ou algum comentário sobre o jogo,
sinta-se livre para entrar em contato através do email: [email protected].




TERMINAL CHESS ♔ ♕ ♖ ♗ ♘ ♙

The Terminal Chess project was designed to help me develop skills with Object Oriented Programming using the Java language. The project contains all the pillars of programming (Abstraction, Polymorphism, Encapsulation and Inheritance).


Technologies used

  • JAVA 21
  • Eclipse IDE

Requirements

  • Java JDK

How to run it on your machine?

  • In your computer's terminal, clone the repository using the command below in the desired folder:

      git clone https://github.com/christianfernandesprofissional/terminal_chess_java.git
    
  • After cloning, go to:

        .\terminal_chess_java\src\application  
    
  • Copy the Program.java file to:

        .\terminal_chess_java\src
    
  • Open the terminal in this folder and type the command:

        javac Program.java
    
  • Soon after, the game will be ready to start, to start the game type:

        java Program.java
    

How does the game work?

In the game it is possible to play with two players, following all the rules contained in chess, including additional rules that are less known such as Castling and En Passant.
The game pieces are represented by the letter of their name in English, being Pawn (P), Knight (N), Bishop (B), Rook (R), Queen (Q), King (K).

Game Start

The black pieces are represented in green for better contrast.

To play, the player must first select the coordinate of the piece they want to move, which is the letter that represents the line where the piece is, and a number corresponding to the column.

Game Start Game Start

After selecting the piece, the game will show the possible movements with that piece, in blue.
If the player selects an invalid move, the move will return to the beginning. The pieces captured during the game will be shown below within the brackets.

Game Start

If a CHECK occurs in the match, the game will announce it in red, and as long as the player does not make moves that free him from the CHECK, all other moves will be invalid.

Game Start

The game also prevents the player from putting himself in CHECK, and if the King is in this situation he is forced to defend himself.

Game Start


If the defense is not possible, a CHECKMATE occurs, and the game ends.

Game Start


Hope you have fun! 😃

If you have any suggestions for improvements or comments about the game, feel free to get in touch via email: [email protected].



About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages