You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
cancel 9f4e91e742 Clean up wording in usage 6 years ago
examples Updated examples and README / Added LICENSE 6 years ago
.clang-format Add working 'O' operator, and load/store bank macros 6 years ago
.gitignore Init with basic test 6 years ago
LICENSE.md Updated examples and README / Added LICENSE 6 years ago
Makefile Update tool and Makefile for separate config/target 6 years ago
README.md Update controls 6 years ago
bank.c Remove use of memset in bank.c 6 years ago
bank.h Change bank storage to use I32 instead of Glyph 6 years ago
base.h Add typedef alias for U8 -> Mark 6 years ago
cli_main.c Change to return 0 on -h/--help 6 years ago
field.c Clean up resizing logic, make it work with undo history 6 years ago
field.h Clean up resizing logic, make it work with undo history 6 years ago
gbuffer.c Add partial support for resizing grids (WIP) 6 years ago
gbuffer.h Cleanup field.h/.c, move some stuff to gbuffer.h/.c 6 years ago
mark.c Rename Markmap_buffer to Mbuffer 6 years ago
mark.h Add typedef alias for U8 -> Mark 6 years ago
sim.c Fix incorrectly overlapping storage for V var names 6 years ago
sim.h Add tick number param 6 years ago
tool Remove field_copy_subrect, move to gbuffer, add gbuffer.c 6 years ago
tui_main.c Clean up wording in usage 6 years ago

README.md

ORCΛ

Each letter of the alphabet is an operation, lowercase letters typically operate on bang(*), uppercase letters operate on each frame. Bangs can be generated by various operations, such as E colliding with a 0, see the bang.orca example. Watch a music video of ORCΛ in action.

C Port for the ORCΛ programming environment, with a commandline interpreter.

Prerequisites

Core library: A C99 compiler (no VLAs required), plus enough libc for malloc, realloc, free, memcpy and memset.

Command-line interpreter: The above, plus POSIX.

Interactive terminal UI: The above, plus ncurses (or compatible curses library).

Build

The build script is in bash. It should work with gcc (including the musl-gcc wrapper) and clang, and will automatically detect your compiler.

Currently known to build on macOS (gcc, clang) and Linux (gcc, musl-gcc, and clang, optionally with LLD).

Not yet tested on Windows, but it's likely that it already works under cygwin. Further testing will be performed soon.

There is a fire-and-forget make wrapper around the build script.

Make

make debug      # debugging build, binary placed at build/debug/orca
make release    # optimized build, binary placed at build/release/orca
make clean      # removes build/

Build Script

Run ./tool --help to see usage info.

./tool build debug tui
    # debug build of the terminal ui
    # binary placed at build/debug/tui

./tool -c clang-7 build release tui
    # build the terminal ui with a compiler named
    # clang-7, with optimizations enabled.
    # binary placed at build/release/tui

./tool clean
    # same as make clean, removes build/

Run

CLI interpreter

The CLI (orca binary) reads from a file and runs the orca simulation for 1 timestep (default) or a specified number (-t option) and writes the resulting state of the grid to stdout.

orca [-t timesteps] infile

You can also make orca read from stdin:

echo -e "...\na34\n..." | orca /dev/stdin

Interactive terminal UI

tui [options] [file]

Run the interactive terminal UI, useful for debugging or observing behavior.

Controls

  • ctrl+q or ctrl+d or ctrl+g: quit
  • Arrow keys or ctrl+h/j/k/l: move cursor
  • A-Z, a-z, 0-9, and other printable characters: write character to grid at cursor
  • Spacebar: step the simulation one tick
  • ctrl+u: undo
  • [ and ]: Adjust cosmetic grid rulers horizontally
  • { and }: Adjust cosmetic grid rulers vertically
  • ( and ): resize grid horizontally
  • _ and +: resize grid vertically

Extras

  • Support this project through Patreon.
  • See the License file for license rights and limitations (MIT).
  • Pull Requests are welcome!