Skip to content

smaugfm/korge-2048

Repository files navigation

2048 AI

2048 game AI implemented in Kotlin with

  • Korge game engine
  • 64-bit board representation, Expectimax search algorithm, precomputed tables for moves and position evaluation and other optimizations (from here)
  • Kotlin/JS or WASM inside web-workers for multi-threading in the browser

This project evolved from the introductory tutorial to the Korge engine. Then I added the AI which on JVM now can search to up to 10 million moves per second with depths up to 10 on the M1 Macbook.

Web version compiled with Kotlin/JS is here: 2048.marchuk.io.

Kotlin/WASM uses experimetnal Web Assembly garbage collection and if it is not supported in the browser the game falls back to JS-only implementation of Expectimax search. For now, to achieve maximum performance in the web version use Chromium-based browser.

About

Fast Kotlin Multiplatform AI for 2048

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages