Matricial calc

Matricial calc

Postby Silvio » Wed Oct 07, 2009 11:42 am

I HAVE A SYSTEM COMBINATION OF NUMBERS

01.02.03.04.05.06.07.08.09.11
01.02.03.04.05.06.07.08.09.12
01.02.03.04.05.06.07.08.10.11
01.02.03.04.05.06.07.09.10.12
01.02.03.04.05.08.09.10.11.12
01.02.03.04.06.07.09.10.11.12
01.02.03.04.05.06.08.10.11.12
01.02.04.05.07.08.09.10.11.12
01.03.04.06.07.08.09.10.11.12
01.04.05.06.07.08.09.10.11.12
02.03.05.06.07.08.09.10.11.12


THEN Let's say the user has selected the following 12 NUMBERS

2 - 4 - 6 - 8 - 9 - 11 - 13 - 16 - 17 - 18 - 19 - 20


THE FIRST STRING OF NUMBERS REPRESENTING THE FIRST COMBINATION SHOULD BE:

2 - 4 - 6 - 8 - 9 - 11 - 13 - 16 - 17 - 19

THE SECOND STRING OF NUMBERS REPRESENTING THE FIRST COMBINATION SHOULD BE:

2 - 4 - 6 - 8 - 9 - 11 - 13 - 16 - 17 - 20


And so on until the END OF THE COMBINATION OF THE SYSTEM


HOW I could create this combination?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Matricial calc

Postby Silvio » Wed Oct 07, 2009 4:51 pm

any Idea ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Matricial calc

Postby sambomb » Wed Oct 07, 2009 4:57 pm

Exeplain better what you want, give an example of the calc too
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Matricial calc

Postby Silvio » Thu Oct 08, 2009 7:13 am

Now I created a dbf to save the combination system

STCODICE WFL0001 Code of the system

and on these fields I copied the system combination for each linea sample :

01.02.03.04.05.06.07.08.09.11

STNUM1 1
STNUM2 2
STNUM3 3
STNUM4 4
STNUM5 5
STNUM6 6
STNUM7 7
STNUM8 8
STNUM9 9
STNUM10 11




and then I have 11 records for that combination


then I create a array two direction type [x,y]


aSist[totnum,10]



totnum is the count of numbers I select : I select 12 numbers


Now I have :
aSist[12,10] the array of combination
Numeri[totnum] the array of number I selected


then I load each record of dbf into this array aSist

Now I must take the first asist[1,10] and see the position sample IF asist[1,10] = 8

and take the 8 number of my numbers and save it on new array

then I see the secon position and then for all posotions

Ho wI can Make it ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Matricial calc

Postby Daniel Garcia-Gil » Thu Oct 08, 2009 11:44 am

?????
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Matricial calc

Postby sambomb » Thu Oct 08, 2009 11:48 am

why the 10 numbers selected is 1..9 and 11? are these random numbers? what is the range of them?

why 11 records?

why totnum = 12 numbers?

Do a example that explain each step of the calc that you must do, like:

Take each number of the 10 numbers select, sum with the position, take each result and sum again...
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Matricial calc

Postby Silvio » Thu Oct 08, 2009 11:56 am

no there are not rando numbers

I want play 12 numbers but If I play 12 number I must pay many money and I make a system

you can play ten numbers for schedule but I have 12 number , and How I can make it ?

I use a combination system

01.02.03.04.05.06.07.08.09.11
01.02.03.04.05.06.07.08.09.12
01.02.03.04.05.06.07.08.10.11
01.02.03.04.05.06.07.09.10.12
01.02.03.04.05.08.09.10.11.12
01.02.03.04.06.07.09.10.11.12
01.02.03.04.05.06.08.10.11.12
01.02.04.05.07.08.09.10.11.12
01.03.04.06.07.08.09.10.11.12
01.04.05.06.07.08.09.10.11.12
02.03.05.06.07.08.09.10.11.12


these are not numbers but they are the position number i must take to create the line of number I must play

for sample
You must read the first line
you must take 01
but you must take the first number of my numbers
2 - 4 - 6 - 8 - 9 - 11 - 13 - 16 - 17 - 18 - 19 - 20

and save it

then I must take 02 you must take the number of my numbers wichi is on 02 position

2 - 4 - 6 - 8 - 9 - 11 - 13 - 16 - 17 - 18 - 19 - 20 ( I put on compress the numbers I take)

and then with all schem

at the end the procedure must create 11 lines of 10 numbers

Do you understand ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Matricial calc

Postby sambomb » Thu Oct 08, 2009 12:30 pm

Where you get:
2 - 4 - 6 - 8 - 9 - 11 - 13 - 16 - 17 - 18 - 19 - 20

?
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Matricial calc

Postby sambomb » Thu Oct 08, 2009 12:42 pm

Code: Select all  Expand view

Procedure Test()
Local aResult := {}, aCombination := {}, aNumbers := {}, aTemp := {}
Local Lin := 0, Col  := 0

aNumbers := {2 - 4 - 6 - 8 - 9 - 11 - 13 - 16 - 17 - 18 - 19 - 20 }

aAdd(aCombination,{01.02.03.04.05.06.07.08.09.11})
aAdd(aCombination,{01.02.03.04.05.06.07.08.09.12})
aAdd(aCombination,{01.02.03.04.05.06.07.08.10.11})
aAdd(aCombination,{01.02.03.04.05.06.07.09.10.12})
aAdd(aCombination,{01.02.03.04.05.08.09.10.11.12})
aAdd(aCombination,{01.02.03.04.06.07.09.10.11.12})
aAdd(aCombination,{01.02.03.04.05.06.08.10.11.12})
aAdd(aCombination,{01.02.04.05.07.08.09.10.11.12})
aAdd(aCombination,{01.03.04.06.07.08.09.10.11.12})
aAdd(aCombination,{01.04.05.06.07.08.09.10.11.12})
aAdd(aCombination,{02.03.05.06.07.08.09.10.11.12})

For Lin = 1 to 11
   aTemp := Array(10)
   For Col = 1 to 10
       aTemp[Col] := aNumbers[Val(aCombination[Lin,Col])]
   end
   aAdd(aResult,aTemp)
end

Return

 
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Matricial calc

Postby Silvio » Fri Oct 09, 2009 11:25 am

thanks I try to insert it on my source code but it not run ok








I save the system combination on a dbf





I made :
Code: Select all  Expand view


FUNCTION MAke_Calc (aSay,nTotRow,cSistema,cSistema1,numridotto,;
                numeri_in_gioco,numero_bollette ,numero_combinazioni)



   Local aSchemi[numeri_in_gioco,10]      //  array for create the system combination
   Local aTemp := Array(10)      //   array temp
   Local aResult := {}          //    array for the combination resulted
   Local aNumeri := Array(numeri_in_gioco)  // array for the  selected numbers from user
   Local Lin := 0, Col  := 0,j,w,i


   Local oDLg
   


     //save on array the selected numbers

      FOR j=1 to  numeri_in_gioco
              aNUMERI[J]:= aSay[j]:cargo
      NEXT

       w:=1

       //OPen the dbf and search the name of system

        oDSchemi:=Apri_dbf("WFLSchem")
                DO WHILE !(oDSchemi)->(EoF())
                   IF (oDSchemi)->SCCODICE=numridotto

  *                if found the code  load the array

                      FOR k=1 to 10
                              numero_campo:="scnum"+alltrim(str(k),2)
                              aSchemi[w,k]:=(oDSchemi)->&numero_campo
                           NEXT

                        endif

                          (oDSchemi)->(DbSkip())
                             w++
                           ENDDO


         Chiudi_Dbf("WFL",oDSchemi)

    // Now I have  load the array of system into aSist
 // e  now I go to take the number on their positions


  For Lin = 1 to numero_combinazioni

   For Col = 1 to 10
       aTemp[Col] := aNUMERI[(aSchemi[Lin,Col])]
   end
   aAdd(aResult,aTemp)

end



// now I can show the results


    DEFINE DIALOG oDlg  TiTle "Sistema calcolato"  SIZE 600,600;
                     STYLE nOr( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, 4 )

   For i=1 to numero_combinazioni

   @ i, 5 SAY  aResult[i]

NEXT


      ACTIVATE DIALOG oDlg

    return nil







 
Last edited by Silvio on Sat Oct 10, 2009 7:28 am, edited 1 time in total.
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Matricial calc

Postby sambomb » Fri Oct 09, 2009 11:39 am

Code: Select all  Expand view


Procedure Test()

Local aResult := {}, aCombination := {}, aNumbers := {}, aTemp := {}
Local Lin := 0, Col  := 0

   aNumbers := {2 , 4 , 6 , 8 , 9 , 11 , 13 , 16 , 17 , 18 , 19 , 20 }

   aAdd(aCombination,{01,02,03,04,05,06,07,08,09,11})
   aAdd(aCombination,{01,02,03,04,05,06,07,08,09,12})
   aAdd(aCombination,{01,02,03,04,05,06,07,08,10,11})
   aAdd(aCombination,{01,02,03,04,05,06,07,09,10,12})
   aAdd(aCombination,{01,02,03,04,05,08,09,10,11,12})
   aAdd(aCombination,{01,02,03,04,06,07,09,10,11,12})
   aAdd(aCombination,{01,02,03,04,05,06,08,10,11,12})
   aAdd(aCombination,{01,02,04,05,07,08,09,10,11,12})
   aAdd(aCombination,{01,03,04,06,07,08,09,10,11,12})
   aAdd(aCombination,{01,04,05,06,07,08,09,10,11,12})
   aAdd(aCombination,{02,03,05,06,07,08,09,10,11,12})

   For Lin = 1 to 11
      aTemp := Array(10)
      For Col = 1 to 10
          aTemp[Col] := aNumbers[aCombination[Lin,Col]]
      end
      aAdd(aResult,aTemp)
   end

   ApresentaMatriz(aResult,0)

Return

****************************************************************************
Procedure ApresentaMatriz(paMatriz,nZero,lTxt,cTxt)
****************************************************************************
*
* Apresentar uma matriz independente do numero de dimensoes
* Parametros: paMatriz
* Retorno:
*
* Autor: Samir
* 14/11/2008 - 17:05:55
*
****************************************************************************

local cMsg := "", nLen := 0, nDimensao := 0, m := 0, d := 0, lIgnoraZero := .F.

   Default nZero := 3, lTxt := !Empty(cTxt), cTxt := "C:\matriz.txt"

   If nZero = 0
      lIgnoraZero := .T.
   end

   nLen := Len(paMatriz)

   if ValType(paMatriz[1]) == "A"
      nDimensao := Len(paMatriz[1])
   else
      nDimensao := 0
   end

   For m := 1 to nLen

      If lIgnoraZero
         cMsg += ""
      else
         cMsg += StrZero(m,nZero)+" - {"
      end

      if nDimensao != 0
         For d := 1 to nDimensao
            cMsg += DadosVar(paMatriz[m,d])

            if d != nDimensao
               cMsg += ", "
            end

         end
      else
         cMsg += DadosVar(paMatriz[m])
      end

      If lIgnoraZero
         cMsg += ";"
      else
         cMsg += "};"
      end

   end

   If !lTxt

      MsgInfo(StrTran(cMsg,";",CRLF),"Informação")

   else

      If File(cTxt)
         fErase(cTxt)
      end

      MemoWrit(cTxt,StrTran(cMsg,";",CRLF))

   end

Return nil

/*------------------------------------------------------------------------*/

****************************************************************************
function DadosVar(xVar,lCompleto,cTitulo)
****************************************************************************
*
* Apresentar os dados de uma variável
* Parametros: xVar
* Retorno: Nenhum
*
* Autor: Samir
* 30/10/2008 - 10:32:55
*
****************************************************************************

local Result := "",nLen := 0, cTipo := "",cValor := ""

Default lCompleto := .F.

   cTipo := ValType(xVar)

   if cTipo = "C" .or. cTipo = "A"
      nLen := Len(xVar)
   else
      nLen := 0
   end

   if cTipo == "C"
      cValor := xVar
   elseif cTipo == "N"
      //cValor := Str(xVar,,,.T.)
      cValor := AllTrim(Str(xVar))
   elseif cTipo == "D"
      cValor := DtoC(xVar)
   elseif cTipo == "A"
      ApresentaMatriz(xVar)
      Return "Matriz"
   elseif cTipo == "O"
      cValor := "Objeto:" + xVar:ClassName()
   elseif cTipo == "U"
      cValor := "Nulo"
   elseif cTipo == "L"
      cValor := if(xVar,"True","False")
   else
      cValor := xVar
   end

   if lCompleto
      //Result += "Tamanho: "+  Str(nLen,,,.T.)  +";"
      Result += "Tamanho: "+ AllTrim(Str(nLen)) +";"
      Result += "Tipo: "   + cTipo              +";"
      Result += "Valor: "  + cValor             +";"

      MsgInfo(Result,cTitulo)

      Return cValor
   end

Return cValor

/*------------------------------------------------------------------------*/

 
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 56 guests

cron