https://github.com/ehulinsky/AnalogChess/blob/main/README.md Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + For + Enterprise + Teams + Startups + Education + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} ehulinsky / AnalogChess Public * Notifications * Fork 9 * Star 142 * Code * Issues 1 * Pull requests 3 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights Permalink main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create AnalogChess/README.md Go to file * Go to file T * Go to line L * * Copy path * Copy permalink This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. @ehulinsky ehulinsky Update README.md Latest commit c0f7aa1 Jan 11, 2023 History 1 contributor Users who have contributed to this file Analog Chess Pieces Capturing Code 65 lines (32 sloc) 3.67 KB Raw Blame Edit this file E Open in GitHub Desktop * Open with Desktop * View raw * * View blame Analog Chess Holy Hell! This is a version of chess where the pieces are not constrained to an 8x8 grid, and instead can move to any position on the board. After clicking on a piece, the areas it may move to are highlighted in green, and areas the enemy can move to are highlighted in red. Drag the piece to move it, and to confirm a move, either click on the piece again or press enter. To cancel a move, press escape or click anywhere off the piece. [Screenshot] There is no check or checkmate in this game. To win, you simply need to capture the opponent's king. This is mainly because stalemate is basically impossible, as the king can always move an infintesimal amount, and also because implementing check/checkmate would destroy the last ounce of sanity I have left. Pieces Each piece's moves are based on it's moves in regular chess, but in Analog Chess, pieces may move to any position along their trajectory. Pawn: May move 0-2 squares on it's first move, 0-1 otherwise. Can only attack diagonally. Sadly en passant (the funny move) is not implemented yet because I have no idea how it would work. [Screenshot] Bishop: Moves any distance diagonally [Screenshot] Knight: Moves in a circle of radius sqrt(5), which is the distance it travels in it's usual L move. [Screenshot] Rook: Moves any distance orthagonally [Screenshot] Queen: Moves any distance orthagonally or vertically. [Screenshot] King: Moves 0-1 squares orthagonally or 0-sqrt(2) squares diagonally. It is allowed to move into check because this game was way too complicated to code already. You lose if your king dies. [Screenshot] The king may castle with the rooks, and it is allowed to castle out of, into, or through check. [Screenshot] Capturing Capturing in this game is a little bit goofy. Basically, if your piece overlaps the opponent's piece it is captured, and you cannot move past the first piece you overlap. Example [Screenshot] [Screenshot] One interesting side effect of this is that you can capture multiple pieces at once. :) [Screenshot] Code To run the code you will need to install Python and the PyGame library, and then run the latest .py file because I can't be bothered to actually use version control. Warning: This code is fucking awful. Do not expect the code to be stable under any modifications, but you can try if you want I guess. Also there are barely any comments sorry. I am in Electrical Engineering and I like writing shitty code to piss off my Computer Science friends. [ ] Go Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.