Skip to content

effekt-community/EffektChess

 
 

Repository files navigation

Note

This is a community-maintained fork of a MIT-licensed student project in the Effective Programming with Effects course in winter semester 2024/2025. Be warned that this is not an officially endorsed project, the code in this repository may be not idiomatic Effekt.

The original repository is https://github.com/zaryar/EffektChess

Chess Puzzle Trainer in Effekt

Tests

A chess puzzle trainer implemented in Effekt, a research programming language that supports algebraic effects and handlers.

must-have

  • Find a puzzle better than 90 and select one randomly.
  • Parse FEN Notation
  • Display Board as ASCII
  • User Input Validation (Accept user moves in algebraic notation)
  • Check if the user’s move matches the correct solution.
  • if yes: the opponent moves
  • if no: get 3 chances

can-have

  • Better way to see the current state of the board / better way to input his move.
  • Filter by Rating (difficulty)
  • Progression system: Like you start by only being able to do simple puzzles; if you solve 10, you unlock harder puzzles, and so on.

Will-not-have

  • Online Multiplayer
  • AI Opponent
  • Advanced Chess Analytics/Feedback

Effects and handlers

  • InvalidMove

  • InvalidPuzzle

  • PuzzleWon

  • PuzzleLost

  • IOError

  • OutOfBounds

FFI and libraries

  • string - String manipulation
  • option - Optional values
  • list - List operations
  • io - File operations
  • exception - Error handling
  • Chess puzzles from Lichess

How to use

  1. Install Effekt following the official instructions
  2. Clone this repository
# Run game
effekt src/main.effekt

# Run tests
effekt src/test.effekt

Features

  • Simple Viewer:
    • View board from both white and black's perspective
    • Show the last move from the enemie
    • Put in your move with algebraic notation.
  • Progress System:
    • Unlock harder puzzles by solving easier ones
    • Lose progress when failing puzzles
  • Settings:
    • Remove already played puzzles.
    • Hardcore Mode ( One chance per move ) / Nomal mode, you get a tipp after you make a mistake
  • Effect-based Error Handling:
    • Invalid puzzle handling
    • Move validation
    • Game state management

Acknowledgements

Chess puzzles are from lichess.org and are available under the Creative Commons CC0 license.

About

originally zaryar/EffektChess

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Nix 100.0%