Skip to content

Instantly share code, notes, and snippets.

@planetis-m
Last active December 5, 2025 14:41
Show Gist options
  • Select an option

  • Save planetis-m/ac2274cc63f6526784bb36c4952a76cd to your computer and use it in GitHub Desktop.

Select an option

Save planetis-m/ac2274cc63f6526784bb36c4952a76cd to your computer and use it in GitHub Desktop.

Nimony + raylib Tic-Tac-Toe

A minimal, single-file Tic-Tac-Toe game in Nim using raylib. It demonstrates a multi-threaded setup with a custom FFI wrapper for the shared library.

Prerequisites

  • Nimony compiler
  • A C compiler and raylib development libraries. See the official raylib wiki for platform-specific setup instructions.

Build & Run

The game requires the raylib shared library (.so, .dll, or .dylib). The easiest way to run the game is to place the raylib shared library file next to the executable.

Linux (from source):

git clone --depth 1 https://github.com/raysan5/raylib.git raylib
cd raylib/src/
make PLATFORM=PLATFORM_DESKTOP GLFW_LINUX_ENABLE_WAYLAND=TRUE GLFW_LINUX_ENABLE_X11=FALSE RAYLIB_LIBTYPE=SHARED
cp libraylib.so* ../../
cd ../..
nimony c -r tictactoe.nim

Other Platforms: Download the correct shared library for your OS from the raylib releases and run nim c -r tictactoe.nim.

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment