static char DESCRIPTION[] = 
    
    
    
    
    
    ;

static int total;


void update(char* player, int move)
{
    printf(, player, total + move, total, move);
    total += move;
    if (total == GOAL)
        printf(_(), player);
}


int ai()
{


    static const int precomputed[] = { 1, 1, 3, 2, 1, 1, 3, 2, 1, 1, 3, 2, 1, 1,
        3, 2, 1, 1, 3, 2, 1, 1, 3, 2, 1, 1, 3, 2, 1, 1, 3 };
    update(_(), precomputed[total]);

    static const int precomputed[] = { 1, 1, 3, 2};
    update(_(), precomputed[total % (MAX_MOVE + 1)]);

    int i;
    int move = 1;
    for (i = MIN_MOVE; i <= MAX_MOVE; i++)
        if ((total + i - 1) % (MAX_MOVE + 1) == 0)
            move = i;
    for (i = MIN_MOVE; i <= MAX_MOVE; i++)
        if (total + i == GOAL)
            move = i;
    update(_(), move);

}


void human(void)
{
    char buffer[BUFFER_SIZE];
    int move;

    while ( printf(_()),
            fgets(buffer, BUFFER_SIZE, stdin), 
            sscanf(buffer, , &move) != 1 ||
            (move && (move < MIN_MOVE || move > MAX_MOVE || total+move > GOAL)))
        puts(_());
    putchar('\n');
    if (!move) exit(EXIT_SUCCESS);
    update(_(), move);
}


int main(int argc, char* argv[])
{
    srand(time(NULL));
    puts(_(DESCRIPTION));
    while (true)
    {
        puts(_());
        puts(_());
        total = 0;

        if (rand() % NUMBER_OF_PLAYERS)
        {
            puts(_());
            ai();
        }
        else
            puts(_());

        while (total < GOAL)
        {
            human();
            ai();
        }
    }
}