Giter Club home page Giter Club logo

puzzle-chess's Introduction

Puzzle โ™Ÿ Chess

A simple chess game where you solve puzzles.

๐Ÿ’ป Technology

Built with basic HTML, CSS, and JavaScript.

๐Ÿชถ Philosophy

I try to write code that beginners can understand. Keep everything simple. Avoid being overly complex or caring too much about optimization.

๐Ÿ•น๏ธ Game Details

  • players start at a rating of 400 when starting a new game
  • solving or failing a puzzle will change the player rating
    • up to a maximum of +/- 32, based on the puzzle difficulty
  • player rating is stored via localStorage
  • puzzles are selected randomly from within +/- 100 the player rating
  • in order to support offline play, approximately ~2 MB of puzzles
    • stored in /puzzles/offline/puzzles.csv
    • range in difficulty from 400 to 3166
    • puzzles were selected from Lichess Open Database
  • in a future update, support for the Lichess.org API is planned
    • this will enable use of the entire puzzle database
  • pawn promotion is supported
    • but the piece will be automatically chosen based on the puzzle solution
  • the current player rating is visible in the โ˜ฐ menu
  • double clicking the Puzzle โ™Ÿ Chess title will reveal a debug information

๐Ÿค Attribution

๐Ÿ“œ License

Copyright (c) 2024 Arlin Schaffel

Licensed under the GNU GPL v3.0 License, available here: https://github.com/FeXd/puzzle-chess/blob/main/LICENSE.md

puzzle-chess's People

Contributors

fexd avatar

Watchers

 avatar

puzzle-chess's Issues

Solve Puzzles

Notify user of progress as they attempt to solve puzzle. Confirm good moves, reject incorrect moves, and celebrate completion. Ensure that user is always notified of progress. Should wait until #7 is complete.

Info / Settings

Cleaning up and simplifying the interface would be great. Remove the "Game by" and credits with an (i) info button in the top or bottom. Could accordion out, or be a modular popup. This could show info initially, and eventually have some basic settings added.

URL Parameters

It would be nice to be able to load a specific puzzle based on the URL. Also once themes are created, loading a specific theme would be nice too.

This should be pretty easy with URLSearchParams

// Get the full URL (Example: https://puzzlechess.ca/?puzzle=123456&theme=kenny)
const url = new URL(window.location.href);

// Access the URLSearchParams object
const params = new URLSearchParams(url.search);

// Get values of 'puzzle' and 'theme'
const puzzle = params.get('puzzle'); // This would be '123456' for your example URL
const theme = params.get('theme'); // This would be 'kenny' for your example URL

More Styles / Chess Pieces

A long term goal is to have players pick different themes / styles they wish to play with. It would be great if these were all open source or creative commons. Maybe a custom one created for this project eventually?

Previous Move

Allow user to move back one or more moves. Should wait until #6 is complete.

Color Blind Mode

Audit design for color blind support. Consider adding toggle to enable, which could change colors, or add textures to things. Optimal solution would not have a toggle, and simply support color blind mode by default.

Board Styling

Ensure that HTML & CSS is capable of displaying all possible board states. Should include highlighting squares that are valid for moves, able to be captured, etc. Look at lichess.org and chess.com for examples of they handle different displays.

Bug: Promotion

Currently unable to promote Pawn to Queen in order to solve this puzzle:

image

Make Moves

Allow the player to make only valid chess moves for pieces. Should wait until #2, #3, #4, #5 are completed.

Tap

We should use "tap" instead of "click" when on mobile device.

Favicon Missing

Keep getting an error because we don't have favicon.ico and it is annoying!

Audio / Tactile Feedback

Add "haptic feedback" (iOS term) to slightly vibrate device after each move. Consider adding audio for pieces moving as well, but could be annoying.

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.