Skip to content
kraaschPublic

About

An offline chess board for the terminal.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

56 Commits

Folders and files

Repository files navigation

gochess

Demo

The board can be flipped with the flip command.

Features

List of features

  • features.
    • have a console to type commands in, ie 7a5a to move local piece from field 7a to field 5a.
    • implement CLI background color checkered board in black and white.
    • implement CLI foreground colors for pieces (in black and white).
    • add capability to insert new pieces by the user.
    • implement some sort of command to insert a new piece.
    • flip the sides of the board option.

Tasks

List of things to do

  • next.
    • action history (undo, redo).
  • style.
    • allow to set the color of pieces with CLI flags.
    • have a flag for textual mode: RNBQKBNR pppppppp
    • have a flag for graphical mode: RNBQKBNR pppppppp
    • save and load games.

List of ideas

  • misc.
    • implement timer.
    • implement piece value display.
    • implement simple computer player (ie AI enemy).
    • option to customize background colors.
    • option to customize foreground colors.
    • allow new pieces, like the duck (moves everywhere, cannot be beat, blocks all attacks, is moved by both players, duck does not move, if move opens a new attack on the enemy player).
    • allow randomized starting positions.
    • allow randomized piece values (white and black adding up to the same total).
    • allow randomized piece values (white and black adding up to differing totals).
  • check for moves to be legal.
    • have a flag for manual mode: all moves allowed.
    • have a flag for turns mode: moves must follow turns.
    • have a flag for checked mode: all moves must be legal.
    • have a option for turning off castling mode: disallow castling at all.
    • have a option for turning on attacked mode: sallow castling through attacked squares.
    • have a option for turning off en-passant mode: disallow en-passants.
    • have a option for turning off undos mode: disallow undos.
  • add some sort off golang chess engine to deal with all the game logic.

Installation

Install the program:

go install github.com/kraasch/gochess@latest

Get the package:

go get github.com/kraasch/gochess

Usage

Use the program:

make build
./build/gochess --help

Use the package:

import (
  "fmt"
  "github.com/kraasch/gochess"
)

cb := gochess.NewBoard()
cb.Insert("pa6")
cb.Insert("Qa7")
cb.Insert("rh1")
cb.Move("a7a6")
cb.Insert("b8")
out := cb.Display("entire", "pieces")
fmt.Printf("%s", out)

The above code results in the following CLI printout.

Feedback

I can be reached via alex@kraasch.eu.

Contributing

Feel free to help me.

Acknowledgments

Uses the following software:

Made by the following people:

  • see Github info.

License

View the license file.

About

An offline chess board for the terminal.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages