Help for combinations

Help for combinations

Postby Silvio.Falconi » Sat Nov 28, 2015 1:06 pm

I have 15 combinations
and save on array the random number

Local aCombinations:= { {0,0,0,0,0 } ,;
{0,0,0,0,0 } ,;
{0,0,0,0,0 }}


nNumero1 := hb_RandomInt( 0, 9 )
....

aCombinations[1][1]:= nNumero1
aCombinations[1][2]:= nNumero2
aCombinations[1][3]:= nNumero3
aCombinations[1][4]:= nNumero4
aCombinations[1][5]:= nNumero5
aCombinations[2][1]:= nNumero6
aCombinations[2][2]:= nNumero7
aCombinations[2][3]:= nNumero8
aCombinations[2][4]:= nNumero9
aCombinations[2][5]:= nNumero10
aCombinations[3][1]:= nNumero11
aCombinations[3][2]:= nNumero12
aCombinations[3][3]:= nNumero13
aCombinations[3][4]:= nNumero14
aCombinations[3][5]:= nNumero15



I controlled aCombinations with xbrowser



how can I see all the combinations that if all the numbers are the same
for a sample :
for the the horizontal lines (1,2,3),
for diagonally (1,2)


for a sample we can have the first line Horizontal

If nNumero1= Numero2 .and. nNumero2=nNumero3
lWin:= .t.
nlevl:= 3
If nNumero1= Numero2 .and. nNumero2=nNumero3 .and. nNumero3=nNumero4
lWin:= .t.
nLevl:= 4
If nNumero1= Numero2 .and. nNumero2=nNumero3 .and. nNumero3=nNumero4 .and. nNumero4=nNumero5
lWin:= .t.
nLevl:= 5

Endif
Endif
Endif

possible is not a function math we can control the matrice ?

the number init from zero
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7048
Joined: Thu Oct 18, 2012 7:17 pm

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 57 guests

cron