Cool Chess: a surprisingly full chess engine and graphical UI in one QB64 BASIC file

Cool Chess: a surprisingly full chess engine and graphical UI in one QB64 BASIC file

Hey r/computerchess,

I wanted to share a project I have been picking away at called Cool Chess (github link). It started as me messing around with QB64, then got somewhat out of hand and turned into a small self-contained chess program with a graphical board and a playable engine.

I am a chess player, not an engine programmer. I play on Lichess as JeffyJeff, and have followed computer chess off and on since the late 90s. I remember looking at Crafty’s source code in absolute awe back then, and later following all the Rybka drama as it unfolded. BASIC was also the first (and only) language I learned as a kid in the early to mid 90s, so this was partly an excuse to get back into it.

I used AI heavily as a coding partner on this. I am not pretending I sat down and wrote a chess engine from scratch in isolation. But I also did not just dump generated code into GitHub and call it a day. I have been testing, debugging, iterating, and trying to understand what the code is actually doing as I go. I definitely was not trying to make Stockfish in BASIC. Mostly I wanted to see how much of a real, playable chess program I could fit into one BASIC file.

The whole thing is self-contained. The board UI is in the source, and even the little pixel-art chess pieces are stored as DATA statements, so there are no external image files or assets.

The mouse input is probably the feature I am happiest with. You click a friendly piece and its legal quiet moves show up as dots, while capturable pieces get blue rings. Click a marked destination to make the move. You can click the same piece again or right-click to cancel, and you can flip the board. Mouse promotions default to a queen. You can also still type moves directly if you prefer, including e2e4, e2-e4, O-O, and e7e8q.

It has undo/redo (takeback!), hints, FEN display, PGN export, adjustable search depth, and a per-move time setting. Default depth is 5 ply, and you can set it from 1 through 10 with “depth n.” It handles castling, en passant, promotion, checkmate, stalemate, threefold repetition, the fifty-move rule, and the common insufficient-material draw cases.

Under the hood it is a small classical engine: iterative-deepening negamax with alpha-beta pruning, quiescence search, MVV-LVA capture ordering, killer moves, capped check extensions, a 64-bit Zobrist hash, and a fixed-size transposition table. The evaluation is basic but includes material, pawn structure, passed pawns, development/centralization, rook files, bishop pair, and king-placement terms.

I checked the move generator against initial-position perft through depth 4, plus several standard special-case positions involving castling, en passant, promotion, and checks. I also made a heavily commented tutorial version of the source, because I spent enough time relearning what all this engine terminology actually meant that I figured it might be useful to someone else.

The project is here:

https://github.com/jeffanderson253-sketch/coolchess

The Windows executable is unsigned and built through the project’s GitHub workflow, so SmartScreen or antivirus may treat it as an unknown publisher. (I SWEAR ON THE LIFE OF MY MOTHER IT IS NOT A VIRUS.) The full source is in the repository if you would rather inspect or compile it yourself with QB64.

I would genuinely appreciate feedback, especially from people who know computer chess or QB64 better than I do. I am particularly interested in small engine or evaluation improvements that would make it play a little sharper without turning the source into something impossible for a normal person to follow.

u/CatPicturesPlease — 4 hours ago

I made an 80s-style, turn-based Titanic evacuation game in BASIC. Feedback welcome!

I made a small turn-based command game set from the moment Titanic strikes the iceberg to 2:20 AM. (github link)

The premise is simple: you cannot save the ship. You have sixteen ten-minute turns to save as many people as possible.

You manage officers, deckhands, stewards, engineers, and the wireless operator. Lifeboats have to be prepared, loaded, and launched; people have to be brought up from below before compartments flood; crowd panic affects loading; and communications, rockets, pumps, power, and the eventual withdrawal of crew all matter.

I know the real evacuation had twenty boats, but I condensed them into eight “lifeboat groups” representing the full set of boats, rather than making the player administer twenty nearly identical menus.

It is deliberately a game rather than a strict simulation, but I tried to ground the main constraints in the actual disaster. I would especially welcome feedback from people here on:

  • What feels historically off or implausible.
  • What important command decisions I have missed.
  • Whether the abstractions are clear enough to be worth the simplification.
  • Whether the game sounds interesting enough to be worth refining further.

Windows EXE + complete QB64 source: https://github.com/jeffanderson253-sketch/titanic-160-minutes

The EXE is a small QB64-compiled game, not an installer; the full .bas source is included if you want to inspect or compile it yourself.

EXE FILE MAY BE FLAGGED AS "DANGEROUS" BUT IS NOT A VIRUS. SELECT "RUN ANYWAY" OR COMPILE THE BASIC CODE YOURSELF.

u/CatPicturesPlease — 15 days ago

Solving Voynich with Claude Mythos type LLMmodel?

I haven't looked back at all the posts here since ChatGPT dropped in 2023 (or was it 2022?), and I am sure tons of people have tried this and failed, or had shitty results with a helping of AI-psychosis...but as LLMs are getting much more powerful now (see Claude Mythos), I feel like a sober, intentional effort to learn more about the nature of the Voynich manuscript, led by non-crackpot experts in history, linguistics, bibliology, encryption etc. and leveraging Mythos-level LLM could be fruitful, particularly if the text is not gibberish but has some underlying meaning. I suppose if it is gibberish (glossolalia or a hoax etc) maybe there would be fewer insights possible but even then we could learn something new

reddit.com
u/CatPicturesPlease — 23 days ago

Elo doesn't change after duels

I'm a beginner and have been winning some games lately but my Elo is locked at 450 for some reason. And no, I am not playing unranked matches....any ideas?

reddit.com
u/CatPicturesPlease — 28 days ago

Petrified wood or just a rock? Found in San Juan Islands, USA (several photos, more info in body)

The outside (at least the intact half) is rounded like a tree and has a bark-like exterior. The interior seems to have rings radiating from a central point like a tree's innards.

u/CatPicturesPlease — 1 month ago
▲ 3 r/chess

Is there any good analysis of aging and chess performance decline?

I know at age 44 I am much weaker than I was when I was 18 (like decline from 1950 to 1700 roughly). And all the elite players are young. Carlsen and Nakamura are beginning to show their age. Seems like there is kind of cliff around age 35-40 that isn't too much different from many other sports. I was just curious if anyone has analyzed how aging impacts chess performance based on real data instead of anecdotes?

reddit.com
u/CatPicturesPlease — 2 months ago
▲ 1 r/LLM

Am I the only one paying $20/mo for Claude AND ChatGPT AND Gemini?

I use Gemini for work stuff like SQL queries, Excel formulas and emails. I use ChatGPT as a therapist. And I resubscribed to Claude (after canceling) so I could use Fable to help me with my mathematical formula quantifying the ratio of difficulty between creation and destruction (my stoner stuff). I wonder if many others see value in subscribing to all 3 at the $20 rate...

reddit.com
u/CatPicturesPlease — 2 months ago

Was birding in Washington state with my big camera lens when I saw this jumbo ovehead.

I have always wanted to see an A380 and was so excited I had to share. Looked it up on flightradar24 and it was at 39K ft, on its way to San Francisco from Dubai

u/CatPicturesPlease — 2 months ago
▲ 738 r/birding

I do not recommend this style bird feeder. Caused greusome bird injury/death

I was feeding birds with this style of feeder, and went out one day to fill it, and found a house finch that I thought was already dead, which had been trying to get at the last seeds near the bottom after it became empty. Its head was under the plexiglass, its body was outside it, and it was bloody and half decapitated. Unfortunately, I was it was still breathing. In a panic, I began to take apart the feeder so I could (dread the thought) euthanize the bird with a large stone or something. It was a horribly grotesque injury. Well, I wasn't able to euthanize it because it actually flew away.

I not only feed birds but bird for fun and study birds etc., I'm a big bird nerd, and this was absolutely horribly upsetting to me.

If you do have this style feeder, NEVER, let it get empty, or just don't use it at all, unless you like to deal with bloody half decapitated birds :(

u/CatPicturesPlease — 2 months ago