Exemplo n.º 1
0
static bool game_fetch_preset(int i, char **name, game_params **params)
{
    static struct {
        const char *title;
        game_params params;
    } const presets[] = {
        { "3x3 rows only", { 3, 3, 2, true, false } },
        { "3x3 normal", { 3, 3, 2, false, false } },
        { "3x3 orientable", { 3, 3, 2, false, true } },
        { "4x4 normal", { 4, 4, 2, false } },
        { "4x4 orientable", { 4, 4, 2, false, true } },
        { "4x4, rotating 3x3 blocks", { 4, 4, 3, false } },
        { "5x5, rotating 3x3 blocks", { 5, 5, 3, false } },
        { "6x6, rotating 4x4 blocks", { 6, 6, 4, false } },
    };
    /* _("3x3 rows only"), _("3x3 normal"), _("3x3 orientable"), _("4x4 normal"), _("4x4 orientable"), _("4x4 radius 3"), _("5x5 radius 3"), _("6x6 radius 4") */

    if (i < 0 || i >= lenof(presets))
        return false;

    *name = dupstr(_(presets[i].title));
    *params = dup_params(&presets[i].params);

    return true;
}
Exemplo n.º 2
0
static bool game_fetch_preset(int i, char **name, game_params **params)
{
    if (i < 0 || i >= lenof(guess_presets))
        return false;

    *name = dupstr(_(guess_presets[i].name)); /* _("Standard"), _("Super") */
    /*
     * get round annoying const issues
     */
    {
        game_params tmp = guess_presets[i].params;
        *params = dup_params(&tmp);
    }

    return true;
}
Exemplo n.º 3
0
static int game_fetch_preset(int i, char **name, game_params **params)
{
    if (i < 0 || i >= lenof(guess_presets))
        return FALSE;

    *name = dupstr(guess_presets[i].name);
    /*
     * get round annoying const issues
     */
    {
        game_params tmp = guess_presets[i].params;
        *params = dup_params(&tmp);
    }

    return TRUE;
}
Exemplo n.º 4
0
static int game_fetch_preset(int i, char **name, game_params **params)
{
    static struct {
        char *title;
        game_params params;
    } presets[] = {
        { "3x3 rows only", { 3, 3, 2, TRUE, FALSE } },
        { "3x3 normal", { 3, 3, 2, FALSE, FALSE } },
        { "3x3 orientable", { 3, 3, 2, FALSE, TRUE } },
        { "4x4 normal", { 4, 4, 2, FALSE } },
        { "4x4 orientable", { 4, 4, 2, FALSE, TRUE } },
        { "4x4, rotating 3x3 blocks", { 4, 4, 3, FALSE } },
        { "5x5, rotating 3x3 blocks", { 5, 5, 3, FALSE } },
        { "6x6, rotating 4x4 blocks", { 6, 6, 4, FALSE } },
    };

    if (i < 0 || i >= lenof(presets))
        return FALSE;

    *name = dupstr(presets[i].title);
    *params = dup_params(&presets[i].params);

    return TRUE;
}