Now Reading
AnalogChess/README.md at major · ehulinsky/AnalogChess · GitHub

AnalogChess/README.md at major · ehulinsky/AnalogChess · GitHub

2023-01-13 10:55:21

Holy Hell!

This can be a model of chess the place the items aren’t constrained to an 8×8 grid, and as a substitute can transfer to any place on the board.
After clicking on a chunk, the areas it could transfer to are highlighted in inexperienced, and areas the enemy can transfer to are highlighted in crimson. Drag the piece to maneuver it, and to verify a transfer, both click on on the piece once more or press enter. To cancel a transfer, press escape or click on wherever off the piece.

There isn’t a examine or checkmate on this recreation. To win, you merely must seize the opponent’s king. That is primarily as a result of stalemate is principally unimaginable, because the king can at all times transfer an infintesimal quantity, and likewise as a result of implementing examine/checkmate would destroy the final ounce of sanity I’ve left.

Items

Every bit’s strikes are primarily based on it is strikes in common chess, however in Analog Chess, items might transfer to any place alongside their trajectory.

Pawn: Could transfer 0-2 squares on it is first transfer, 0-1 in any other case. Can solely assault diagonally. Sadly en passant (the humorous transfer) will not be carried out but as a result of I don’t know how it might work.

Bishop: Strikes any distance diagonally

Knight: Strikes in a circle of radius sqrt(5), which is the space it travels in it is common L transfer.

Rook: Strikes any distance orthagonally

Queen: Strikes any distance orthagonally or vertically.

King: Strikes 0-1 squares orthagonally or 0-sqrt(2) squares diagonally. It’s allowed to maneuver into examine as a result of this recreation was approach too difficult to code already. You lose in case your king dies.

The king might fortress with the rooks, and it’s allowed to fortress out of, into, or by means of examine.

See Also

Capturing

Capturing on this recreation is a little bit bit goofy. Principally, in case your piece overlaps the opponent’s piece it’s captured, and you can not transfer previous the primary piece you overlap.

Instance

One fascinating facet impact of that is you can seize a number of items directly. 🙂

Code

To run the code you’ll need to put in Python and the PyGame library, after which run the most recent .py file as a result of I can not be bothered to truly use model management.

Warning: This code is fucking terrible.

Don’t count on the code to be steady underneath any modifications, however you possibly can strive if you’d like I assume. Additionally there are barely any feedback sorry. I’m in Electrical Engineering and I like writing shitty code to piss off my Laptop Science associates.

Source Link

What's Your Reaction?
Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0
View Comments (0)

Leave a Reply

Your email address will not be published.

2022 Blinking Robots.
WordPress by Doejo

Scroll To Top