sl-rust 1.0.16

SL - An ASCII art train animation
Documentation
// ASCII art definitions from original sl.h

pub const D51_HEIGHT: usize = 10;
pub const D51_FUNNEL: usize = 7;
pub const D51_LENGTH: usize = 83;
pub const D51_PATTERNS: usize = 6;

pub const LOGO_HEIGHT: usize = 6;
pub const LOGO_FUNNEL: usize = 4;
pub const LOGO_LENGTH: usize = 84;
pub const LOGO_PATTERNS: usize = 6;

pub const D51_STR: [&str; 7] = [
    "      ====        ________                ___________ ",
    "  _D _|  |_______/        \\__I_I_____===__|_________| ",
    "   |(_)---  |   H\\________/ |   |        =|___ ___|   ",
    "   /     |  |   H  |  |     |   |         ||_| |_||   ",
    "  |      |  |   H  |__--------------------| [___] |   ",
    "  | ________|___H__/__|_____/[][]~\\_______|       |   ",
    "  |/ |   |-----------I_____I [][] []  D   |=======|__ ",
];

pub const D51_WHL: [[&str; 3]; 6] = [
    [
        "__/ =| o |=-~~\\  /~~\\  /~~\\  /~~\\ ____Y___________|__ ",
        " |/-=|___|=    ||    ||    ||    |_____/~\\___/        ",
        "  \\_/      \\O=====O=====O=====O_/      \\_/            ",
    ],
    [
        "__/ =| o |=-~~\\  /~~\\  /~~\\  /~~\\ ____Y___________|__ ",
        " |/-=|___|=O=====O=====O=====O   |_____/~\\___/        ",
        "  \\_/      \\__/  \\__/  \\__/  \\__/      \\_/            ",
    ],
    [
        "__/ =| o |=-O=====O=====O=====O \\ ____Y___________|__ ",
        " |/-=|___|=    ||    ||    ||    |_____/~\\___/        ",
        "  \\_/      \\__/  \\__/  \\__/  \\__/      \\_/            ",
    ],
    [
        "__/ =| o |=-~O=====O=====O=====O\\ ____Y___________|__ ",
        " |/-=|___|=    ||    ||    ||    |_____/~\\___/        ",
        "  \\_/      \\__/  \\__/  \\__/  \\__/      \\_/            ",
    ],
    [
        "__/ =| o |=-~~\\  /~~\\  /~~\\  /~~\\ ____Y___________|__ ",
        " |/-=|___|=   O=====O=====O=====O|_____/~\\___/        ",
        "  \\_/      \\__/  \\__/  \\__/  \\__/      \\_/            ",
    ],
    [
        "__/ =| o |=-~~\\  /~~\\  /~~\\  /~~\\ ____Y___________|__ ",
        " |/-=|___|=    ||    ||    ||    |_____/~\\___/        ",
        "  \\_/      \\_O=====O=====O=====O/      \\_/            ",
    ],
];

pub const D51_COAL: [&str; 10] = [
    "                              ",
    "                              ",
    "    _________________         ",
    "   _|                \\_____A  ",
    " =|                        |  ",
    " -|                        |  ",
    "__|________________________|_ ",
    "|__________________________|_ ",
    "   |_D__D__D_|  |_D__D__D_|   ",
    "    \\_/_\\_/_/    \\_/_\\_/_/    ",
];

// C51 definitions
pub const C51_HEIGHT: usize = 10;
pub const C51_FUNNEL: usize = 7;
pub const C51_LENGTH: usize = 95;
pub const C51_PATTERNS: usize = 6;

pub const C51_STR: [&str; 7] = [
    "      ____                                                    ",
    "  _D _|  |_______________________________________________________  ",
    "   |(_)---  |                             C51 \\\\__________/| \\\\  ",
    "   /     |  |                                             | |    ",
    "  |      |  |                                            /  \\\\   ",
    "  | ________|________________________________________________\\\\__  ",
    "  |/ |   |-----------I_____I [][] []  C   |=======|________| |  ",
];

pub const C51_WHL: [[&str; 3]; 6] = [
    [
        "__/ =| o |=-~~\\  /~~\\  /~~\\  /~~\\ ____Y___________|__    ",
        " |/-=|___|=    ||    ||    ||    |_____/~\\___/         ",
        "  \\_/      \\O=====O=====O=====O_/      \\_/             ",
    ],
    [
        "__/ =| o |=-~~\\  /~~\\  /~~\\  /~~\\ ____Y___________|__    ",
        " |/-=|___|=O=====O=====O=====O   |_____/~\\___/         ",
        "  \\_/      \\__/  \\__/  \\__/  \\__/      \\_/             ",
    ],
    [
        "__/ =| o |=-O=====O=====O=====O \\ ____Y___________|__    ",
        " |/-=|___|=    ||    ||    ||    |_____/~\\___/         ",
        "  \\_/      \\__/  \\__/  \\__/  \\__/      \\_/             ",
    ],
    [
        "__/ =| o |=-~O=====O=====O=====O\\ ____Y___________|__    ",
        " |/-=|___|=    ||    ||    ||    |_____/~\\___/         ",
        "  \\_/      \\__/  \\__/  \\__/  \\__/      \\_/             ",
    ],
    [
        "__/ =| o |=-~~\\  /~~\\  /~~\\  /~~\\ ____Y___________|__    ",
        " |/-=|___|=   O=====O=====O=====O|_____/~\\___/         ",
        "  \\_/      \\__/  \\__/  \\__/  \\__/      \\_/             ",
    ],
    [
        "__/ =| o |=-~~\\  /~~\\  /~~\\  /~~\\ ____Y___________|__    ",
        " |/-=|___|=    ||    ||    ||    |_____/~\\___/         ",
        "  \\_/      \\_O=====O=====O=====O/      \\_/             ",
    ],
];

pub const C51_COAL: [&str; 10] = [
    "                              ",
    "                              ",
    "    _________________         ",
    "   _|                \\_____A  ",
    " =|                        |  ",
    " -|                        |  ",
    "__|________________________|_ ",
    "|__________________________|_ ",
    "   |_D__D__D_|  |_D__D__D_|   ",
    "    \\_/_\\_/_/    \\_/_\\_/_/    ",
];

// LOGO (SL)
pub const LOGO_STR: [&str; 4] = [
    "   ;  ; ",
    "  ;;; ;;",
    "   ;  ; ",
    "         ",
];

pub const LOGO_WHL: [[&str; 2]; 6] = [
    [
        "  /~\\___/~\\  /~\\___/~\\ ",
        " /  O  O  O \\/ O  O  O \\",
    ],
    [
        "  /~\\___/~\\  /~\\___/~\\ ",
        " / O  O  O  O  O  O  O ",
    ],
    [
        "  /~\\___/~\\  /~\\___/~\\ ",
        "O  O  O  O  O  O  O  O ",
    ],
    [
        "  /~\\___/~\\  /~\\___/~\\ ",
        " O  O  O  O  O  O  O  /",
    ],
    [
        "  /~\\___/~\\  /~\\___/~\\ ",
        " /  O  O  O  O  O  O  /",
    ],
    [
        "  /~\\___/~\\  /~\\___/~\\ ",
        " \\  O  O  O  O  O  O  /",
    ],
];

pub const LOGO_COAL: [&str; 7] = [
    "           ",
    " ~~^~~~^~~ ",
    "~~^~^~^~^~ ",
    "^~^~^~^~^~ ",
    " ^~^~^~^~^ ",
    "  (o)(o)   ",
    "           ",
];

pub const LOGO_CAR: [&str; 7] = [
    "    _______ ",
    "   /  ___  \\",
    "  |  | S  | |",
    "  |  | L  | |",
    "   \\ |____| /",
    "    \\_____/ ",
    "            ",
];

pub const MAN: [&str; 2] = [
    "  o_o ",
    "   | ",
];

// C-compatible smoke patterns (2 kinds x 16 steps)
// kind=0: normal smoke, kind=1: accident mode smoke
pub const SMOKE_PATTERN: [[&str; 16]; 2] = [
    [
        // kind=0: normal smoke
        "(   )",   // 0: expand
        "(    )",  // 1
        "(    )",  // 2
        "(   )",   // 3
        "(  )",    // 4: contract
        "(  )",    // 5
        "( )",     // 6
        "( )",     // 7
        "()",      // 8
        "()",      // 9
        "O",       // 10: dots
        "O",       // 11
        "O",       // 12
        "O",       // 13
        "O",       // 14
        " ",       // 15: disappear
    ],
    [
        // kind=1: accident mode smoke
        "(@@@)",   // 0: expand
        "(@@@@)",  // 1
        "(@@@@)",  // 2
        "(@@@)",   // 3
        "(@@)",    // 4: contract
        "(@@)",    // 5
        "(@)",     // 6
        "(@)",     // 7
        "@@",      // 8
        "@@",      // 9
        "@",       // 10: dots
        "@",       // 11
        "@",       // 12
        "@",       // 13
        "@",       // 14
        " ",       // 15: disappear
    ],
];

// C-compatible dy/dx arrays (movement per pattern)
pub const SMOKE_DY: [i32; 16] = [
    2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
];

pub const SMOKE_DX: [i32; 16] = [
    -2, -1, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3
];

// Eraser patterns (space strings matching smoke pattern sizes)
pub const SMOKE_ERASER: [&str; 16] = [
    "     ",  // pattern 0: matches "(   )"
    "      ", // pattern 1: matches "(    )"
    "      ", // pattern 2: matches "(    )"
    "     ",  // pattern 3: matches "(   )"
    "    ",   // pattern 4: matches "(  )"
    "    ",   // pattern 5: matches "(  )"
    "   ",    // pattern 6: matches "( )"
    "   ",    // pattern 7: matches "( )"
    "  ",     // pattern 8: matches "()"
    "  ",     // pattern 9: matches "()"
    " ",      // pattern 10: matches "O"
    " ",      // pattern 11: matches "O"
    " ",      // pattern 12: matches "O"
    " ",      // pattern 13: matches "O"
    " ",      // pattern 14: matches "O"
    " ",      // pattern 15: matches " "
];