Skip to content

begoon/conix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Conix

A console-based Xonix clone. Cut off ≥ 75% of the sea by drawing trails from land to land — without letting a ball cross your trail or an eater catch you on the land — to clear each level. 30 levels in total.

Splash screen

Launching the original C build with -i shows this banner — rendered in bold green over a blue inverse-video border that fills the terminal:

        CCCCCCCCCCCCC      OOOOOOOOO      NNNNNNNN        NNNNNNNN IIIIIIIIII XXXXXXX       XXXXXXX
     CCC::::::::::::C    OO:::::::::OO    N:::::::N       N::::::N I::::::::I X:::::X       X:::::X
   CC:::::::::::::::C  OO:::::::::::::OO  N::::::::N      N::::::N I::::::::I X:::::X       X:::::X
  C:::::CCCCCCCC::::C O:::::::OOO:::::::O N:::::::::N     N::::::N II::::::II X::::::X     X::::::X
 C:::::C       CCCCCC O::::::O   O::::::O N::::::::::N    N::::::N   I::::I   XXX:::::X   X:::::XXX
C:::::C               O:::::O     O:::::O N:::::::::::N   N::::::N   I::::I      X:::::X X:::::X
C:::::C               O:::::O     O:::::O N:::::::N::::N  N::::::N   I::::I       X:::::X:::::X
C:::::C               O:::::O     O:::::O N::::::N N::::N N::::::N   I::::I        X:::::::::X
C:::::C               O:::::O     O:::::O N::::::N  N::::N:::::::N   I::::I        X:::::::::X
C:::::C               O:::::O     O:::::O N::::::N   N:::::::::::N   I::::I       X:::::X:::::X
C:::::C               O:::::O     O:::::O N::::::N    N::::::::::N   I::::I      X:::::X X:::::X
 C:::::C       CCCCCC O::::::O   O::::::O N::::::N     N:::::::::N   I::::I   XXX:::::X   X:::::XXX
  C:::::CCCCCCCC::::C O:::::::OOO:::::::O N::::::N      N::::::::N II::::::II X::::::X     X::::::X
   CC:::::::::::::::C  OO:::::::::::::OO  N::::::N       N:::::::N I::::::::I X:::::X       X:::::X
     CCC::::::::::::C    OO:::::::::OO    N::::::N        N::::::N I::::::::I X:::::X       X:::::X
        CCCCCCCCCCCCC      OOOOOOOOO      NNNNNNNN         NNNNNNN IIIIIIIIII XXXXXXX       XXXXXXX

         _____)                   _____                           ___      _      __    _    _
       /         ,  /)      /)   (, /  |              /)  /)    / _  )    '  )  /   ) / /  / /
      /   ___      // _   _(/      /---|  __ __   ___// _(/    / (_ /    ,--'  /   /   /    /
     /     / ) _(_(/_(_(_(_(_   ) /    |_/ (_/ (_(_)(/_(_(_   (____/    /___  (__ /   /    /
    (____ /                    (_/

Press any key to start the game. (The Python and TypeScript ports skip the splash and drop you straight into level 1.)

Implementations

This repository contains three implementations of the same game:

Implementation Path Run with
C (original) c/conix.c cc c/conix.c -o conix && ./conix -i
Python port python/conix.py python3 python/conix.py -i
TypeScript port (Bun) ts/conix.ts bun ts/conix.ts -i

Controls

Key Action
Arrow keys / h j k l Move Conix
Space Stop Conix
p Pause / resume
q Quit

Command-line flags

All three implementations accept the same flags:

-i, --interactive   Show the "Press 'y' to play again" prompt at game over
-l NUM              Start at level NUM (1–30, default 1)
-s RATIO            Speed multiplier — integer or fraction, e.g. 2 or 1/2
-V, --version       Print version and exit
-h, --help          Display help and exit

The terminal must be at least 104 × 26 characters.

Running each version

C

cc c/conix.c -o conix
./conix -i

Python

Requires Python 3.8+. No dependencies.

python3 python/conix.py -i

TypeScript (Bun)

Requires Bun ≥ 1.0.

cd ts
bun install     # first time only — fetches bun-types + typescript
bun run conix.ts -i

Or directly from the repo root:

bun ts/conix.ts -i

Tips for macOS

If keyboard reaction feels sluggish on macOS, the OS defaults are usually the cause (the same C binary is snappy on Linux). Adjust:

defaults write NSGlobalDomain InitialKeyRepeat -int 15   # default ~25
defaults write NSGlobalDomain KeyRepeat -int 2           # default ~6
defaults write -g ApplePressAndHoldEnabled -bool false   # for h/j/k/l

Log out / in for these to take effect. iTerm2, Alacritty and Ghostty also tend to feel snappier than Terminal.app for fast-paced terminal games.

Licensing

  • The original C source in c/ is preserved as-is — copyright is retained by its original author(s) and no license has been added on top.
  • The Python port (python/) and the TypeScript port (ts/) are released under the MIT License (see LICENSE) and were derived from the C source as a clean reimplementation of the game logic.

About

(X)Conix game in C, Python and Typescript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors