{"id":24227578,"url":"https://github.com/maxgyver83/tinytictactoe","last_synced_at":"2025-10-17T02:29:06.028Z","repository":{"id":270893927,"uuid":"911772515","full_name":"MaxGyver83/TinyTicTacToe","owner":"MaxGyver83","description":"The classic tic-tac-toe game for Android and Linux/X11 written in C.","archived":false,"fork":false,"pushed_at":"2025-08-13T07:25:16.000Z","size":668,"stargazers_count":28,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-22T18:50:26.996Z","etag":null,"topics":["android","android-app","android-application","c","ndk","tiny"],"latest_commit_sha":null,"homepage":"https://play.google.com/store/apps/details?id=com.goodtemperapps.tinytictactoe","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MaxGyver83.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-03T20:13:18.000Z","updated_at":"2025-08-13T07:25:20.000Z","dependencies_parsed_at":"2025-01-26T19:28:44.467Z","dependency_job_id":"4698bad4-b3b0-4a25-92b2-5667eaabaf40","html_url":"https://github.com/MaxGyver83/TinyTicTacToe","commit_stats":null,"previous_names":["maxgyver83/tinytictactoe"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/MaxGyver83/TinyTicTacToe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxGyver83%2FTinyTicTacToe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxGyver83%2FTinyTicTacToe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxGyver83%2FTinyTicTacToe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxGyver83%2FTinyTicTacToe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaxGyver83","download_url":"https://codeload.github.com/MaxGyver83/TinyTicTacToe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxGyver83%2FTinyTicTacToe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279272823,"owners_count":26138207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-17T02:00:07.504Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-app","android-application","c","ndk","tiny"],"created_at":"2025-01-14T10:18:17.140Z","updated_at":"2025-10-17T02:29:05.981Z","avatar_url":"https://github.com/MaxGyver83.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tiny Tic Tac Toe for Android\n\nThe classic tic-tac-toe game for Android and Linux/X11 written in C.\n\n\u003cimg src=\"img/screenshot.png\" alt=\"Screenshot\" width=\"30%\"\u003e\n\n## Features\n\n### It's tiny\n\nIts APK file is smaller than 60 kB. For comparison:\n\n\u003cimg src=\"img/apk-size-comparison.png\"\n     alt=\"tic-tac-toe games APK size comparison\" width=\"100%\"\u003e\n\nThe bar for _Tiny Tic Tac Toe_ isn't visible because it's so tiny (about half a\npixel).\n\n### Written in C\n\nC is simpler than Java or Kotlin. Using C for this game results in super fast\ncompile times, fast execution and small memory usage.\n\n### Developer friendly local execution\n\nRun this game directly on your Linux/X11 machine during development. A clean\nbuild takes only 0.125 seconds (on my old laptop, using\n[tcc](https://bellard.org/tcc/): `make x11 CC=tcc`). X11 support is the biggest\nimprovement over this project's inspiration\n[VadimBoev/FlappyBird](https://github.com/VadimBoev/FlappyBird).\n\n### No Android app permissions required\n\nNot requesting permissions is something rarely seen in Android apps.\n\n### Keyboard support\n\nYou can use your keyboard to play the game. This allows you a faster gameplay\n(or manual testing) on Linux/X11. External keyboards on Android are supported,\ntoo.\n\nUse 7, 8, 9 to place your symbol in the top row (number pad), and so on. 's' is\nfor settings. Press 1 to 5 to select a difficulty in the settings menu.\n\n### Open source\n\nObviously, you have found the source code.\n\n## How to build\n\nFirst, clone this repository:\n\n```sh\ngit clone https://github.com/MaxGyver83/TinyTicTacToe.git\ncd TinyTicTacToe\n```\n\n### How to build for Linux/X11\n\nInstall these dependencies (Ubuntu 24.04 package names, might be different for\nother distributions):\n\n- `libasound2-dev`\n- `libvorbis-dev`\n- `libgles2-mesa-dev`\n\nThe last one isn't necessary if you have installed the Android NDK (see next\nsection).\n\nBuild and start _TinyTicTacToe_ like this:\n\n```sh\nmake x11\n```\n\n### How to build for Android\n\nInstall [Android Studio](https://developer.android.com/studio/) or [Android's\ncommand line\ntools](https://developer.android.com/studio#command-line-tools-only), the\nAndroid SDK and NDK.\n\nThis project expects these install locations and versions:\n\n```sh\nANDROID_SDK_ROOT=~/Android/Sdk\nANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/27.2.12479018\nANDROIDVERSION=35\n```\n\nIf you use other folders or a different version of the NDK, modify the first\nlines of [build_apk.sh](./build_apk.sh), [build_aab.sh](./build_aab.sh),\n[run.sh](./run.sh) accordingly.\n\nOptionally, copy/symlink your existing keystore to `./keystore.jks` and export\n`$KEYSTORE_PASSWORD` and `$KEYSTORE_ALIAS`. Otherwise, replace \"`Your Name`\",\n\"`Your Organization`\" and \"`DE`\" in [create_keystore.sh](./create_keystore.sh)\nto get a keystore created.\n\nThen start the Android Emulator or connect your Android device via `adb connect`\nand run:\n\n```sh\nmake\n```\n\nWithout any arguments, `make` will build and install an APK file containing code\nfor all supported architectures, start the app on the Android device/emulator\nand start logging on your local machine.\n\nUse `make apk` to build an APK file only.\n\nAppend `ABI=\u003carch\u003e` to the command to build only for one specific architecture.\n\nExamples: `make ABI=arm64-v8a`, `make apk ABI=x86_64`\n\nUse `DEBUG=1 make apk` for a debug build (no symbols stripped).\n\n### How to build for Google Play Store\n\nFirst, install Google's [bundletool](https://github.com/google/bundletool).\n\nThen, create an Android app bundle like this:\n\n```sh\nmake aab\n```\n\nTo test the created `.aab` file on your Android device, run:\n\n```sh\nmake run_aab\n```\n\n## App in Google Play Store\n\nThis app is open source. You can compile it yourself and install it on your\nAndroid device for free.\n\nIf you want to thank me for sharing this code, you can buy this app in the\nGoogle Play Store:\n\n\u003chttps://play.google.com/store/apps/details?id=com.goodtemperapps.tinytictactoe\u003e\n\n## Variations\n\n### Texts prerendered as 32-bit PNG images\n\nOriginally, all texts used in this app were (32-bit RGBA) PNG image files\ncreated with [create_sprites.sh](create_sprites.sh) using `pango-view`. This is\nmuch simpler than creating texts at runtime. _Tiny Tic Tac Toe_ used\n[upng](https://github.com/elanthis/upng) for decoding the PNG files. Check out\nthe `png32bit` tag for the original code.\n\n### Texts prerendered as 8-bit grayscale PNG images\n\nThere is a branch named `png8bit` that uses 8-bit grayscale PNG files instead.\nThis reduces the APK size(s) by 8 kB.\n\n### Texts prerendered as 8-bit grayscale PGM images\n\nBut it turned out that 8-bit PGM files\n([Netpbm](https://en.wikipedia.org/wiki/Netpbm)) are a better choice. This file\nformat is so simple that it can be decoded without any library. Netpbm files\ncontain uncompressed data. But after compression these files are even smaller\nthan 8-bit PNG files. The best part is that it's not necessary to compress these\nfiles with gzip or similar because APK files are compressed anyway. This also\nmeans that Android decompresses these files automatically when accessed in C\ncode.\n\n### Texts rendered during runtime using libschrift\n\nPrerendering texts is simple but it doesn't scale well. If you want to create an\napp that uses much more text than this one, it might make sense to render all\ntexts at runtime. Take a look at the `libschrift` branch which uses the\n[libschrift](https://github.com/tomolt/libschrift) library for text rendering.\n\n### Variations overview\n\n| Branch/Tag   | APK size arm64-v8a | APK size x86\\_64| Assets                      | Libraries  |\n|--------------| ------------------:| ---------------:|-----------------------------|------------|\n| `png32bit`   | 74 kB              | 74 kB           | PNG files (RGBA)            | upng       |\n| `png8bit`    | 66 kB              | 66 kB           | PNG files (8-bit grayscale) | upng       |\n| `main`       | 58 kB              | 58 kB           | PGM files                   | -          |\n| `libschrift` | 53 kB              | 57 kB           | a minimized font            | libschrift |\n\n## Contributing\n\nI'm sharing this project to help you to start your own project.\nI want to keep it simple. This means I don't plan to add more features. I also\ndon't care about squeezing every last bit of APK size or performance out of it.\n\nBut if you find a bug or want to add support for Windows/macOS/any BSD:\nContributions are welcome!\n\n## Credits\n\nThanks to Vadim Boev for sharing\n[VadimBoev/FlappyBird](https://github.com/VadimBoev/FlappyBird). _Tiny Tic Tac\nToe_ is very much inspired by it and re-uses some of its code.\n\nThe tick sound used in this game is from [satrebor (Freesound) on\nPixabay](https://pixabay.com/sound-effects/pick-92276/). I have reduced its\nlength and file size using this command:\n\n```sh\nffmpeg -ss 0.45 -t 0.15 -i pick-92276.mp3 -c:a libvorbis -q:a 4 pick.ogg\n```\n\nThank you all!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxgyver83%2Ftinytictactoe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxgyver83%2Ftinytictactoe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxgyver83%2Ftinytictactoe/lists"}