A collaborative ascii canvas
For more examples of what's possible, check out issue #21. Add your own creations!
COLLASCII currently supports Linux and MacOS (and Windows, using WSL), but it should run anywhere that NCURSES, BSD sockets, and POSIX threads do.
Run the executable:
This will open the editor view. Move the cursor with the arrow keys, and type to
insert text. Switch between input modes with
<TAB>, and exit with
COLLASCII also offers a command line interface - run
./collascii --help for
more information on the CLI and using COLLASCII itself.
To export your art, you can save it a file with
<CTRL+S>, or copy it off of
the screen. Most terminals support some sort of block select, which makes this a
gnome-terminal on Ubuntu (and some others):
CTRL+click, drag, and release to highlight a block of text
CTRL+SHIFT+Cto copy to your clipboard
- paste it wherever you want! (including within COLLASCII)
The networking as a whole is slightly rougher around the edges than the rest of
this project, but you can build the server right now with
Run it with an optional file to load from:
Building and using COLLASCII requires the NCURSES library.
On Ubuntu, you can install it with
sudo apt install libncurses5 (use
libncurses5-dev if you're looking to develop).
src/ and run
collascii executable should be produced.
First, a word on organization: source code lives in
src/, class reports live
#ifdef DEBUG is used throughout the project. It can be enabled globally by
DEBUG in the
Make environment, in Bash:
DEBUG=1 make collascii
env DEBUG=1 make collascii
This will also turn off compiler optimization and add debugging info to the executable.
make clean before you enable this for the first time -
won't know to recompile the source code hasn't changed.
Because the NCURSES interface uses the terminal, any printing to
stderr will normally write directly onto the window in an unpleasant manner.
We've come up with a couple of workarounds: when
stderr is reconnected to the file
text output can still be read without having to
fprintf to a custom file.
This output can be read live from another terminal with the command:
tail -f out.txt
There are two macros defined in
util.h to help with getting output
eprintfis analogous to
printfexcept it prints to
DEBUGis defined, but does nothing if it isn't, so you can easily toggle debug statements without overwriting the screen.
Test files are built with the
src/, and named
library_test.c for the
make testto compile, run, and remove all tests
make .run-foo_test.cto compile, run, and remove a specific test
make foo_testto compile a specific test