Skip to content

This is a simple implementation of a chess game in Go for learning purposes.

Notifications You must be signed in to change notification settings

sbracegirdle/gochess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gochess

This is a simple implementation of a chess game in Go for learning purposes. It includes the basic rules of chess, including piece movement and game state management.

Files

game.go This file contains the main game logic. It includes the following:

NewGame(player1Name, player2Name string) *Game: This function initializes a new game with two players. It sets up the board and the pieces for each player.

MovePiece(currentX, currentY, newX, newY int) error: This function moves a piece from one position to another. It checks if the move is valid and updates the game state accordingly.

moves.go

This file contains the logic for validating the moves of each piece. It includes the following:

IsValidMove(color PieceColor, currentX, currentY, newX, newY int) error: This function checks if a move is valid for a given piece.

About

This is a simple implementation of a chess game in Go for learning purposes.

Resources

Stars

Watchers

Forks