diff --git a/locomotive/1.frame b/locomotive/1.frame new file mode 100644 index 0000000..a2c2b06 --- /dev/null +++ b/locomotive/1.frame @@ -0,0 +1,10 @@ + ==== ________ ___________ + _D _| |_______/ \__I_I_____===__|_________| + |(_)--- | H\________/ | | =|___ ___| _________________ + / | | H | | | | ||_| |_|| _| \_____A + | | | H |__--------------------| [___] | =| | + | ________|___H__/__|_____/[][]~\_______| | -| | + |/ | |-----------I_____I [][] [] D |=======|____|________________________|_ +__/ =| o |=-~~\ /~~\ /~~\ /~~\ ____Y___________|__|__________________________|_ + |/-=|___|= || || || |_____/~\___/ |_D__D__D_| |_D__D__D_| + \_/ \O=====O=====O=====O_/ \_/ \_/ \_/ \_/ \_/ diff --git a/locomotive/2.frame b/locomotive/2.frame new file mode 100644 index 0000000..def7386 --- /dev/null +++ b/locomotive/2.frame @@ -0,0 +1,10 @@ + ==== ________ ___________ + _D _| |_______/ \__I_I_____===__|_________| + |(_)--- | H\________/ | | =|___ ___| _________________ + / | | H | | | | ||_| |_|| _| \_____A + | | | H |__--------------------| [___] | =| | + | ________|___H__/__|_____/[][]~\_______| | -| | + |/ | |-----------I_____I [][] [] D |=======|____|________________________|_ +__/ =| o |=-~~\ /~~\ /~~\ /~~\ ____Y___________|__|__________________________|_ + |/-=|___|=O=====O=====O=====O |_____/~\___/ |_D__D__D_| |_D__D__D_| + \_/ \__/ \__/ \__/ \__/ \_/ \_/ \_/ \_/ \_/ diff --git a/locomotive/3.frame b/locomotive/3.frame new file mode 100644 index 0000000..45c1844 --- /dev/null +++ b/locomotive/3.frame @@ -0,0 +1,10 @@ + ==== ________ ___________ + _D _| |_______/ \__I_I_____===__|_________| + |(_)--- | H\________/ | | =|___ ___| _________________ + / | | H | | | | ||_| |_|| _| \_____A + | | | H |__--------------------| [___] | =| | + | ________|___H__/__|_____/[][]~\_______| | -| | + |/ | |-----------I_____I [][] [] D |=======|____|________________________|_ +__/ =| o |=-O=====O=====O=====O \ ____Y___________|__|__________________________|_ + |/-=|___|= || || || |_____/~\___/ |_D__D__D_| |_D__D__D_| + \_/ \__/ \__/ \__/ \__/ \_/ \_/ \_/ \_/ \_/ diff --git a/locomotive/4.frame b/locomotive/4.frame new file mode 100644 index 0000000..6606d5b --- /dev/null +++ b/locomotive/4.frame @@ -0,0 +1,10 @@ + ==== ________ ___________ + _D _| |_______/ \__I_I_____===__|_________| + |(_)--- | H\________/ | | =|___ ___| _________________ + / | | H | | | | ||_| |_|| _| \_____A + | | | H |__--------------------| [___] | =| | + | ________|___H__/__|_____/[][]~\_______| | -| | + |/ | |-----------I_____I [][] [] D |=======|____|________________________|_ +__/ =| o |=-~O=====O=====O=====O\ ____Y___________|__|__________________________|_ + |/-=|___|= || || || |_____/~\___/ |_D__D__D_| |_D__D__D_| + \_/ \__/ \__/ \__/ \__/ \_/ \_/ \_/ \_/ \_/ diff --git a/locomotive/5.frame b/locomotive/5.frame new file mode 100644 index 0000000..2e3fb0e --- /dev/null +++ b/locomotive/5.frame @@ -0,0 +1,10 @@ + ==== ________ ___________ + _D _| |_______/ \__I_I_____===__|_________| + |(_)--- | H\________/ | | =|___ ___| _________________ + / | | H | | | | ||_| |_|| _| \_____A + | | | H |__--------------------| [___] | =| | + | ________|___H__/__|_____/[][]~\_______| | -| | + |/ | |-----------I_____I [][] [] D |=======|____|________________________|_ +__/ =| o |=-~~\ /~~\ /~~\ /~~\ ____Y___________|__|__________________________|_ + |/-=|___|= O=====O=====O=====O|_____/~\___/ |_D__D__D_| |_D__D__D_| + \_/ \__/ \__/ \__/ \__/ \_/ \_/ \_/ \_/ \_/ diff --git a/locomotive/6.frame b/locomotive/6.frame new file mode 100644 index 0000000..b54a438 --- /dev/null +++ b/locomotive/6.frame @@ -0,0 +1,10 @@ + ==== ________ ___________ + _D _| |_______/ \__I_I_____===__|_________| + |(_)--- | H\________/ | | =|___ ___| _________________ + / | | H | | | | ||_| |_|| _| \_____A + | | | H |__--------------------| [___] | =| | + | ________|___H__/__|_____/[][]~\_______| | -| | + |/ | |-----------I_____I [][] [] D |=======|____|________________________|_ +__/ =| o |=-~~\ /~~\ /~~\ /~~\ ____Y___________|__|__________________________|_ + |/-=|___|= || || || |_____/~\___/ |_D__D__D_| |_D__D__D_| + \_/ \_O=====O=====O=====O/ \_/ \_/ \_/ \_/ \_/ diff --git a/locomotive/lokomotive_wörk b/locomotive/lokomotive_wörk new file mode 100644 index 0000000..b3aac59 --- /dev/null +++ b/locomotive/lokomotive_wörk @@ -0,0 +1,80 @@ + + + + ==== ________ ___________ + _D _| |_______/ \__I_I_____===__|_________| + |(_)--- | H\________/ | | =|___ ___| _________________ + / | | H | | | | ||_| |_|| _| \_____A + | | | H |__--------------------| [___] | =| | + | ________|___H__/__|_____/[][]~\_______| | -| | + |/ | |-----------I_____I [][] [] D |=======|____|________________________|_ +__/ =| o |=-~~\ /~~\ /~~\ /~~\ ____Y___________|__|__________________________|_ + |/-=|___|= || || || |_____/~\___/ |_D__D__D_| |_D__D__D_| + \_/ \O=====O=====O=====O_/ \_/ \_/ \_/ \_/ \_/ + + + + ==== ________ ___________ + _D _| |_______/ \__I_I_____===__|_________| + |(_)--- | H\________/ | | =|___ ___| _________________ + / | | H | | | | ||_| |_|| _| \_____A + | | | H |__--------------------| [___] | =| | + | ________|___H__/__|_____/[][]~\_______| | -| | + |/ | |-----------I_____I [][] [] D |=======|____|________________________|_ +__/ =| o |=-~~\ /~~\ /~~\ /~~\ ____Y___________|__|__________________________|_ + |/-=|___|=O=====O=====O=====O |_____/~\___/ |_D__D__D_| |_D__D__D_| + \_/ \__/ \__/ \__/ \__/ \_/ \_/ \_/ \_/ \_/ + + + + ==== ________ ___________ + _D _| |_______/ \__I_I_____===__|_________| + |(_)--- | H\________/ | | =|___ ___| _________________ + / | | H | | | | ||_| |_|| _| \_____A + | | | H |__--------------------| [___] | =| | + | ________|___H__/__|_____/[][]~\_______| | -| | + |/ | |-----------I_____I [][] [] D |=======|____|________________________|_ +__/ =| o |=-O=====O=====O=====O \ ____Y___________|__|__________________________|_ + |/-=|___|= || || || |_____/~\___/ |_D__D__D_| |_D__D__D_| + \_/ \__/ \__/ \__/ \__/ \_/ \_/ \_/ \_/ \_/ + + + + ==== ________ ___________ + _D _| |_______/ \__I_I_____===__|_________| + |(_)--- | H\________/ | | =|___ ___| _________________ + / | | H | | | | ||_| |_|| _| \_____A + | | | H |__--------------------| [___] | =| | + | ________|___H__/__|_____/[][]~\_______| | -| | + |/ | |-----------I_____I [][] [] D |=======|____|________________________|_ +__/ =| o |=-~O=====O=====O=====O\ ____Y___________|__|__________________________|_ + |/-=|___|= || || || |_____/~\___/ |_D__D__D_| |_D__D__D_| + \_/ \__/ \__/ \__/ \__/ \_/ \_/ \_/ \_/ \_/ + + + + ==== ________ ___________ + _D _| |_______/ \__I_I_____===__|_________| + |(_)--- | H\________/ | | =|___ ___| _________________ + / | | H | | | | ||_| |_|| _| \_____A + | | | H |__--------------------| [___] | =| | + | ________|___H__/__|_____/[][]~\_______| | -| | + |/ | |-----------I_____I [][] [] D |=======|____|________________________|_ +__/ =| o |=-~~\ /~~\ /~~\ /~~\ ____Y___________|__|__________________________|_ + |/-=|___|= O=====O=====O=====O|_____/~\___/ |_D__D__D_| |_D__D__D_| + \_/ \__/ \__/ \__/ \__/ \_/ \_/ \_/ \_/ \_/ + + + + ==== ________ ___________ + _D _| |_______/ \__I_I_____===__|_________| + |(_)--- | H\________/ | | =|___ ___| _________________ + / | | H | | | | ||_| |_|| _| \_____A + | | | H |__--------------------| [___] | =| | + | ________|___H__/__|_____/[][]~\_______| | -| | + |/ | |-----------I_____I [][] [] D |=======|____|________________________|_ +__/ =| o |=-~~\ /~~\ /~~\ /~~\ ____Y___________|__|__________________________|_ + |/-=|___|= || || || |_____/~\___/ |_D__D__D_| |_D__D__D_| + \_/ \_O=====O=====O=====O/ \_/ \_/ \_/ \_/ \_/ + + diff --git a/netsl/sl-stripped/.gitignore b/netsl/sl-stripped/.gitignore new file mode 100644 index 0000000..b2bf82b --- /dev/null +++ b/netsl/sl-stripped/.gitignore @@ -0,0 +1 @@ +/sl diff --git a/netsl/sl-stripped/Makefile b/netsl/sl-stripped/Makefile new file mode 100644 index 0000000..bbb93cd --- /dev/null +++ b/netsl/sl-stripped/Makefile @@ -0,0 +1,13 @@ +#======================================== +# sl.c: SL version 5.02 +# Copyright 1993,1998,2014 +# Toyoda Masashi +# (mtoyoda@acm.org) +# Last Modified: 2014/06/03 +#======================================== + +CC=gcc +CFLAGS=-O + +sl: sl.c sl.h + $(CC) $(CFLAGS) -o sl sl.c -lncurses diff --git a/netsl/sl-stripped/sl.c b/netsl/sl-stripped/sl.c new file mode 100644 index 0000000..5ffaff7 --- /dev/null +++ b/netsl/sl-stripped/sl.c @@ -0,0 +1,161 @@ +/*======================================== + * sl.c: SL version 5.02 + * Copyright 1993,1998,2014 + * Toyoda Masashi + * (mtoyoda@acm.org) + * Last Modified: 2014/06/03 + *======================================== + */ + +#define D51HEIGHT 9 +#define D51FUNNEL 7 +#define D51LENGTH 83 +#define D51PATTERNS 6 + +#define ENG1 " ==== ________ ___________ " +#define ENG2 " _D _| |_______/ \\__I_I_____===__|_________| " +#define ENG3 " |(_)--- | H\\________/ | | =|___ ___| " +#define ENG4 " / | | H | | | | ||_| |_|| " +#define ENG5 " | | | H |__--------------------| [___] | " +#define ENG6 " | ________|___H__/__|_____/[][]~\\_______| | " +#define ENG7 " |/ | |-----------I_____I [][] [] D |=======|__ " + +#define WHL11 "__/ =| o |=-~~\\ /~~\\ /~~\\ /~~\\ ____Y___________|__ " +#define WHL12 " |/-=|___|= || || || |_____/~\\___/ " +#define WHL13 " \\_/ \\O=====O=====O=====O_/ \\_/ " + +#define WHL21 "__/ =| o |=-~~\\ /~~\\ /~~\\ /~~\\ ____Y___________|__ " +#define WHL22 " |/-=|___|=O=====O=====O=====O |_____/~\\___/ " +#define WHL23 " \\_/ \\__/ \\__/ \\__/ \\__/ \\_/ " + +#define WHL31 "__/ =| o |=-O=====O=====O=====O \\ ____Y___________|__ " +#define WHL32 " |/-=|___|= || || || |_____/~\\___/ " +#define WHL33 " \\_/ \\__/ \\__/ \\__/ \\__/ \\_/ " + +#define WHL41 "__/ =| o |=-~O=====O=====O=====O\\ ____Y___________|__ " +#define WHL42 " |/-=|___|= || || || |_____/~\\___/ " +#define WHL43 " \\_/ \\__/ \\__/ \\__/ \\__/ \\_/ " + +#define WHL51 "__/ =| o |=-~~\\ /~~\\ /~~\\ /~~\\ ____Y___________|__ " +#define WHL52 " |/-=|___|= O=====O=====O=====O|_____/~\\___/ " +#define WHL53 " \\_/ \\__/ \\__/ \\__/ \\__/ \\_/ " + +#define WHL61 "__/ =| o |=-~~\\ /~~\\ /~~\\ /~~\\ ____Y___________|__ " +#define WHL62 " |/-=|___|= || || || |_____/~\\___/ " +#define WHL63 " \\_/ \\_O=====O=====O=====O/ \\_/ " + +#define COAL01 " " +#define COAL02 " " +#define COAL03 " _________________ " +#define COAL04 " _| \\_____A " +#define COAL05 " =| | " +#define COAL06 " -| | " +#define COAL07 "__|________________________|_ " +#define COAL08 "|__________________________|_ " +#define COAL09 " |_D__D__D_| |_D__D__D_| " +#define COAL10 " \\_/ \\_/ \\_/ \\_/ " + +#include +#include +#include +#include "sl.h" + +int my_mvaddstr(int y, int x, char *str) { + for ( ; x < 0; ++x, ++str) + if (*str == '\0') + return ERR; + for ( ; *str != '\0'; ++str, ++x) + if (mvaddch(y, x, *str) == ERR) + return ERR; + return OK; +} + +void add_smoke(int y, int x) +#define SMOKEPTNS 16 +{ + static struct smokes { + int y, x; + int ptrn, kind; + } S[1000]; + static int sum = 0; + static char *Smoke[2][SMOKEPTNS] + = {{"( )", "( )", "( )", "( )", "( )", + "( )" , "( )" , "( )" , "()" , "()" , + "O" , "O" , "O" , "O" , "O" , + " " }, + {"(@@@)", "(@@@@)", "(@@@@)", "(@@@)", "(@@)", + "(@@)" , "(@)" , "(@)" , "@@" , "@@" , + "@" , "@" , "@" , "@" , "@" , + " " }}; + static char *Eraser[SMOKEPTNS] + = {" ", " ", " ", " ", " ", + " " , " " , " " , " " , " " , + " " , " " , " " , " " , " " , + " " }; + static int dy[SMOKEPTNS] = { 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0 }; + static int dx[SMOKEPTNS] = {-2, -1, 0, 1, 1, 1, 1, 1, 2, 2, + 2, 2, 2, 3, 3, 3 }; + int i; + + if (x % 4 == 0) { + for (i = 0; i < sum; ++i) { + my_mvaddstr(S[i].y, S[i].x, Eraser[S[i].ptrn]); + S[i].y -= dy[S[i].ptrn]; + S[i].x += dx[S[i].ptrn]; + S[i].ptrn += (S[i].ptrn < SMOKEPTNS - 1) ? 1 : 0; + my_mvaddstr(S[i].y, S[i].x, Smoke[S[i].kind][S[i].ptrn]); + } + my_mvaddstr(y, x, Smoke[sum % 2][0]); + S[sum].y = y; S[sum].x = x; + S[sum].ptrn = 0; S[sum].kind = sum % 2; + sum ++; + } +} + +int add_D51(int x) { + static char *d51[D51PATTERNS][D51HEIGHT + 1] + = {{ENG1, ENG2, ENG3, ENG4, ENG5, ENG6, ENG7, WHL11, WHL12, WHL13}, + {ENG1, ENG2, ENG3, ENG4, ENG5, ENG6, ENG7, WHL21, WHL22, WHL23}, + {ENG1, ENG2, ENG3, ENG4, ENG5, ENG6, ENG7, WHL31, WHL32, WHL33}, + {ENG1, ENG2, ENG3, ENG4, ENG5, ENG6, ENG7, WHL41, WHL42, WHL43}, + {ENG1, ENG2, ENG3, ENG4, ENG5, ENG6, ENG7, WHL51, WHL52, WHL53}, + {ENG1, ENG2, ENG3, ENG4, ENG5, ENG6, ENG7, WHL61, WHL62, WHL63}}; + static char *coal[D51HEIGHT + 1] + = {COAL01, COAL02, COAL03, COAL04, COAL05, + COAL06, COAL07, COAL08, COAL09, COAL10}; + + int y, i, dy = 0; + + if (x < -D51LENGTH) + return ERR; + y = LINES / 2 - 5; + + for (i = 0; i <= D51HEIGHT; ++i) { + my_mvaddstr(y + i, x, d51[(D51LENGTH + x) % D51PATTERNS][i]); + my_mvaddstr(y + i + dy, x + 53, coal[i]); + } + add_smoke(y - 1, x + D51FUNNEL); + return OK; +} + +int main(int argc, char *argv[]) { + int x, i; + + initscr(); + signal(SIGINT, SIG_IGN); + noecho(); + curs_set(0); + nodelay(stdscr, TRUE); + leaveok(stdscr, TRUE); + scrollok(stdscr, FALSE); + + for (x = COLS - 1; ; --x) { + if (add_D51(x) == ERR) break; + getch(); + refresh(); + usleep(40000); + } + mvcur(0, COLS - 1, LINES - 1, 0); + endwin(); +}