r/androiddev • • 20d ago

I built tinychess — a standalone, zero-dependency Android chess app under 70 KB

I wanted to see how small a complete, playable Android chess app could get (originally built it for my very old android devices but works for all android versions)

The engine :

  • full FIDE : Tracks state on a classic 128-square 0x88 array with compact integer pieces, with castling, en passant, promotions, threefold repetition, the 50-move rule, insufficient material, and strict king-safety validations
  • Search system: Pairs iterative-deepening alpha-beta and Principal Variation Search (PVS) with a 65,536-entry Zobrist transposition table + null-move pruning + late-move reductions, killer moves + capture/promotion quiescence search .
  • positional evaluation: it scores using piece-square tables and bishop-pair bonuses.
  • Levels: Easy (2 ply / 140 ms) - Medium (4 ply / 320 ms) - Hard (6 ply / 680 ms) and Expert (16 ply / 1,450 ms) !

The repo : https://github.com/R1y3n/tinychess

Downloads :

Official release : https://github.com/R1y3n/tinychess/releases/download/v1.0.0/TinyChess-v1.0.0.apk

Nightly release : (even smaller)

https://github.com/R1y3n/tinychess/releases/download/nightly/TinyChess-v1.0.0-nightly.apk

60 Upvotes

18 comments sorted by

29

u/tadfisher 20d ago

Probably don't need to link to the repo when you could link to the single Java file with all the code.

I am actually impressed, I can't get Claude or Codex to generate a whole app in one Java file. They keep insisting on using something called "Kotlin" and on generating multiple files for "architecture" and "separation of concerns". Whatever.

7

u/Wrong-Rate-1208 20d ago

Its a bad idea to code(regardless of ai use) everything in a single file, but for my case i didnt need other files as the app is a basic chess engine with textual render (0 assets imported) that doesnt affect the outcome( final build size).

You can try specifying in an instruction md file that no matter what write everything in a single "name of file" and do not break this rule.

6

u/mrwadupwadup 20d ago

I think the guy was being sarcastic here. But it's cool that you created a game of chess with such a small footprint.

1

u/Zhuinden 19d ago

I can't get Claude or Codex to generate a whole app in one Java file.

I've seen it do a PHP with generating HTML that had Javascript and the external Javascript dependencies were included in the generated HTML as base64 text

I have a feeling it takes effort to make it create something so poorly organized

11

u/[deleted] 19d ago

[removed] — view removed comment

4

u/danvers_19 18d ago

Fr, it's refreshing to see an app that keeps things simple without a bunch of extra dependencies.

3

u/emperorOfTheUniverse 18d ago

No multiplayer?

2

u/Wrong-Rate-1208 18d ago

Incoming in a few days

15

u/SuffixRE 20d ago

now do gta 6

1

u/klay64 18d ago

😂

1

u/Beneficial_Turnip704 18d ago

i mean no one needed something so lightweight. Good flex tho

1

u/23ROMAN 18d ago

Only 70kb is wild

1

u/[deleted] 19d ago

[removed] — view removed comment

1

u/AutoModerator 19d ago

Your post has been automatically removed due to multiple users reporting it.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

0

u/[deleted] 19d ago

[removed] — view removed comment

1

u/androiddev-ModTeam 19d ago

Posts and comments must be in English