mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
111 lines
2 KiB
C
111 lines
2 KiB
C
/*
|
|
* Copyright (C) 2013 Andrea Mazzoleni
|
|
*
|
|
* 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. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
/**
|
|
* Combinations of 6 elements.
|
|
* Ends is marked with first element as -1.
|
|
*/
|
|
static int combo[][32][8] = {
|
|
/* combinations of 1 of 6 elements */
|
|
{
|
|
{ 0 },
|
|
{ 1 },
|
|
{ 2 },
|
|
{ 3 },
|
|
{ 4 },
|
|
{ 5 },
|
|
{ -1 }
|
|
},
|
|
/* combinations of 2 of 6 elements */
|
|
{
|
|
{ 0, 1 },
|
|
{ 0, 2 },
|
|
{ 0, 3 },
|
|
{ 0, 4 },
|
|
{ 0, 5 },
|
|
{ 1, 2 },
|
|
{ 1, 3 },
|
|
{ 1, 4 },
|
|
{ 1, 5 },
|
|
{ 2, 3 },
|
|
{ 2, 4 },
|
|
{ 2, 5 },
|
|
{ 3, 4 },
|
|
{ 3, 5 },
|
|
{ 4, 5 },
|
|
{ -1 }
|
|
},
|
|
/* combinations of 3 of 6 elements */
|
|
{
|
|
{ 0, 1, 2 },
|
|
{ 0, 1, 3 },
|
|
{ 0, 1, 4 },
|
|
{ 0, 1, 5 },
|
|
{ 0, 2, 3 },
|
|
{ 0, 2, 4 },
|
|
{ 0, 2, 5 },
|
|
{ 0, 3, 4 },
|
|
{ 0, 3, 5 },
|
|
{ 0, 4, 5 },
|
|
{ 1, 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