Readit News logoReadit News
rittme · 3 years ago
A lot of people are making fun of his code or versioning skills. It's very cool that he was able to code something interesting enough to be on the top of HN, without mastering the tools he used. People should focus less on code and tools and more on making great stuff, like him.
andai · 3 years ago
I found this part of the readme amusing:

> 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.

8bitsrule · 3 years ago
Teenager Evariste Galois did a lousy job of explaining how his math worked, none of the experts could make sense of it. He'd been dead a decade before Liouville said hey, this shit is alright. It turned out to be sorta useful a century later. A couple of the experts are still remembered, not for much.
kazinator · 3 years ago
If he hadn't gotten himself killed at twenty, he might have learned how to explain it.

Doesn't the legend have it that he scribbled a lot of his ideas down hastily the day he though he was going to die?

jimhi · 3 years ago
If you want to play in the browser instead of setting this up locally I made a replit: https://replit.com/@jamespsteinberg/AnalogChess-1
mzs · 3 years ago
All the pieces are simply labeled with rectangles as if the font is not present for me. Any ideas? Also thanks!
HALtheWise · 3 years ago
https://replit.com/@EricMiller8/AnalogChess-fixed-icons?v=1 should have working icons. There's still some weird issue for me with the cursor not displaying in fullscreen.
Eduard · 3 years ago
Same for me. Kinda feels like Stratego :)
ddalex · 3 years ago
Do you have web font blocking setup in the browser?
hammock · 3 years ago
Sweet thanks. The board takes up more space than the window. How do I zoom out?
jimhi · 3 years ago
There's a button with two diagonal arrows that lets you enter fullscreen mode although you might have to scroll a bit to get it to show. Otherwise, you might have to fork the replit and make an account. It's free.
Ruphin · 3 years ago
Very interesting. From playing a single game you immediately notice that traditional chess theory doesn't apply to this game at all. After some testing I found a few things in particular that change the way the game plays out drastically:

When having two pawns adjacent one of them can still defend the other by having it only slightly behind. They can also alternate defending each other with a single move. Pawns can also attack/defend things directly in front of them by pushing up against them. These things combined mean that it's almost impossible to have any pawn weaknesses, other than having a singled out pawn with no neighbors. In general pawns are the most improved piece with this ruleset.

The ability to move directly forward makes knights significantly stronger. Knights ability to move through other pieces is also particularly strong versus pawns which can now block most pieces from moving around quite easily.

Since pawns generally mainly move along one axis, it is easier to control the distance between pieces in the forward-backward axis than in the left-right axis. This makes it harder to utilise Rooks to capture two adjacent pieces. Bishops on the other hand have an easier time capturing two adjacent pieces, if positioned correctly. I'm not sure this compensates for the fact that bishops now have a much harder time penetrating positions, they are the most easily blocked of all the pieces.

Overall it is very interesting as a chess variant, it plays so very different from chess. It's hard to even figure out reasonable openers.

andrewfromx · 3 years ago
"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."
timerol · 3 years ago
"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."

I appreciate this README's sense of humor

remram · 3 years ago
The fact that he released it is awesome. So many people never released their code because "it's not ready" or "I want to clean it up" or whatever.

Fucking awful barely-functioning open source code is better than no code available, every time.

knodi123 · 3 years ago
lol, "Run the .py file with the highest number, because I can't figure out version control." Says the guy who posted it to github.
tluyben2 · 3 years ago
My father (quantum mechanics) would sometimes submit awful but working code to Dijkstra without proofs just to piss him off. Dijkstra didn't like the looseness of the physics students when it came to software development, while physics students didn't like the software proofs for things in physics that were experimental and needed a 'quick' (nothing was 'quick' then compared to now of course) set of calculations/simulations and not waste time on writing formal proofs for them.
bunnie · 3 years ago
I can relate to this!
logicallee · 3 years ago
In chess, you win when you are "about to" capture the opponent's king on your next move, which is called putting them in check, and there's no way for the other side to avoid it (block or move out of check).

So I've always found it very bizarre that if it's a player's move, but any possible move would put their own king in check, then it is a draw (rather than a loss).

This leads to a situation where one side can have almost no pieces left, perhaps only the king, but still somehow draw since the king can't move anywhere where it wouldn't be captured.

I imagine a king all by himself peeping his head out out for a place to move, but everywhere is covered by snipers, so, since he can't move anywhere without getting captured, despite being overwhelmed by enemy forces he yells out a la monte Python "So we'll call it a draw then!"

hgsgm · 3 years ago
It's because chess was invented by programmers, and stalemate means "the game is broken because there are no legal moves so it's impossible to continue", so we call it a draw.
pbhjpbhj · 3 years ago
Maybe if you think of it in terms of the opposition falling to put you in check despite you only having a king left? Your army chased the opposing king to the forest but failed to defeat him, be gets to live out his days as a hermit. You are denied 'satisfaction'.

?

In my family, against my children, it's a running joke that I'll almost always fail to win, and stalemate them.

bertil · 3 years ago
There’s something profound here about how the very natural conventions in Chess (“If you did that, you’d lose, so I’d rather we continue playing”) have redefined “valid” in a way that is surprisingly hard to re-implement with code.
gmiller123456 · 3 years ago
You can make illegal moves in over the board chess, and sometimes it's advantageous to do so. E.g. In blitz chess an invalid move is an immediate loss. So, if you're going to lose anyway, you can make an invalid move hoping your opponent doesn't take the time to notice. One common one is to move your king next to your opponent's king, putting their king in check, if they don't call you on it, and don't move their king out of check, they lose. Unofficially, this is considered part of the game in blitz, but is considered unsportsmanlike in long games (where it's not an immediate loss).
hasdha · 3 years ago
It always struck me as odd that the checkmate definition should be so (relatively) complicated. A much simpler definition is "you lose if the opponent captures your king". A checkmate is just a situation where you can't avoid getting your king captured. If someone doesn't notice their king is on check, then they could lose the next move. After you pass the beginner phase, this will almost never happen to you anyway, so most games will end the same way: checkmate or losing because of time.

When I was in school, we used to play blitz like that. You lost track of your king, boom, you're dead

cmeacham98 · 3 years ago
It is very easy to implement with code. Chess computers are some of the first well-known computer programs (see, for example, Deep Blue).

What is difficult is adapting chess's rules to this analog environment. It would be similarly difficult if you played this way with a real chess set in the real world, has nothing to do with code.

AstixAndBelix · 3 years ago
you can’t represent the real plane on a computer. you can only have a limited amount of precision that effectively results in very dense grid, but a grid nonetheless
bspammer · 3 years ago
> the king can always move an infintesimal amount

I don't think this is true, it should be perfectly possible to cover the opponent's king's entire movement area with your pieces.

I'd love to see a version of this game that actually implements this :D

gmoot · 3 years ago
Then it's checkmate, not stalemate. For a stalemate you need a situation where the king is not in check, but there are no legal moves. It seems impossible in practice, if not in theory.
masswerk · 3 years ago
Chess meets Tablut / Hnefatafl…

(I guess, Vikings would appreciate the constraints arising from infinitesimal granularity movement.)

temporalparts · 3 years ago
What would people think about doing a tournament for analog chess? I'd be willing to put down $1k for the prize pool. I think it'll be cool to see what creative strategies people come up for this.

I made a post to this effect: https://news.ycombinator.com/item?id=34377233

dragontamer · 3 years ago
There seems to be a whole slew of "analog" games coming out for classic discrete games.

For example, "Not Tetris" is an analog-Tetris. https://stabyourself.net/nottetris2/

I certainly enjoy these games. So hopefully more people are inspired to find analog-versions of other discrete or turn-based games, lol.

I guess a more "serious" version of analog Tetris is perhaps Tricky Towers, which is an excellent party game. https://www.trickytowers.com/

Y_Y · 3 years ago
I'm trying to go the other way and discretize golf
itcrowd · 3 years ago
... so that's what they meant by disc golf in college!
OisinMoran · 3 years ago
Please say more! Very interested in this category in general. Would love a version of basketball where the points are a continuous function of distance from the basket rather than discrete 2 & 3 pointers.
cassepipe · 3 years ago
I don't get it. What's analog about this chess variant and the games you are mentioning?
naet · 3 years ago
Tricky towers was great fun when I played it a while back.
revskill · 3 years ago
The code is readable, and at the same time, unmaintainable. Good job.
ehulinsky · 3 years ago
thansk
panki27 · 3 years ago
I love the versioning approach here - use git but still create fileV1.py, fileV2.py...
FpUser · 3 years ago
I did not look at their particular code but I had files named like this in my projects: api_v1, api_v2. Reason being that the software V2 still supported v1 api so both were present and needed.
actinium226 · 3 years ago
A reasonable approach but from the README:

"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."

The_Colonel · 3 years ago
It's a relatively common approach in e.g. web services, but not in standalone games.
Kiro · 3 years ago
I do the same. I think it's nice to have the old version readily available as reference instead of hidden in git.
leni536 · 3 years ago
Alternatively to "better IDE", use git worktree. git allows to check out multiple revisions to distinct working directories.

Or just clone the same repo multiple times, or have some releases unpacked outside of version control.

DangerousPie · 3 years ago
You need a better ide!