shithub: rott

ref: ee35eec9bac04ce55e5fe1ae1eeb5428b47d91a8
dir: /src/_rt_rand.h/

View raw version
/*
Copyright (C) 1994-1995  Apogee Software, Ltd.
Copyright (C) 2002-2015  icculus.org, GNU/Linux port
Copyright (C) 2017-2018  Steven LeVesque

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _rt_rand_private
#define _rt_rand_private

//****************************************************************************
//
// Private header for RT_RAND.C
//
//****************************************************************************

#define SIZE_OF_RANDOM_TABLE   2048

static const unsigned char RandomTable[ SIZE_OF_RANDOM_TABLE ] =
{
    107,   65,  179,   81,  212,    1,   34,  230,
    167,  142,   82,   27,   62,   88,  140,  119,
    222,  252,  254,  160,   26,   33,   30,  234,
    162,  216,  126,   42,   20,  108,  245,  150,
    167,  145,  215,  226,  153,  184,  251,  141,
    116,  225,  201,  114,  111,   92,  223,  185,
    199,  160,  244,  190,  113,   77,  217,  239,
    15,  239,  129,  243,   21,  242,  202,  183,
    49,  151,   38,   38,  147,  179,  234,  130,
    138,  110,  228,  118,   93,   81,  253,   98,
    246,   44,   75,  161,  189,   86,   85,  204,
    169,   95,  199,  178,  186,  123,  200,  250,
    118,  242,   86,   48,    7,  205,   71,  132,
    185,  214,  192,   68,  191,  236,  175,  197,
    199,  177,  163,   57,  220,  139,  133,  182,
    91,  196,  246,   29,  177,   82,  184,  226,
    209,  151,  206,  250,  195,  119,  193,  235,
    144,  146,   58,   61,  245,   83,  204,  214,
    249,  164,  212,  172,   90,  199,  242,  182,
    228,  159,  127,   37,  209,  165,   89,  122,
    87,  254,  222,   43,  148,  205,  155,  230,
    74,  127,  238,  181,  154,  170,  232,   47,
    105,   31,   96,  166,  208,    5,  201,   73,
    244,   67,   55,  168,   84,  221,  251,   85,
    44,  198,    8,   35,  229,  122,  229,   80,
    137,   28,  202,  135,  211,   69,  100,  250,
    224,  156,   75,  128,  176,   53,  207,  157,
    241,  216,  210,  124,  163,  248,  223,  174,
    241,  235,   97,  120,   25,    3,  218,  102,
    143,  187,  202,  116,  209,  253,  227,  151,
    203,  254,  223,   65,  146,  255,  231,  237,
    162,  187,  194,   90,  198,   81,  219,   94,
    70,  158,  106,  175,   81,  239,  181,   79,
    62,  184,   21,   30,   98,  245,  233,    8,
    57,   54,  133,   95,   43,  125,  161,  109,
    167,  130,   32,   46,   72,    3,   42,   34,
    147,  139,   19,  122,   49,   23,  253,  192,
    231,  116,  165,    8,   15,   16,  223,  140,
    29,  136,    2,  114,  248,  219,  214,  168,
    36,  241,  210,   63,  230,   42,  197,  100,
    134,  159,  179,  149,   17,   96,  152,   45,
    93,  151,   26,  202,   35,   58,  189,  220,
    74,  173,  250,   76,   57,   52,   55,   14,
    205,   80,  213,  190,   14,  108,   60,   89,
    236,   41,   53,   59,  249,  237,   88,  217,
    129,  252,  169,  123,   87,   23,   91,   79,
    36,  164,   89,   24,  102,  111,  104,  115,
    116,  221,  212,   82,  166,   16,  244,   18,
    68,   73,   64,  194,   82,  115,  121,  216,
    133,   47,   85,  124,  242,  144,    1,   65,
    0,   75,   91,   83,  137,  183,  132,   15,
    66,  227,   67,   98,  186,  100,  208,  150,
    74,   61,   69,  130,  120,   56,   39,   21,
    44,  166,  180,  145,   97,  101,   68,   19,
    243,  162,  222,  228,    9,  160,  185,   10,
    168,   64,  109,  198,  113,   75,   48,   52,
    119,  163,  176,  201,   12,  246,   20,   92,
    31,  175,   33,    4,   70,  169,  218,   86,
    240,  127,    7,   38,  102,   94,  112,   90,
    114,   63,  139,  119,   45,    5,  183,  224,
    155,   13,  141,   90,   93,  177,  118,   67,
    211,  117,   58,  158,  135,   83,  236,  194,
    72,   59,  131,   40,  196,  232,  247,  132,
    18,   73,   37,  207,   50,  187,   32,  174,
    13,   34,  135,   39,   46,  192,   51,  203,
    216,    3,  188,   99,  245,  112,   61,  206,
    127,  118,  136,  186,  153,  148,  140,  106,
    55,  201,   19,    9,   27,   97,   84,   24,
    48,  227,  108,  202,    5,  190,    6,  235,
    160,  146,  123,  222,  212,  147,   27,   28,
    50,  226,  200,  221,  180,  244,   34,  146,
    41,  104,   37,  217,   10,  238,   52,  198,
    4,   29,  126,   16,   45,  124,   64,   25,
    40,   20,  138,  225,   71,  247,  128,   62,
    62,  178,   31,  251,  197,  215,  226,  193,
    28,   25,   82,   15,   21,   43,   30,   86,
    50,   99,  199,  191,   80,  171,  250,    4,
    149,   61,  163,  128,  143,   95,   76,   56,
    14,  109,   54,   84,  137,   43,   77,  255,
    204,  151,  129,    8,   20,   26,  193,   38,
    205,  125,  203,   22,   78,   47,  101,   37,
    121,  113,  141,   36,   33,   23,  131,   55,
    78,   96,  123,  228,   69,  213,   51,  147,
    195,  195,   85,   54,  225,   65,  143,   13,
    152,   60,  110,   29,  146,  179,  164,   17,
    96,   67,  156,    7,    3,   92,   26,  104,
    157,  220,  211,  154,  103,    2,  174,  136,
    83,  229,   18,  116,   66,   87,    0,   74,
    98,   58,   75,  162,  254,  177,   89,  173,
    169,  107,   12,   90,   71,  193,   53,  255,
    138,    2,  233,  163,   11,  138,  183,  209,
    119,  210,  249,  112,  113,   30,  185,  180,
    11,  171,  164,   77,    5,   99,   35,  218,
    11,  159,  221,  148,  170,  137,  129,  188,
    231,  172,  191,  135,  176,   33,  189,   68,
    190,  152,    7,  220,  246,  203,  181,   63,
    199,   91,  251,  208,  217,   39,  170,  111,
    182,  209,  216,  247,  240,  165,  153,  118,
    238,  233,  204,   12,  126,  105,  168,  234,
    38,  184,  132,  110,  145,  227,  165,   92,
    241,   24,  251,  231,  213,  126,  240,  214,
    31,   11,  223,   46,    0,   35,  218,  242,
    211,  191,   48,  110,  253,   94,  161,  139,
    42,  148,  198,  246,  239,  107,   57,    5,
    117,  252,    9,   12,   73,   77,   58,  167,
    6,  142,   32,   34,   72,   31,  243,  170,
    0,   93,  182,   56,  254,  158,  250,   23,
    77,   81,   45,   69,  142,  237,  225,   44,
    232,  142,  209,  115,   61,   38,  224,   70,
    53,   82,   10,  229,  214,  224,  101,   42,
    100,  121,  133,   85,   67,  150,  116,   91,
    79,   79,  235,   22,    1,  244,   16,  101,
    88,   25,   43,  242,   53,  106,  128,   40,
    18,    2,  196,   22,   47,   96,  130,  249,
    49,  117,  178,  171,  132,  189,   95,   66,
    153,  200,   71,   71,  215,  113,  102,  131,
    172,  235,  192,  204,  107,  127,   60,   52,
    254,   84,   20,   27,  107,   44,   72,  149,
    230,   87,   64,  144,  140,  186,  154,   49,
    76,  156,  162,  219,    9,  146,   41,   80,
    59,  142,  147,  184,  115,  158,  103,  140,
    8,  234,  157,   17,  112,   22,  163,  187,
    47,  178,  207,   63,  125,  202,  156,   30,
    97,  193,  171,  173,  204,   28,    4,  195,
    109,  211,  105,  103,  179,  221,  203,  138,
    139,  172,   14,   44,  119,  150,  185,  180,
    205,  255,  152,   94,  205,  173,   40,  134,
    13,   65,  194,  196,   68,  124,   26,  134,
    85,  228,   50,  216,  159,  254,  237,  206,
    103,   69,   90,  187,  182,  183,    2,  114,
    3,  201,    1,  129,  212,  232,   81,   33,
    56,  182,  133,  176,   19,    6,  144,   84,
    145,   24,  243,  234,   35,   25,   89,  150,
    54,  143,  207,  104,  248,  102,   41,  253,
    46,   44,  197,  208,  200,   52,  219,  238,
    223,  241,   60,  230,  196,   42,   88,   51,
    170,   25,   40,  114,   39,   45,   57,   29,
    186,   54,   36,  167,   51,  249,  194,  108,
    250,  199,   67,  212,  123,  151,   92,   32,
    46,   12,  248,  165,  223,   24,  143,  189,
    120,   57,   38,  222,  169,   17,  188,   27,
    209,  176,  215,  108,  177,   96,   50,  154,
    41,   15,   32,  181,   99,  120,   73,  225,
    49,  200,   43,  177,   72,  202,   97,   92,
    240,  110,  252,   21,   28,  192,   70,  128,
    85,   60,  127,   63,  235,  100,  155,   65,
    241,  119,   34,   80,   75,  117,  148,  102,
    15,   90,  121,  206,  104,  164,  132,   98,
    36,  108,  214,    0,   84,   94,  107,  154,
    14,   26,   23,   93,  195,  224,  162,  171,
    245,   76,  125,  158,  120,   66,   80,  130,
    183,  120,  179,  118,   31,  176,  106,  184,
    164,  111,   59,  253,  118,   62,  114,  215,
    156,  161,  127,  210,  112,  122,  204,   86,
    29,   69,  187,  218,  233,   47,  188,   91,
    105,  153,  236,  116,  135,   19,   83,  175,
    88,  166,  156,  238,  245,  227,  248,  161,
    10,  180,   22,  230,  157,  205,    6,   37,
    3,  234,  155,   49,  239,  229,  122,  223,
    234,  206,   82,  135,  190,   77,  130,  197,
    144,  226,  123,  181,  143,  208,  169,    8,
    1,  174,   97,  177,  232,  201,  210,  193,
    192,   62,  211,   28,  252,   19,  189,  229,
    191,  246,    7,  202,   35,   20,   28,   30,
    70,  221,   55,  159,  237,   10,   15,  134,
    124,  103,   73,  172,   26,  201,   13,  117,
    35,  131,  136,   66,   33,  245,  159,  207,
    225,  147,   18,  248,  126,  131,   33,  153,
    101,   60,  186,  216,  250,   11,   30,   50,
    57,   58,  151,  178,  181,  227,  128,  253,
    10,    5,  224,   48,  160,   34,    7,  111,
    124,   27,  160,   75,  137,   17,   53,   39,
    243,  236,   39,   81,  217,  122,   79,   32,
    13,  115,  191,  167,  137,   87,  228,   91,
    86,   78,   18,   22,   40,   76,   94,  129,
    119,   87,   63,  197,  203,   21,  218,  185,
    166,   49,  161,  213,   38,  111,  209,  154,
    43,  152,  134,  132,    4,  133,  108,   83,
    145,   41,   97,   74,  251,  173,   42,  213,
    46,  118,   73,   68,   21,  244,  106,  158,
    11,   90,  252,  140,   44,  157,  194,   66,
    229,   58,  215,  251,  144,  125,  146,  172,
    165,  136,  105,  102,  173,   95,  150,  169,
    78,  230,  111,  160,  196,  112,  120,  231,
    168,  152,  149,  174,  128,  232,  194,  122,
    3,   74,  231,  105,   12,  239,  180,  239,
    89,  235,   95,  157,  149,  187,    6,  203,
    188,   71,  110,    8,  126,  242,  188,  249,
    71,  123,  162,   93,   59,   65,   16,  222,
    192,   24,   27,  142,  168,  114,   89,  220,
    226,  182,  207,   94,  195,  207,  174,  228,
    142,  130,  115,  175,  154,  106,  206,   48,
    185,  147,  155,  224,  239,   64,   88,   83,
    54,  247,  113,  248,  137,   96,    5,  110,
    240,   51,    1,  208,  166,  200,  233,  167,
    230,   14,   20,  198,   36,   13,    0,  220,
    165,  104,   85,  122,    1,  255,  212,  161,
    190,   37,   86,  226,  195,  105,   78,  244,
    236,  168,   48,  211,  121,  216,   25,  144,
    16,  237,    7,   75,   12,   99,   56,  109,
    218,   87,   35,  204,  155,   61,  191,   41,
    61,   57,  121,  236,   62,   22,  187,   95,
    92,   69,  210,  163,  205,  214,   34,   84,
    73,  184,  109,  124,  231,  103,  217,  241,
    77,  175,  183,  232,  198,  164,   14,  125,
    103,  197,  249,  241,  176,   59,   48,   50,
    25,  222,  134,  199,  252,  196,   23,   19,
    78,    0,   59,  120,   91,  121,  117,  228,
    52,   68,  113,  127,  141,   67,   65,  130,
    132,  243,  160,  138,  138,  116,   10,   98,
    170,   70,  246,  206,  219,   28,   94,  226,
    29,   58,  255,   31,  141,   82,  134,  152,
    251,   84,   52,   23,  154,  139,   74,   55,
    47,  198,  167,  162,    4,   16,  220,   53,
    37,  158,  135,  136,  190,   86,  151,  178,
    238,  161,   88,  171,  148,  169,  137,  212,
    181,  146,  189,   70,   49,   79,  142,  131,
    195,  126,  149,  156,   93,   55,  164,  174,
    87,  243,   66,   92,  207,    9,  126,  123,
    40,   51,  133,  143,    9,   55,  193,  173,
    56,   64,  210,  159,    6,  178,  145,  153,
    115,  215,  185,  238,  101,  210,   98,  157,
    95,  171,  235,  217,  240,  232,  107,   53,
    54,  211,  111,  236,  100,   37,  147,   64,
    60,  215,  174,  136,  128,   98,   79,  234,
    145,   76,  197,  165,  191,  141,  114,  109,
    148,  214,   93,   12,  163,  125,  222,   96,
    71,  220,    8,  225,  200,   14,  139,  166,
    155,    9,  237,    9,  172,    6,  229,  179,
    247,   76,   24,  213,   26,  248,   56,  247,
    106,  221,   63,   20,  206,  231,  168,  196,
    208,   36,   31,  175,  178,  255,  124,  156,
    129,  186,   45,  201,    7,  112,  189,   68,
    225,   64,  150,   74,    2,  218,   62,  159,
    4,   11,  213,   40,   23,   15,   67,   52,
    182,  203,  246,  194,   72,   33,   89,  104,
    16,  131,   60,  150,  243,   21,   59,  175,
    219,  149,   56,  224,   32,  105,  153,   99,
    80,  148,  107,   99,  108,   43,  106,   41,
    32,  244,    4,  186,  253,   27,  233,  104,
    245,    5,    2,  252,  170,    2,  101,   39,
    17,  166,  221,   11,  227,  129,  103,   45,
    144,   79,   17,  139,   70,  237,  176,    6,
    76,  134,   54,   30,   69,   13,  100,  149,
    141,  227,  255,   22,  179,   61,   88,   97,
    121,   29,   24,   77,  170,  190,  242,  109,
    152,   47,   81,  140,   45,   46,  249,   78,
    180,  143,  102,   19,  208,  177,   72,   72,
    247,   51,  115,    3,  141,  117,   39,  188,
    180,  171,   83,    1,    0,   51,  100,  112,
    172,   18,  219,  136,  155,  125,  200,  131,
    157,  217,   78,   63,  213,  238,  193,  173,
    145,   46,  101,  158,   42,  140,  110,   66,
    183,  181,  233,  188,   10,  133,   36,  135,
    17,  254,  138,  233,  117,  240,  184,   80,
    113,   18,   99,  219,  240,   50,  192,  247
};

#endif