lavat

Un fork de lavat pour pouvoir y ajouter des titres - retour accueil

git clone git://bebou.netlib.re/lavat
Log | Files | Refs | README | LICENSE |

commit 6f7716074eac1004c62d063d24cfed892a65c093
parent 3835caeb84151b48893ae49189b5a80f029f310f
Auteurice: AngelJumbo <anarjumb@gmail.com>
Date:   Tue, 18 Oct 2022 17:45:59 -0500

Added support for a custom rim different from the inner circle with the -F option

Diffstat:
MREADME.md | 2+-
Mlavat.c | 10+++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md @@ -46,7 +46,7 @@ OPTIONS: If you send more than one character to the -F option you can have 3d-ish effect. -`lavat -c blue -R2 -F @:::::: -r10` +`lavat -c blue -R2 -F @@:::::: -r10` ![demo 2](https://github.com/AngelJumbo/lavat/blob/demo/demo/4.gif?raw=true) diff --git a/lavat.c b/lavat.c @@ -47,6 +47,12 @@ int main(int argc, char *argv[]) { float innerRadius = radius * (1 + (float)(0.25 * rim)); + char *custom2 = custom; + + if (strlen(custom) > 1 && rim) { + custom2 = custom + 1; + } + for (int i = 0; i < nballs; i++) { balls[i].x = rand() % maxX; balls[i].y = rand() % maxY; @@ -107,7 +113,7 @@ int main(int argc, char *argv[]) { } } else { if (sum[0] > radius) { - tb_printf(i, j, color | TB_BOLD, 0, custom); + tb_printf(i, j, color | TB_BOLD, 0, custom2); } if (rim) { @@ -224,5 +230,7 @@ void print_help() { " -b NBALLS Set the number of metaballs in the simulation, from " "2 to 20. (default: 10)\n" " -F CHARS Allows for a custom set of chars to be used\n" + " Only ascii symbols are supported for now, " + "wide/unicode chars may appear broken.\n" " -h Print help.\n"); }