Git Product home page Git Product logo

chess-tui's Introduction

About Me

Hi there, I'm Thomas Mauran, a passionate apprentice computer science engineer. When I'm not immersed in code, you can find me exploring the latest in technology or enjoying the night sky through my telescope 🌌

  • 🌱 I’m currently learning rust

  • πŸ”­ All of my projects are available on github or on my portfolio

  • πŸ“« How to reach me Linkedin

Skills

Dev: Rust, TypeScript, Python, C, Go, Kotlin, Java

Ops: Kubernetes, Docker, Github Action, Grafana, ArgoCD, Helm

Frameworks / Libs: React, VueJS, NestJS

Databases: Postgresql, MongoDB, Elasticsearch

OS: Ubuntu, Debian, Mac OS

GitHub Stats

GitHub Stats GitHub Streak

chess-tui's People

Contributors

0323pin avatar charley04310 avatar jeromeschmied avatar jhauris avatar joshka avatar kuruyia avatar nicholasmello avatar orhun avatar psnehanshu avatar rustmilian avatar thomas-mauran avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

chess-tui's Issues

fix(historic): line 8 is translated to 0

Description

When moving a piece from the 8th row (black first one) the historic indicates a 0 instead of an 8.

To Reproduce

  • move a piece from the 8th row and check the historic

Expected behavior

display 8 instead of 0

Screenshots

image

Movement through history

It would be nice to go back and forward throughout history to look through the moves. This feature would go nicely with #25 to look through a game you have imported.

feat: pgn import

Import a pgn game position

Be able to select a file to import as a new game position

feat(board): make border transparent

Problem

the boards automatically creates border for the cells to be the same size, but the borders arenΒ΄t looking great everytime

Solution

We could use cross term to get the color of the terminal and set in ui the border color to this background color

KeyEvents are reported twice Windows

Description

KeyEvents are reported twice Windows as Windows reports a KeyPress and a KeyRelease.
Therefore everything acts strangely, the app is unused.

To Reproduce

You could try this app on Windows 10/11 or maybe anything else, but as it might be impossible, you could believe me.

Expected behavior

Check whether a KeyEvent is a KeyPress and if not, ignore.

Screenshots

Environment

  • OS: Windows 11
  • Terminal Emulator: windows terminal
  • Crate version: git main
  • Backend: crossterm

Material difference

Problem

Material difference is not shown.

Solution

Display material difference in History.

Additional context

I guess Lichess has support for this too.

Error : No such file or directory

Tried to use the docker image, and see this error in the logs.
Are any volume mappings necessary for this to work ?

Am I correct to assume that I will be able to play the game via browser if the container is up and running ?
I dont see a mention of any ports, so I assume its port 80 by default ?

Error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
Error: Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }
Error: Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }
Error: Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }
Error: Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }

Add "Escape" event to helper menu

Problem

First try, I didn't know how to deselect the piece selected by mistake.

Solution

Add this following line into ui.rs:

Line::from("ESCAPE : Deselect a piece or cancel a move"),
``

3 fold repetition

Description

3 fold repetition only checks moves in a row, it should check if the position repeats regardless of order

To Reproduce

Play a game and repeat the position, outside of the same order

Expected behavior

Draw in all repetition scenarios

Environment

OS: Linux (NixOS)
Terminal Emulator: Alacritty

Additional context

This function just needs to be rewritten

    pub fn draw_by_repetition(&self) -> bool {
        if self.move_history.len() >= 9 {
            let last_ten: Vec<PieceMove> =
                self.move_history.iter().rev().take(9).cloned().collect();

            if (last_ten[0].clone(), last_ten[1].clone())
                == (last_ten[4].clone(), last_ten[5].clone())
                && last_ten[4].clone() == last_ten[8].clone()
                && (last_ten[2].clone(), last_ten[3].clone())
                    == (last_ten[6].clone(), last_ten[7].clone())
            {
                return true;
            }
        }
        false
    }

Config file storage

Description

As for now, the config file (containing chess-engine path) seems to be stored under $HOME/.chess-tui.

Expected behavior

It would be a lot better to store it under $HOME/.config/chess-tui/chess-engine.toml or something. The dirs crate fits the purpose to resolve this issue I think.

Environment

  • OS: Arch Linux
  • Terminal Emulator: Alacritty
  • Font: Recursive (patched)
  • Crate version: latest git
  • Backend: crossterm

feat: board turn

Problem

Be able to play as black

Solution

Implement it and be sure to remove all the hardcoded white values

feat: home menu

Home menu

Implement a home menu when starting the game with the following options:

  • New game
  • Play against a bot
  • Import a game

Takeback

Problem

Sometimes enter gets pressed accidentally, which is kind of annoying.

Solution

A character like backspace could be assigned to takeback.

Additional context

As far as I'm concerned lichess has a feature like this too, so it is useful when lichess integration is done.

Keyboard shortcuts for moves

Problem

You have to manually select a square to move a piece, which is a bit tedious.

Solution

It would be good to be able to quickly use the keyboard for this (e.g a5 or Nc3).

feat: pgn export

Implement a pgn export method

Solution

  • Create a new method to convert move_history into pgn
  • store it into a file

Ascii mode

Problem

Old school ascii mode, just like in gnuchess. The player has uppercase letters and the enemy has lowercase letters.
p = pawn, k = king, q = queen, b = bishop, r = rook, n = knight

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.