lolcat in c
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.

75 lines
2.4 KiB

# colcat (lolcat)
4 years ago
4 years ago
Another lolcat clone, in 2020.
4 years ago
![image showing help text in rainbow colour](demo.png)
4 years ago
This is probably the least feature-complete version of lolcat, (the `cat` clone
that makes the output rainbow), but I wrote it anyway and probably won't do any
more work on it. I wrote this to test my colours library that I'm writing for a
simple flat-shaded 2D game I've been working on for a while in bits and pieces.
4 years ago
4 years ago
It seems to mostly be compatible with other ANSI codes now.
4 years ago
Options:
Usage: colcat [args] [--] [FILES]
Concatenate files (or standard input) and print on the standard
output, with a rainbow colour. The colour range and repeat
distance can be specified.
Args:
-h Print help text and exit
-w <int> Width, in chars, of the rainbow sequence
-r <int> The amount the hue is rotated on new lines
-s <int> The hue to start the rainbow at
-e <int> The hue to end the rainbow at
4 years ago
4 years ago
It is the norm for these programs to fuzz the rainbow a bit, and provide more
options for the frequency and animation options. Mine doesn't have animation,
and it is deterministic.
4 years ago
4 years ago
Compared to other versions this one is slightly more vibrant and uses truecolour.
This means the rainbow is slightly more accurate, but if your terminal doesn't
support truecolour then it will output garbage (I don't check any terminfo stuff,
or check that the output is a tty).
4 years ago
4 years ago
It is also about 9K larger than jaseg's version, of course it is still more
performant than the ruby/node/python versions, it just might have bugs. :)
## Installation
### 1: Use The prebuilt Cosmopolitan binary
Available on the releases tab.
### 2: Build using cosmopolitan
git clone https://git.topost.net/alistair/colcat.git
cd colcat
curl https://storage.googleapis.com/justine/cosmopolitan/cosmopolitan.zip --output cosmopolitan.zip
unzip cosmopolitan.zip
make cosmo
make installcosmo
### 3: Built for local platform
4 years ago
git clone https://git.topost.net/alistair/colcat.git
cd colcat
make
4 years ago
make install
Installs `colcat` to `/usr/local/bin/`
4 years ago
4 years ago
## Similar Programs
- [busyloop/lolcat](https://github.com/busyloop/lolcat/) (Ruby) - the original
4 years ago
- [jaseg/lolcat](https://github.com/jaseg/lolcat) ( C )
- [tehmaze/lolcat](https://github.com/tehmaze/lolcat/) (Python)
4 years ago
- [gkbrk](https://gist.github.com/gkbrk/34ed7df44ba1400f31eb73a3f238faa7) (x64 Assembly)