Author Topic: help my  (Read 35320 times)

0 Members and 1 Guest are viewing this topic.

Offline Kiara87

  • Forum Regular
  • Posts: 164
    • View Profile
Re: help my
« Reply #120 on: July 17, 2020, 05:38:28 pm »
Looking for 67 and 4 in a line on the right side for this pair of 30's on left side?
  [ You are not allowed to view this attachment ]  

Correct?

EXACT 

JUST SO
se avessi solo un'ora per salvare il mondo, passerei 55 minuti per definire bene il problema e 5 a trovare la soluzione

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: help my
« Reply #121 on: July 18, 2020, 12:54:50 am »
Here it is (I think).
Code: QB64: [Select]
  1. OPTION _EXPLICIT 'for typo's   yep lineMun blah!  b+ mod of kiara mod of b+ 2020-07-15
  2. _TITLE "Lotto Data"
  3. '2020-07-17 remove weekday names, move labels into there, fix bottom line up/down click
  4. '           fix function convertLottoNum2Date$ spelling
  5. '           clean out some redundant code loops
  6. ' 2020-07-18 change GOSUB loadLineDAT_Mark30s:
  7. '           to mark Blue only line with triple pairs. Can only do one pair at time for right screen check.
  8. '           Make function missingTriple, so we know what number to search for on right screen.
  9. '           OK modified loadLineDAT_Mark30s: GOSUB some more to catch the missing triple pair
  10. '           marked in Red on right screen.
  11.  
  12. DEFINT A-Z ' everything is integer unless DIM or suffix
  13. CONST nRows = 11 '                          rows of 5 data points in each line of fileDat
  14.  
  15. DIM count '                                 for number of lines in the data file
  16.  
  17. DIM lineNum, lineNum2 '                     for tracking array access this is actual file line of data we are screening
  18. DIM a AS STRING, a2 AS STRING '             extraction lines of data
  19. DIM lottoNum, lottoNum2 '                   for extractions
  20. DIM lottoDate$, lottoDate2$ '               for the dates of lottos
  21.  
  22. ' user inputs
  23. DIM Q$ '                                    for INKEY$
  24. DIM mb, mx, my, oldmouse '                  Mouse stuff oldmouse is trick Steve McNeill showed us to get ONE mouse click!
  25.  
  26. ' these would normally go in SUBs or FUNCTIONs but we are using GOSUBs here
  27. DIM shiftRight, shiftRight2 '               screening data left and right, normally these would be CONSTANTs
  28. shiftRight = 11 '                           according to screen fit
  29. shiftRight2 = 65 '                          according to screen fit
  30.  
  31. DIM row, col, aPlace '                      for screening Data from a string
  32. DIM rowCnt, y, rowPlus '                    for loading lineDAT() from a file string
  33. DIM lineDAT(1 TO 5, 1 TO nRows) AS INTEGER 'an  array to load from each line from DAT
  34. DIM third1, third2 '                        the missing part of triplet
  35. DIM hit1st, hit2nd '                        find 3rd triple pair on right screen
  36.  
  37. DIM i '                                     common use for indexing
  38.  
  39. DIM SHARED msNomeMesi(1 TO 12) AS STRING ' matrice di stringhe
  40. msNomeMesi(1) = "Gennaio"
  41. msNomeMesi(2) = "Febbraio"
  42. msNomeMesi(3) = "Marzo"
  43. msNomeMesi(4) = "Aprile"
  44. msNomeMesi(5) = "Maggio"
  45. msNomeMesi(6) = "Giugno"
  46. msNomeMesi(7) = "Luglio"
  47. msNomeMesi(8) = "Agosto"
  48. msNomeMesi(9) = "Settembre"
  49. msNomeMesi(10) = "Ottobre"
  50. msNomeMesi(11) = "Novembre"
  51. msNomeMesi(12) = "Dicembre"
  52.  
  53. DIM labels(1 TO 11) AS STRING ' setup screen labels for reporting data
  54. labels(1) = "BARI"
  55. labels(2) = "CAGLIARI"
  56. labels(3) = "FIRENZE"
  57. labels(4) = "GENOVA"
  58. labels(5) = "MILANO"
  59. labels(6) = "NAPOLI"
  60. labels(7) = "PALERMO"
  61. labels(8) = "ROMA"
  62. labels(9) = "TORINO"
  63. labels(10) = "VENEZIA"
  64. labels(11) = "NAZIONALE"
  65.  
  66. '-------------------------------- start Main setup get file data loaded into array
  67.  
  68. 'count lines in file
  69. OPEN "lotto.dat" FOR INPUT AS #1
  70.     INPUT #1, a
  71.     '          debug check inputs from file
  72.     'PRINT a
  73.     'INPUT " OK enter "; w$
  74.     IF LEN(_TRIM$(a)) THEN count = count + 1 'don't want empty lines _TRIM$ removes spaces or other nonsense
  75.  
  76. 'now we now size of file so ready an array to load file Data
  77. DIM fileDAT(1 TO count) AS STRING
  78. OPEN "lotto.dat" FOR INPUT AS #1
  79. FOR i = 1 TO count
  80.     INPUT #1, a
  81.     IF LEN(_TRIM$(a)) THEN fileDAT(i) = a 'don't want empty lines _TRIM$ removes spaces or other nonsense
  82.  
  83. 'get/set first line and get a data string from the FileDAT array  (left set on screen)
  84. lineNum = 1
  85. a = fileDAT(lineNum)
  86. lottoNum = VAL(LEFT$(a, 4))
  87. lottoDate$ = ConvertLottoNumToDate$(lottoNum)
  88.  
  89. 'get/set right side start variables
  90. lineNum2 = 1
  91. a2 = fileDAT(lineNum2)
  92. lottoNum2 = VAL(LEFT$(a2, 4))
  93. lottoDate2$ = ConvertLottoNumToDate$(lottoNum2)
  94.  
  95. DO '------------------------------------------------ Main Loop User selects data to compare
  96.     CLS
  97.     Q$ = INKEY$
  98.     IF Q$ = "+" THEN lineNum = lineNum + 1
  99.     IF Q$ = "-" THEN lineNum = lineNum - 1
  100.     IF Q$ = CHR$(0) + CHR$(72) THEN lineNum2 = lineNum2 + 1
  101.     IF Q$ = CHR$(0) + CHR$(80) THEN lineNum2 = lineNum2 - 1
  102.  
  103.     mb = _MOUSEBUTTON(1): mx = _MOUSEX: my = _MOUSEY
  104.     'LOCATE 3, 1: PRINT mx, my
  105.     IF mb AND oldmouse = 0 AND my > 24 THEN ' <<<<<<<<<<<<<<<<<<<<<<<   THANK's  SMcNeill
  106.         '_DELAY .25 '        just one click please!
  107.         IF 3 <= mx AND mx <= 11 THEN lineNum = lineNum + 1
  108.         IF 14 <= mx AND mx <= 23 THEN lineNum = lineNum - 1
  109.         IF 56 <= mx AND mx <= 64 THEN lineNum2 = lineNum2 + 1
  110.         IF 67 <= mx AND mx <= 76 THEN lineNum2 = lineNum2 - 1
  111.     END IF
  112.     oldmouse = _MOUSEBUTTON(1) ' <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<   THANK's  SMcNeill
  113.     IF lineNum > count THEN lineNum = 1
  114.     IF lineNum < 1 THEN lineNum = count
  115.     IF lineNum2 > count THEN lineNum2 = 1
  116.     IF lineNum2 < 1 THEN lineNum2 = count
  117.  
  118.     'get new data line
  119.     a = fileDAT(lineNum) 'left side data
  120.     lottoNum = VAL(LEFT$(a, 4))
  121.     lottoDate$ = ConvertLottoNumToDate$(lottoNum)
  122.  
  123.     a2 = fileDAT(lineNum2) 'right side data
  124.     lottoNum2 = VAL(LEFT$(a2, 4))
  125.     lottoDate2$ = ConvertLottoNumToDate$(lottoNum2)
  126.  
  127.     'print out the data from the new line
  128.     GOSUB labelScreen
  129.     GOSUB screenDataLine
  130.     GOSUB loadLineDAT_Mark30s
  131.     _DISPLAY
  132.     _LIMIT 30
  133.  
  134. loadLineDAT_Mark30s: 'this  loads the lineDAT array, so we can sweep through the columes and mark 30's
  135. rowCnt = 1: y = 1
  136. FOR i = 5 TO LEN(a) STEP 2 ' is marking off the start of each data 2 digit integer
  137.     lineDAT(rowCnt, y) = VAL(MID$(a, i, 2)) 'convert data item to integer
  138.     rowCnt = rowCnt + 1 ' increase column if at 6 start new row
  139.     IF rowCnt = 6 THEN y = y + 1: rowCnt = 1
  140. COLOR 9 'blue marker  seacrh through columes for  30's
  141. FOR row = 1 TO 10 'for each of the rows of dat
  142.     FOR rowPlus = row + 1 TO 11 'compare the next rows for diff 30 with current col, row
  143.         REDIM hits(1 TO 5, 0 TO 1), nHits
  144.         nHits = 0: third1 = 0: third2 = 0
  145.         FOR col = 1 TO 5 'for each of the columes of data
  146.             IF diff30in90(lineDAT(col, row), lineDAT(col, rowPlus)) THEN 'need a pair of hits
  147.                 hits(col, 0) = lineDAT(col, row): hits(col, 1) = lineDAT(col, rowPlus): nHits = nHits + 1
  148.                 IF third1 <> 0 THEN
  149.                     third2 = missingTriple(hits(col, 0), hits(col, 1))
  150.                     EXIT FOR
  151.                 ELSE
  152.                     third1 = missingTriple(hits(col, 0), hits(col, 1))
  153.                 END IF
  154.             END IF
  155.         NEXT
  156.         IF nHits >= 2 THEN 'mark them
  157.             LOCATE 10, 30: PRINT labels(row) + " & " + labels(rowPlus)
  158.             LOCATE 12, 36: PRINT third1; third2
  159.             FOR col = 1 TO 5
  160.                 IF hits(col, 0) THEN
  161.                     LOCATE row * 2 + 1, col * 3 - 2 + shiftRight: PRINT DD$(lineDAT(col, row));
  162.                     LOCATE rowPlus * 2 + 1, col * 3 - 2 + shiftRight: PRINT DD$(lineDAT(col, rowPlus));
  163.                 END IF
  164.             NEXT
  165.  
  166.             'OK now search the right screen for a line containing the 3rd triple pair
  167.             COLOR 12 '           mark them red
  168.             rowCnt = 1: y = 1
  169.             FOR i = 5 TO LEN(a2) STEP 2 ' is marking off the start of each data 2 digit integer
  170.                 lineDAT(rowCnt, y) = VAL(MID$(a2, i, 2)) 'convert data item to integer
  171.                 rowCnt = rowCnt + 1 ' increase column if at 6 start new row
  172.                 IF rowCnt = 6 THEN y = y + 1: rowCnt = 1
  173.             NEXT
  174.             FOR row = 1 TO 11 'for each of the rows of dat
  175.                 hit1st = 0: hit2nd = 0
  176.                 FOR col = 1 TO 5 'for each of the columes of data
  177.                     IF lineDAT(col, row) = third1 THEN hit1st = col
  178.                     IF lineDAT(col, row) = third2 THEN hit2nd = col
  179.                     IF hit1st AND hit2nd THEN
  180.                         LOCATE row * 2 + 1, 55: PRINT labels(row)
  181.                         LOCATE row * 2 + 1, hit1st * 3 - 2 + shiftRight2: PRINT DD$(lineDAT(hit1st, row));
  182.                         LOCATE row * 2 + 1, hit2nd * 3 - 2 + shiftRight2: PRINT DD$(lineDAT(hit2nd, row));
  183.                         EXIT FOR
  184.                     END IF
  185.                 NEXT
  186.             NEXT
  187.             RETURN ' sorry we can do only one triple pair
  188.         END IF
  189.     NEXT
  190.  
  191.  
  192. screenDataLine:
  193. LOCATE 1, 1
  194. PRINT lottoNum; lottoDate$;
  195. LOCATE 1, 48
  196. PRINT lottoNum2; lottoDate2$;
  197. aPlace = 5
  198. FOR row = 1 TO 11
  199.     FOR col = 1 TO 5
  200.         LOCATE row * 2 + 1, col * 3 - 2 + shiftRight: PRINT MID$(a, aPlace, 2); ' Left side
  201.         LOCATE row * 2 + 1, col * 3 - 2 + shiftRight2: PRINT MID$(a2, aPlace, 2); '<< a2 now Right Side
  202.         aPlace = aPlace + 2
  203.     NEXT
  204.  
  205. labelScreen:
  206. FOR i = 1 TO 11
  207.     LOCATE i * 2 + 1, 1: PRINT labels(i)
  208.     LOCATE i * 2 + 1, 55: PRINT labels(i)
  209. LOCATE 25, 1
  210. PRINT "  Fino / Up  Giu / Down        : Fare clic su :        Fino / Up  Giu / Down";
  211. '      12345678901234567890123456789012345678901234567890123456789012345678901234567890
  212. '               1         2         3         4         5         6         7         8
  213.  
  214. FUNCTION DD$ (number) 'convert a number into a 2 digit string$
  215.     DD$ = RIGHT$("00" + _TRIM$(STR$(number)), 2)
  216.  
  217. FUNCTION diff30in90 (a, b) 'default integers a-z
  218.     DIM hi, lo
  219.     IF a > 90 OR b > 90 OR a < 1 OR b < 1 OR a = b THEN EXIT FUNCTION 'no diff return 0
  220.     IF a > b THEN hi = a: lo = b ELSE hi = b: lo = a
  221.     IF hi - lo = 30 THEN
  222.         diff30in90 = -1
  223.     ELSE
  224.         IF ABS(hi - lo) = 60 THEN diff30in90 = -1
  225.     END IF
  226.  
  227. FUNCTION missingTriple (t1, t2)
  228.     DIM first, second, third
  229.     IF t1 < 31 THEN
  230.         first = t1
  231.     ELSEIF t1 < 61 THEN
  232.         second = t1
  233.     ELSE
  234.         third = t1
  235.     END IF
  236.     IF t2 < 31 THEN
  237.         first = t2
  238.     ELSEIF t2 < 61 THEN
  239.         second = t2
  240.     ELSE
  241.         third = t2
  242.     END IF
  243.     IF first = 0 THEN
  244.         missingTriple = second - 30
  245.     ELSEIF second = 0 THEN
  246.         missingTriple = third - 30
  247.     ELSE
  248.         missingTriple = second + 30
  249.     END IF
  250.  
  251. ' -----------------------------------------------------  Convert Lotto Num to Date Function and helpers
  252. FUNCTION ConvertLottoNumToDate$ (lottoNumX)
  253.     DIM numberOfDays1463, yr, mo
  254.     numberOfDays1463 = INT(lottoNumX - 1463) / 3 * 7
  255.     yr = 2017
  256.     mo = 6
  257.     WHILE numberOfDays1463 > daysInMonth%(mo, yr) - 1
  258.         numberOfDays1463 = numberOfDays1463 - daysInMonth%(mo, yr)
  259.         mo = mo + 1
  260.         IF mo = 13 THEN mo = 1: yr = yr + 1
  261.     WEND
  262.     ' date shound be day name date/month/year for Italians
  263.     ConvertLottoNumToDate$ = lottoday$(lottoNumX) + _TRIM$(STR$(numberOfDays1463 + 1)) + "/" + msNomeMesi(mo) + "/" + _TRIM$(STR$(yr))
  264.  
  265. FUNCTION lottoday$ (lottoNum)
  266.     IF lottoNum MOD 3 = 1 THEN lottoday$ = "Martedi, "
  267.     IF lottoNum MOD 3 = 2 THEN lottoday$ = "Giovedi, "
  268.     IF lottoNum MOD 3 = 0 THEN lottoday$ = "Sabato, "
  269.  
  270. FUNCTION daysInMonth% (mNum, yearNum)
  271.     DIM copyM, copyY
  272.     copyM = mNum
  273.     IF mNum = 13 THEN copyM = 1: copyY = yearNum + 1 ELSE copyY = yearNum
  274.     SELECT CASE copyM
  275.         CASE 1, 3, 5, 7, 8, 10, 12: daysInMonth% = 31
  276.         CASE 4, 6, 9, 11: daysInMonth% = 30
  277.         CASE 2: daysInMonth% = daysInFeb%(copyY)
  278.     END SELECT
  279.  
  280. FUNCTION daysInFeb% (yr) 'from Pete's calendar this is a very clear calc
  281.     DIM days AS INTEGER
  282.     IF yr MOD 4 = 0 THEN
  283.         IF yr MOD 100 = 0 THEN
  284.             IF yr MOD 400 = 0 THEN days = 29
  285.         ELSE
  286.             days = 29
  287.         END IF
  288.     END IF
  289.     IF days THEN daysInFeb% = days ELSE daysInFeb% = 28
  290.  
 
EDIT: Decided to mark the label Red too. So far 1465 has triples finished in 1590, 1676, 1701...

Oops, time to get to bed that was 1823 not 1873. 1928 is last one for 1465.
« Last Edit: July 18, 2020, 02:22:09 am by bplus »

Offline Kiara87

  • Forum Regular
  • Posts: 164
    • View Profile
Re: help my
« Reply #122 on: July 18, 2020, 03:17:41 am »
Here it is (I think).
Code: QB64: [Select]
  1. OPTION _EXPLICIT 'for typo's   yep lineMun blah!  b+ mod of kiara mod of b+ 2020-07-15
  2. _TITLE "Lotto Data"
  3. '2020-07-17 remove weekday names, move labels into there, fix bottom line up/down click
  4. '           fix function convertLottoNum2Date$ spelling
  5. '           clean out some redundant code loops
  6. ' 2020-07-18 change GOSUB loadLineDAT_Mark30s:
  7. '           to mark Blue only line with triple pairs. Can only do one pair at time for right screen check.
  8. '           Make function missingTriple, so we know what number to search for on right screen.
  9. '           OK modified loadLineDAT_Mark30s: GOSUB some more to catch the missing triple pair
  10. '           marked in Red on right screen.
  11.  
  12. DEFINT A-Z ' everything is integer unless DIM or suffix
  13. CONST nRows = 11 '                          rows of 5 data points in each line of fileDat
  14.  
  15. DIM count '                                 for number of lines in the data file
  16.  
  17. DIM lineNum, lineNum2 '                     for tracking array access this is actual file line of data we are screening
  18. DIM a AS STRING, a2 AS STRING '             extraction lines of data
  19. DIM lottoNum, lottoNum2 '                   for extractions
  20. DIM lottoDate$, lottoDate2$ '               for the dates of lottos
  21.  
  22. ' user inputs
  23. DIM Q$ '                                    for INKEY$
  24. DIM mb, mx, my, oldmouse '                  Mouse stuff oldmouse is trick Steve McNeill showed us to get ONE mouse click!
  25.  
  26. ' these would normally go in SUBs or FUNCTIONs but we are using GOSUBs here
  27. DIM shiftRight, shiftRight2 '               screening data left and right, normally these would be CONSTANTs
  28. shiftRight = 11 '                           according to screen fit
  29. shiftRight2 = 65 '                          according to screen fit
  30.  
  31. DIM row, col, aPlace '                      for screening Data from a string
  32. DIM rowCnt, y, rowPlus '                    for loading lineDAT() from a file string
  33. DIM lineDAT(1 TO 5, 1 TO nRows) AS INTEGER 'an  array to load from each line from DAT
  34. DIM third1, third2 '                        the missing part of triplet
  35. DIM hit1st, hit2nd '                        find 3rd triple pair on right screen
  36.  
  37. DIM i '                                     common use for indexing
  38.  
  39. DIM SHARED msNomeMesi(1 TO 12) AS STRING ' matrice di stringhe
  40. msNomeMesi(1) = "Gennaio"
  41. msNomeMesi(2) = "Febbraio"
  42. msNomeMesi(3) = "Marzo"
  43. msNomeMesi(4) = "Aprile"
  44. msNomeMesi(5) = "Maggio"
  45. msNomeMesi(6) = "Giugno"
  46. msNomeMesi(7) = "Luglio"
  47. msNomeMesi(8) = "Agosto"
  48. msNomeMesi(9) = "Settembre"
  49. msNomeMesi(10) = "Ottobre"
  50. msNomeMesi(11) = "Novembre"
  51. msNomeMesi(12) = "Dicembre"
  52.  
  53. DIM labels(1 TO 11) AS STRING ' setup screen labels for reporting data
  54. labels(1) = "BARI"
  55. labels(2) = "CAGLIARI"
  56. labels(3) = "FIRENZE"
  57. labels(4) = "GENOVA"
  58. labels(5) = "MILANO"
  59. labels(6) = "NAPOLI"
  60. labels(7) = "PALERMO"
  61. labels(8) = "ROMA"
  62. labels(9) = "TORINO"
  63. labels(10) = "VENEZIA"
  64. labels(11) = "NAZIONALE"
  65.  
  66. '-------------------------------- start Main setup get file data loaded into array
  67.  
  68. 'count lines in file
  69. OPEN "lotto.dat" FOR INPUT AS #1
  70.     INPUT #1, a
  71.     '          debug check inputs from file
  72.     'PRINT a
  73.     'INPUT " OK enter "; w$
  74.     IF LEN(_TRIM$(a)) THEN count = count + 1 'don't want empty lines _TRIM$ removes spaces or other nonsense
  75.  
  76. 'now we now size of file so ready an array to load file Data
  77. DIM fileDAT(1 TO count) AS STRING
  78. OPEN "lotto.dat" FOR INPUT AS #1
  79. FOR i = 1 TO count
  80.     INPUT #1, a
  81.     IF LEN(_TRIM$(a)) THEN fileDAT(i) = a 'don't want empty lines _TRIM$ removes spaces or other nonsense
  82.  
  83. 'get/set first line and get a data string from the FileDAT array  (left set on screen)
  84. lineNum = 1
  85. a = fileDAT(lineNum)
  86. lottoNum = VAL(LEFT$(a, 4))
  87. lottoDate$ = ConvertLottoNumToDate$(lottoNum)
  88.  
  89. 'get/set right side start variables
  90. lineNum2 = 1
  91. a2 = fileDAT(lineNum2)
  92. lottoNum2 = VAL(LEFT$(a2, 4))
  93. lottoDate2$ = ConvertLottoNumToDate$(lottoNum2)
  94.  
  95. DO '------------------------------------------------ Main Loop User selects data to compare
  96.     CLS
  97.     Q$ = INKEY$
  98.     IF Q$ = "+" THEN lineNum = lineNum + 1
  99.     IF Q$ = "-" THEN lineNum = lineNum - 1
  100.     IF Q$ = CHR$(0) + CHR$(72) THEN lineNum2 = lineNum2 + 1
  101.     IF Q$ = CHR$(0) + CHR$(80) THEN lineNum2 = lineNum2 - 1
  102.  
  103.     mb = _MOUSEBUTTON(1): mx = _MOUSEX: my = _MOUSEY
  104.     'LOCATE 3, 1: PRINT mx, my
  105.     IF mb AND oldmouse = 0 AND my > 24 THEN ' <<<<<<<<<<<<<<<<<<<<<<<   THANK's  SMcNeill
  106.         '_DELAY .25 '        just one click please!
  107.         IF 3 <= mx AND mx <= 11 THEN lineNum = lineNum + 1
  108.         IF 14 <= mx AND mx <= 23 THEN lineNum = lineNum - 1
  109.         IF 56 <= mx AND mx <= 64 THEN lineNum2 = lineNum2 + 1
  110.         IF 67 <= mx AND mx <= 76 THEN lineNum2 = lineNum2 - 1
  111.     END IF
  112.     oldmouse = _MOUSEBUTTON(1) ' <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<   THANK's  SMcNeill
  113.     IF lineNum > count THEN lineNum = 1
  114.     IF lineNum < 1 THEN lineNum = count
  115.     IF lineNum2 > count THEN lineNum2 = 1
  116.     IF lineNum2 < 1 THEN lineNum2 = count
  117.  
  118.     'get new data line
  119.     a = fileDAT(lineNum) 'left side data
  120.     lottoNum = VAL(LEFT$(a, 4))
  121.     lottoDate$ = ConvertLottoNumToDate$(lottoNum)
  122.  
  123.     a2 = fileDAT(lineNum2) 'right side data
  124.     lottoNum2 = VAL(LEFT$(a2, 4))
  125.     lottoDate2$ = ConvertLottoNumToDate$(lottoNum2)
  126.  
  127.     'print out the data from the new line
  128.     GOSUB labelScreen
  129.     GOSUB screenDataLine
  130.     GOSUB loadLineDAT_Mark30s
  131.     _DISPLAY
  132.     _LIMIT 30
  133.  
  134. loadLineDAT_Mark30s: 'this  loads the lineDAT array, so we can sweep through the columes and mark 30's
  135. rowCnt = 1: y = 1
  136. FOR i = 5 TO LEN(a) STEP 2 ' is marking off the start of each data 2 digit integer
  137.     lineDAT(rowCnt, y) = VAL(MID$(a, i, 2)) 'convert data item to integer
  138.     rowCnt = rowCnt + 1 ' increase column if at 6 start new row
  139.     IF rowCnt = 6 THEN y = y + 1: rowCnt = 1
  140. COLOR 9 'blue marker  seacrh through columes for  30's
  141. FOR row = 1 TO 10 'for each of the rows of dat
  142.     FOR rowPlus = row + 1 TO 11 'compare the next rows for diff 30 with current col, row
  143.         REDIM hits(1 TO 5, 0 TO 1), nHits
  144.         nHits = 0: third1 = 0: third2 = 0
  145.         FOR col = 1 TO 5 'for each of the columes of data
  146.             IF diff30in90(lineDAT(col, row), lineDAT(col, rowPlus)) THEN 'need a pair of hits
  147.                 hits(col, 0) = lineDAT(col, row): hits(col, 1) = lineDAT(col, rowPlus): nHits = nHits + 1
  148.                 IF third1 <> 0 THEN
  149.                     third2 = missingTriple(hits(col, 0), hits(col, 1))
  150.                     EXIT FOR
  151.                 ELSE
  152.                     third1 = missingTriple(hits(col, 0), hits(col, 1))
  153.                 END IF
  154.             END IF
  155.         NEXT
  156.         IF nHits >= 2 THEN 'mark them
  157.             LOCATE 10, 30: PRINT labels(row) + " & " + labels(rowPlus)
  158.             LOCATE 12, 36: PRINT third1; third2
  159.             FOR col = 1 TO 5
  160.                 IF hits(col, 0) THEN
  161.                     LOCATE row * 2 + 1, col * 3 - 2 + shiftRight: PRINT DD$(lineDAT(col, row));
  162.                     LOCATE rowPlus * 2 + 1, col * 3 - 2 + shiftRight: PRINT DD$(lineDAT(col, rowPlus));
  163.                 END IF
  164.             NEXT
  165.  
  166.             'OK now search the right screen for a line containing the 3rd triple pair
  167.             COLOR 12 '           mark them red
  168.             rowCnt = 1: y = 1
  169.             FOR i = 5 TO LEN(a2) STEP 2 ' is marking off the start of each data 2 digit integer
  170.                 lineDAT(rowCnt, y) = VAL(MID$(a2, i, 2)) 'convert data item to integer
  171.                 rowCnt = rowCnt + 1 ' increase column if at 6 start new row
  172.                 IF rowCnt = 6 THEN y = y + 1: rowCnt = 1
  173.             NEXT
  174.             FOR row = 1 TO 11 'for each of the rows of dat
  175.                 hit1st = 0: hit2nd = 0
  176.                 FOR col = 1 TO 5 'for each of the columes of data
  177.                     IF lineDAT(col, row) = third1 THEN hit1st = col
  178.                     IF lineDAT(col, row) = third2 THEN hit2nd = col
  179.                     IF hit1st AND hit2nd THEN
  180.                         LOCATE row * 2 + 1, 55: PRINT labels(row)
  181.                         LOCATE row * 2 + 1, hit1st * 3 - 2 + shiftRight2: PRINT DD$(lineDAT(hit1st, row));
  182.                         LOCATE row * 2 + 1, hit2nd * 3 - 2 + shiftRight2: PRINT DD$(lineDAT(hit2nd, row));
  183.                         EXIT FOR
  184.                     END IF
  185.                 NEXT
  186.             NEXT
  187.             RETURN ' sorry we can do only one triple pair
  188.         END IF
  189.     NEXT
  190.  
  191.  
  192. screenDataLine:
  193. LOCATE 1, 1
  194. PRINT lottoNum; lottoDate$;
  195. LOCATE 1, 48
  196. PRINT lottoNum2; lottoDate2$;
  197. aPlace = 5
  198. FOR row = 1 TO 11
  199.     FOR col = 1 TO 5
  200.         LOCATE row * 2 + 1, col * 3 - 2 + shiftRight: PRINT MID$(a, aPlace, 2); ' Left side
  201.         LOCATE row * 2 + 1, col * 3 - 2 + shiftRight2: PRINT MID$(a2, aPlace, 2); '<< a2 now Right Side
  202.         aPlace = aPlace + 2
  203.     NEXT
  204.  
  205. labelScreen:
  206. FOR i = 1 TO 11
  207.     LOCATE i * 2 + 1, 1: PRINT labels(i)
  208.     LOCATE i * 2 + 1, 55: PRINT labels(i)
  209. LOCATE 25, 1
  210. PRINT "  Fino / Up  Giu / Down        : Fare clic su :        Fino / Up  Giu / Down";
  211. '      12345678901234567890123456789012345678901234567890123456789012345678901234567890
  212. '               1         2         3         4         5         6         7         8
  213.  
  214. FUNCTION DD$ (number) 'convert a number into a 2 digit string$
  215.     DD$ = RIGHT$("00" + _TRIM$(STR$(number)), 2)
  216.  
  217. FUNCTION diff30in90 (a, b) 'default integers a-z
  218.     DIM hi, lo
  219.     IF a > 90 OR b > 90 OR a < 1 OR b < 1 OR a = b THEN EXIT FUNCTION 'no diff return 0
  220.     IF a > b THEN hi = a: lo = b ELSE hi = b: lo = a
  221.     IF hi - lo = 30 THEN
  222.         diff30in90 = -1
  223.     ELSE
  224.         IF ABS(hi - lo) = 60 THEN diff30in90 = -1
  225.     END IF
  226.  
  227. FUNCTION missingTriple (t1, t2)
  228.     DIM first, second, third
  229.     IF t1 < 31 THEN
  230.         first = t1
  231.     ELSEIF t1 < 61 THEN
  232.         second = t1
  233.     ELSE
  234.         third = t1
  235.     END IF
  236.     IF t2 < 31 THEN
  237.         first = t2
  238.     ELSEIF t2 < 61 THEN
  239.         second = t2
  240.     ELSE
  241.         third = t2
  242.     END IF
  243.     IF first = 0 THEN
  244.         missingTriple = second - 30
  245.     ELSEIF second = 0 THEN
  246.         missingTriple = third - 30
  247.     ELSE
  248.         missingTriple = second + 30
  249.     END IF
  250.  
  251. ' -----------------------------------------------------  Convert Lotto Num to Date Function and helpers
  252. FUNCTION ConvertLottoNumToDate$ (lottoNumX)
  253.     DIM numberOfDays1463, yr, mo
  254.     numberOfDays1463 = INT(lottoNumX - 1463) / 3 * 7
  255.     yr = 2017
  256.     mo = 6
  257.     WHILE numberOfDays1463 > daysInMonth%(mo, yr) - 1
  258.         numberOfDays1463 = numberOfDays1463 - daysInMonth%(mo, yr)
  259.         mo = mo + 1
  260.         IF mo = 13 THEN mo = 1: yr = yr + 1
  261.     WEND
  262.     ' date shound be day name date/month/year for Italians
  263.     ConvertLottoNumToDate$ = lottoday$(lottoNumX) + _TRIM$(STR$(numberOfDays1463 + 1)) + "/" + msNomeMesi(mo) + "/" + _TRIM$(STR$(yr))
  264.  
  265. FUNCTION lottoday$ (lottoNum)
  266.     IF lottoNum MOD 3 = 1 THEN lottoday$ = "Martedi, "
  267.     IF lottoNum MOD 3 = 2 THEN lottoday$ = "Giovedi, "
  268.     IF lottoNum MOD 3 = 0 THEN lottoday$ = "Sabato, "
  269.  
  270. FUNCTION daysInMonth% (mNum, yearNum)
  271.     DIM copyM, copyY
  272.     copyM = mNum
  273.     IF mNum = 13 THEN copyM = 1: copyY = yearNum + 1 ELSE copyY = yearNum
  274.     SELECT CASE copyM
  275.         CASE 1, 3, 5, 7, 8, 10, 12: daysInMonth% = 31
  276.         CASE 4, 6, 9, 11: daysInMonth% = 30
  277.         CASE 2: daysInMonth% = daysInFeb%(copyY)
  278.     END SELECT
  279.  
  280. FUNCTION daysInFeb% (yr) 'from Pete's calendar this is a very clear calc
  281.     DIM days AS INTEGER
  282.     IF yr MOD 4 = 0 THEN
  283.         IF yr MOD 100 = 0 THEN
  284.             IF yr MOD 400 = 0 THEN days = 29
  285.         ELSE
  286.             days = 29
  287.         END IF
  288.     END IF
  289.     IF days THEN daysInFeb% = days ELSE daysInFeb% = 28
  290.  
 
EDIT: Decided to mark the label Red too. So far 1465 has triples finished in 1590, 1676, 1701...

Oops, time to get to bed that was 1823 not 1873. 1928 is last one for 1465.

1) it works however it does not capture single numbers
as in the photo there is a single number on another wheel but it has not been colored
as in the image --> https://imgur.com/2v3N3u7

2) find only one condition
should find more than one

all the numbers forming a square distance 30
even if they are vertical vertical it is enough that they form a square
as in the image
image1  ---->  https://imgur.com/eOtnorM
image 2 ---->  https://imgur.com/Zb1jJUH

in image two we see that the single numbers have not been colored 36 in NAPOLI  AND TORINO 23

AND SHOULD REPORT 3 CONDITIONS TO PLAY
« Last Edit: July 18, 2020, 03:18:56 am by Kiara87 »
se avessi solo un'ora per salvare il mondo, passerei 55 minuti per definire bene il problema e 5 a trovare la soluzione

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: help my
« Reply #123 on: July 18, 2020, 01:33:47 pm »
Well good luck with all those numbers!

Offline Kiara87

  • Forum Regular
  • Posts: 164
    • View Profile
Re: help my
« Reply #124 on: July 18, 2020, 01:50:40 pm »
Well good luck with all those numbers!

what do i have to change to do that?

an advice?
se avessi solo un'ora per salvare il mondo, passerei 55 minuti per definire bene il problema e 5 a trovare la soluzione

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: help my
« Reply #125 on: July 18, 2020, 03:10:41 pm »
It's very confusing locating all the different triple completions you describe, I recommend color coding each triple completion. For multiple pairs, displayed in middle, you will have to track location rows for printing labels and the different missing triple with it's own associated color when there is more than one pair.

I think I did the hardest one finding a pair of triple completions in on a row! It might have been way easier had I known any triple completion gets marked. Oh well fun challenge don't see the sense of all this and seems like work/nonsensical to get everything on screen at once.

I think you lost me when saying the columns don't even have to match up. Pretty much changes the algorithm needed to search for triples.
« Last Edit: July 18, 2020, 03:17:53 pm by bplus »

Offline Kiara87

  • Forum Regular
  • Posts: 164
    • View Profile
Re: help my
« Reply #126 on: July 18, 2020, 03:31:28 pm »
It's very confusing locating all the different triple completions you describe, I recommend color coding each triple completion. For multiple pairs, displayed in middle, you will have to track location rows for printing labels and the different missing triple with it's own associated color when there is more than one pair.

I think I did the hardest one finding a pair of triple completions in on a row! It might have been way easier had I known any triple completion gets marked. Oh well fun challenge don't see the sense of all this and seems like work/nonsensical to get everything on screen at once.

I think you lost me when saying the columns don't even have to match up. Pretty much changes the algorithm needed to search for triples.

OK thank you very much you have been really good
now it's up to me to change things in the program
I just need to learn well to program
and complete the job to my needs

thanks for everything friend
se avessi solo un'ora per salvare il mondo, passerei 55 minuti per definire bene il problema e 5 a trovare la soluzione

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: help my
« Reply #127 on: July 18, 2020, 03:44:54 pm »
Thanks, I look forward to seeing you get what you want from the lotto data. :)



Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: help my
« Reply #128 on: July 18, 2020, 08:14:25 pm »

Hi guys
how do you find this undefinied project about lotto?
I haven't follow more the thread and so now after a speed read
1. I have not understood how you have pulled out the date from the number of extraction ....
 2. it seems that the goal of program lotto has been changed because from images posted by Kiara87 it seems that now it is not more important to find the number with distance of 30 but some triples....

Please Kiara87 show us the whole plan of program... it is too hard spending time to accomplish a task that is partial and unuseful...be clear and complete!

Italian Google version....
Ciao ragazzi
come trovi questo progetto indefinito sul lotto?
Non ho seguito più il thread e quindi ora dopo una lettura veloce
1. Non ho capito come hai estratto la data dal numero di estrazione ....
  2. sembra che l'obiettivo del programma lotto sia stato modificato perché dalle immagini pubblicate da Kiara87 sembra che ora non sia più importante trovare il numero con una distanza di 30 ma alcune triple ...

Per favore, Kiara87 ci mostra l'intero piano del programma ... è troppo difficile passare del tempo per compiere un compito che è parziale e inutile ... sii chiaro e completo!
Programming isn't difficult, only it's  consuming time and coffee

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: help my
« Reply #129 on: July 18, 2020, 08:18:54 pm »
Here my MOD of Kiara87 MOD of my example program about finding numbers with 30 between them....

(It is a demonstration about how with flexibility it is possible to get different similar effects using variables as flag and loop FOR)

Code: QB64: [Select]
  1. ' Programma lotto di kiara87
  2. ' il programma legge i dati (numeri estratti da un file.dat)
  3. ' e permette di vedere  le estrazioni a video
  4. ' i numeri con distanza 30 sono evidenziati con colore rosso
  5. ' questi numeri vengono memorizzati e stampati
  6.  
  7. ' Nota 1: sono d'accordo con Bplus e' molto piu'
  8. ' rapido lavorare con dati in RAM che con dati su Disco HDD/SSD/USB/CD/DVD
  9.  
  10. ' valori COSTANTI  generali Vero e Falso
  11. CONST True = -1, False = NOT True
  12. ' le 11 ruote del lotto
  13. CONST Bari = 1, Cagliari = 2, Firenze = 3, Genova = 4, Milano = 5
  14. CONST Napoli = 6, Palermo = 7, Roma = 8, Torino = 9, Venezia = 10, Nazionale = 11
  15. CONST Cifra = 2 ' ogni numero estratto e' una cifra di due caratteri (01-90)
  16.  
  17. DIM a AS STRING ' una stringa per leggere i dati dal file
  18.  
  19. ' salta al sottoprogramma LeggiFile delimitato
  20. ' dalla Label LeggiFIle e dal RETURN
  21. GOSUB LeggiFile
  22.  
  23. ' verifica che tutto il file sia letto
  24. 'FOR b = 1 TO LEN(a) - 116 STEP 116
  25. '    PRINT MID$(a, b, 116)
  26. '    '    PRINT INSTR(b, a, CHR$(13))
  27. '    _DELAY .1
  28. 'NEXT b
  29.  
  30.  
  31.  
  32. ' il ciclo DO...LOOP UNTIL condizione e' un modo piu' moderno
  33. ' rispetto a Etichetta: .... IF condizione GOTO Etichetta
  34. b = 1 ' flag che conta la posizione di lettura nel file  per il riquadro sinistro
  35. f = 1 ' flag che conta la posizione di lettura nel file  per il riquadro destro
  36. z$ = " " ' flag per l'output a schermo del programma
  37. OPEN "distanza30.dat" FOR APPEND AS #2 ' apertura del file dei risultati
  38.     IF z$ <> "" THEN ' se non c'e' input non viene eseguito
  39.         CLS ' questo risolve un glitch di output sullo schermo
  40.         ' in alternativa alla riga sopra CLS nel sottoblocco
  41.         ' MostraEstratti va stampata la stringa estratto e
  42.         ' non il suo valore corrispondente ottenuto con VAL
  43.         GOSUB MostraRuote ' scrive il nome delle ruote del lotto
  44.         GOSUB MostraEstratti ' scrive le estrazioni ed evidenzia quelli distanti 30
  45.     END IF
  46.     ' prende l'input dell'utente
  47.     z$ = UCASE$(INKEY$) ' Z$ mantiene il maiuscolo di Inkey$
  48.     IF z$ = CHR$(0) + CHR$(72) AND b < (LEN(a) - 116) THEN b = b + 116
  49.     IF z$ = CHR$(0) + CHR$(80) AND b > 116 THEN b = b - 116
  50.     IF z$ = "+" AND f < (LEN(a) - 116) THEN f = f + 116
  51.     IF z$ = "-" AND f > 116 THEN f = f - 116
  52.  
  53. LOOP UNTIL z$ = "Q" ' esegue questo ciclo fino a che si preme q per quit
  54. CLOSE #2 ' chiude il file che memorizza i distanti 30 per ogni estrazione esaminata a video
  55.  
  56. END ' indica la fine logica del programma
  57.  
  58.  
  59. '-----------------------AREA sottoprogrammi /SUBroutines
  60.  
  61. ' questa etichetta /label indica il punto di inizio
  62. ' del sottoprogramma (SUBroutine) LeggiFile scritto con vecchio stile GOSUB
  63. ' che usa una etichetta/label e un RETURN per riprendere da dove si era interotto
  64. ' nota1: un metodo ancora piu' antico e' il salto con GOTO
  65. '        che richiede una seconda etichetta per ritornare nel MAIN o programma principale
  66. ' nota2: un metodo migliore e' SUB nomeroutine....END SUB
  67. '        perche' permette la localizzazione delle variabili
  68. LeggiFile:
  69. 'se non trova lotto.dat segnala l'errore a video e termina il programma
  70. IF NOT _FILEEXISTS("lotto.dat") THEN PRINT "File non trovato": END
  71. '<--------------------
  72. ' questo metodo e' piu' lento
  73. ' apre il file lotto.dat per leggere in maniera sequenziale i dati
  74. 'OPEN "lotto.dat" FOR INPUT AS #1
  75. 'LINE INPUT #1, a  ' riempe la variabile a con una riga intera di valori
  76. '<--------------------
  77.  
  78. ' apre lotto.dat per leggerlo in maniera binaria
  79. OPEN "lotto.dat" FOR BINARY AS #1
  80. a = SPACE$(LOF(1)) ' riempe la variabile a di spazi fino alla grandezza in byte del file aperto
  81. GET #1, , a ' legge con una unica operazione il file e lo pone nella variabiel a
  82. CLOSE #1 ' chiude il file appena letto
  83. ' indica il termine della SUBroutine LeggiFile
  84. ' e RITORNA alla riga di codice successiva al salto GOSUB
  85.  
  86. 'seconda SUBroutine /sottoprogramma
  87. MostraRuote:
  88. FOR xx = 1 TO 2 STEP 1 'mentre xx va da 1 a 2 con passo +1
  89.     'ripeti quello che c'e' tra FOR e NEXT
  90.     IF xx = 1 THEN yy = 0 ELSE IF xx = 2 THEN yy = 48
  91.  
  92.     COLOR 15
  93.     LOCATE 1, xx + yy
  94.     PRINT "BARI"
  95.     LOCATE 3, xx + yy
  96.     PRINT "CAGLIARI"
  97.     LOCATE 5, xx + yy
  98.     PRINT "FIRENZE"
  99.     LOCATE 7, xx + yy
  100.     PRINT "GENOVA"
  101.     LOCATE 9, xx + yy
  102.     PRINT "MILANO"
  103.     LOCATE 11, xx + yy
  104.     PRINT "NAPOLI"
  105.     LOCATE 13, xx + yy
  106.     PRINT "PALERMO"
  107.     LOCATE 15, xx + yy
  108.     PRINT "ROMA"
  109.     LOCATE 17, xx + yy
  110.     PRINT "TORINO"
  111.     LOCATE 19, xx + yy
  112.     PRINT "VENEZIA"
  113.     LOCATE 21, xx + yy
  114.     PRINT "NAZIONALE"
  115.  
  116.     '------------------------------------
  117.     IF xx = 1 THEN
  118.         LOCATE 23, xx + 59
  119.         PRINT "+ avanti  - indietro"
  120.     ELSEIF xx = 2 THEN
  121.         LOCATE 23, xx - 1
  122.         PRINT CHR$(24); " avanti   "; CHR$(25); " indietro"
  123.     END IF
  124. NEXT xx ' altro ciclo FOR con nuovo valore di xx
  125.  
  126. ' indica il termine della SUBroutine MostraRuote
  127. ' e RITORNA alla riga di codice successiva al salto GOSUB
  128.  
  129. 'terzo sottoprogramma o SUBroutine
  130. MostraEstratti:
  131.  
  132. ' le prime 4 cifre sembrano essere in numero della estrazione
  133. DIM aaa AS INTEGER, bbb AS INTEGER, ccc AS INTEGER, ddd AS INTEGER
  134.  
  135. FOR aaa = 1 TO 2 STEP 1 ' mentre aaa va da 1 a 2 con passo +1
  136.     ' ripeti quello che sta tra FOR e NEXT
  137.     IF aaa = 1 THEN
  138.         y = 11 ' prima posizione per il carattere da stampare
  139.         bbb = b
  140.         ccc = 1
  141.         ddd = 10
  142.     ELSEIF aaa = 2 THEN
  143.         y = 58
  144.         bbb = f
  145.         ccc = 21
  146.         ddd = 4
  147.     END IF
  148.  
  149.     COLOR ddd, 0
  150.     LOCATE ccc, 32
  151.     PRINT "estraz.num "; MID$(a, bbb, 4)
  152.     COLOR 15, 0
  153.     PRINT #2, "estraz.num "; MID$(a, bbb, 4)
  154.  
  155.     FOR x = 1 TO 5 STEP 1 ' questo ciclo   FOR e' di 5 perche' ogni ruota ha 5 estrazioni
  156.         A1 = "" ' resetto a1 per il prossimo giro
  157.         FOR V = Bari TO Nazionale ' per tutte le ruote
  158.             COLOR 15, 0
  159.             'posiziona il cursore
  160.             LOCATE (V * 2) - 1, y
  161.             ' scrive il numero estratto
  162.             PRINT VAL(MID$(a, (V - 1) * 10 + 5 + ((x - 1) * 2) + (bbb - 1), Cifra)); "";
  163.             A1 = A1 + (MID$(a, (V - 1) * 10 + 5 + ((x - 1) * 2) + (bbb - 1), Cifra))
  164.         NEXT V
  165.         GOSUB Mostra30
  166.         y = POS(0)
  167.     NEXT x
  168. NEXT aaa
  169.  
  170. ' indica il termine della SUBroutine MostraEstratti
  171. ' e RITORNA alla riga di codice successiva al salto GOSUB
  172.  
  173.  
  174.  
  175.  
  176. Mostra30:
  177. FOR v1 = Bari TO Venezia ' per tutte le ruote
  178.     FOR v2 = v1 + 1 TO Nazionale
  179.         IF ABS(VAL(MID$(a, (v1 - 1) * 10 + 5 + ((x - 1) * 2) + (bbb - 1), Cifra)) - VAL(MID$(a, (v2 - 1) * 10 + 5 + ((x - 1) * 2) + (bbb - 1), Cifra))) = 30 THEN
  180.             COLOR ddd, 0
  181.             'posiziona                                                                      il cursore
  182.             LOCATE (v1 * 2) - 1, y
  183.             ' scrive il numero estratto
  184.             PRINT VAL(MID$(a, (v1 - 1) * 10 + 5 + ((x - 1) * 2) + (bbb - 1), Cifra)); "";
  185.             PRINT #2, (MID$(a, (v1 - 1) * 10 + 5 + ((x - 1) * 2) + (bbb - 1), Cifra))
  186.             'posiziona                                                                      il cursore
  187.             LOCATE (v2 * 2) - 1, y
  188.             ' scrive il numero estratto
  189.             PRINT VAL(MID$(a, (v2 - 1) * 10 + 5 + ((x - 1) * 2) + (bbb - 1), Cifra)); "";
  190.             PRINT #2, MID$(a, (v2 - 1) * 10 + 5 + ((x - 1) * 2) + (bbb - 1), Cifra)
  191.         END IF
  192.     NEXT v2
  193. NEXT v1
  194. COLOR 15, 0
  195. ' indica il termine della SUBroutine MostraEstratti
  196. ' e RITORNA alla riga di codice successiva al salto GOSUB
  197.  
Programming isn't difficult, only it's  consuming time and coffee

Offline Kiara87

  • Forum Regular
  • Posts: 164
    • View Profile
Re: help my
« Reply #130 on: July 19, 2020, 05:46:36 pm »
Hi guys
how do you find this undefinied project about lotto?
I haven't follow more the thread and so now after a speed read
1. I have not understood how you have pulled out the date from the number of extraction ....
 2. it seems that the goal of program lotto has been changed because from images posted by Kiara87 it seems that now it is not more important to find the number with distance of 30 but some triples....

Please Kiara87 show us the whole plan of program... it is too hard spending time to accomplish a task that is partial and unuseful...be clear and complete!

Italian Google version....
Ciao ragazzi
come trovi questo progetto indefinito sul lotto?
Non ho seguito più il thread e quindi ora dopo una lettura veloce
1. Non ho capito come hai estratto la data dal numero di estrazione ....
  2. sembra che l'obiettivo del programma lotto sia stato modificato perché dalle immagini pubblicate da Kiara87 sembra che ora non sia più importante trovare il numero con una distanza di 30 ma alcune triple ...

Per favore, Kiara87 ci mostra l'intero piano del programma ... è troppo difficile passare del tempo per compiere un compito che è parziale e inutile ... sii chiaro e completo!

ciao @TempodiBasic

il problema della data la risolto @bplus che ha creato una funzione che va alla grande
la data calcola 1465 con la data di martedi 6 giugno 2017 e quello e stato risoldo spiegando a @bplus creando qualche funzione

io le estrazioni li prendo da questo programma che fa scaricare il file dat  http://www.mediafire.com/file/j82rukten353one/ARCHIVIO2.exe/file
e un programma di igor che usa vb6

cmq ho fatto una specie di pseudo codice spero che si capisca 

PSEUDO CODICE
APRI IL FILE
LEGGI IL FILE
I PRIMI 4 NUMERI SONO LE ESTRAZIONI ESTR. 1465 E = MARTEDI 6 GIUGNO
SE ESTRAZIONE SONO 3:7 E GIOCANO MARTEDI GIOVEDI SABATO
IL RESTO DELLA PRIMA RIGA SONO I NUMERI ESTRATTI
LEGGIMI IL RESTO DELLA LA PRIMA RIGA DEL FILE E METTILA 5 NUMERI PER RUOTA X 11 RUOTA
QUANDO CLICCO IL TASTO + LA PRIMA ESTRAZIONE SCORRE E VA NELLA SECONDA RIGA LEGGENDOMI LA SECONDA RIGA DEL FILE
METTI LA SECONDA RIGA I PRIMI 4 NUMERI SONO ESTRAZIONI
RIMANENZA DEI NUMERI SONO I 5 ESTRATTI PER OGNI RUOTA X 11
SE IN QUALSIASI ESTRAZ SI TROVA UNA COPPIA DI NUMERI SU DUE RUOTE DISTANZA 30 STESSA POSIZIONE ESTRAZIONALE CHE FORMA UN QUADRATO ALLORA COLORALI DI VERDE
STAMPAMI NEL MEZZO DELLE DUE ESTRAZIONI LE DUE DISTANZE 30 MANCANTI E LE RUOTE DOVE SI TROVA LA CONDIZIONE
CERCA I NUMERI NELLA SECONDA ESTRAZIONE COLORANDOLI IN ROSSO SU TUTTE LE RUOTE SOLAMENTE I DUE NUMERI MANCANTI DELLA DISTANZA 30

ESEMPI
si ricercano su  due ruote diverse,

42-58-72-88   i due numeri distanza 30 sono dal 42-72  manca il 12 mentre dal 58-88 manca il 28
quindi il programma stampa nel mezzo delle due estrazioni i due numeri mancanti della terzina il 12-28 è le ruote dove è uscita la condizione
poi li cerca nella seconda estrazione  colorandoli di rosso anche se esce su altre ruote dovrebbe colorare anche un singolo numero dei due oppure tutti e due

i numeri che formano il quadrato possono essere  sia verticali che orizzontali oppure diagonali importante che formano un quadrato nella stessa posizione ad esempio su bari esce 14 in prima posizione e in seconda 74 su cagliari prima e seconda posizione 33-63
anche se sono diagonali verticali orizzontali vabbene
e tutte le condizioni che trova li mette in mezzo alle due estrazioni le ruote da giocare con gli elementi mancanti delle terzine

credo che il mio pseudo codice non sia chiaro cerchero' di rifarlo provando è riprovando
poi devo capire come funziona il for to annidato
e tante funzioni che usate voi programmatori per cambiare il mio codice

bplus nel ultimo codice ha realizzato il programma perfetto però  io non ho dato maggior informazioni
nel senso che non avevo detto che il programma doveva catturare qualsiasi condizione si trovava sia in orizzontale in verticale o diagonale
quindi ha creato il programma che rileva solo 1 sola condizione
il motivo e solo perche non sono stata chiara con i dettagli e fornendo dettagli ben precisi




se avessi solo un'ora per salvare il mondo, passerei 55 minuti per definire bene il problema e 5 a trovare la soluzione

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: help my
« Reply #131 on: July 19, 2020, 07:44:09 pm »
@Kiara87
per la funzione della data andrò a guardare il codice di Bplus così da capire quale algoritmo di codifica è stato usato visto che il numero di estrazione è vario di anno in anno e non supera il valore 150 come si può evincere guardando un po' gli archivi qui
https://www.estrazionedellotto.it/risultati/archivio-lotto-2017
riguardo al tuo scopo finale sembra che sia trovare il numero assente della tripletta con distanza 30 in orizzontale e in verticale.... aspettando maggiori informazioni riguardo la direzione diagonale da usare.
usa l'immagine che posto qui per spiegarmi la diagonale di cui parli.

for function of data I'll take a look at Bplus' code so to understand what algorythm to codify it has been used seeing that the number of extraction is different each year and it cannot be more tha 150 as value as you can understand looking just a little into archives here
https://www.estrazionedellotto.it/risultati/archivio-lotto-2017

about your goal it seems to get the absent number of a triplet with distance of 30 both in vertical both horizontal....
waiting more informations about diagonal direction to use.
Use the image that I post here to explain me the  diagonal direction of which you talk.
  [ You are not allowed to view this attachment ]  
Programming isn't difficult, only it's  consuming time and coffee

Offline Kiara87

  • Forum Regular
  • Posts: 164
    • View Profile
Re: help my
« Reply #132 on: July 20, 2020, 04:06:07 am »
@Kiara87
per la funzione della data andrò a guardare il codice di Bplus così da capire quale algoritmo di codifica è stato usato visto che il numero di estrazione è vario di anno in anno e non supera il valore 150 come si può evincere guardando un po' gli archivi qui
https://www.estrazionedellotto.it/risultati/archivio-lotto-2017
riguardo al tuo scopo finale sembra che sia trovare il numero assente della tripletta con distanza 30 in orizzontale e in verticale.... aspettando maggiori informazioni riguardo la direzione diagonale da usare.
usa l'immagine che posto qui per spiegarmi la diagonale di cui parli.

for function of data I'll take a look at Bplus' code so to understand what algorythm to codify it has been used seeing that the number of extraction is different each year and it cannot be more tha 150 as value as you can understand looking just a little into archives here
https://www.estrazionedellotto.it/risultati/archivio-lotto-2017

about your goal it seems to get the absent number of a triplet with distance of 30 both in vertical both horizontal....
waiting more informations about diagonal direction to use.
Use the image that I post here to explain me the  diagonal direction of which you talk.
  [ You are not allowed to view this attachment ]


06/06/2017  NA 72-84  (2°-4°)  Dist.Diag.30
06/06/2017  VE 24-12  (2°-4°)
Ambi ISOTOPI
-------------------------------------------
ecco una panoramica nella tua immagine su napoli venezia in seconda e 4 posizione  a napoli 2posizione il 72 e 4posizione 84
mentre venezia 2posizione 24 in 4 posizione il 12
quindi occupano tutte due coppie seconda e quarta posizione
il 12 e in diagonale con il 72 mentre il 84 è indiagonale con il 24
le due terzine mancanti delle due coppie sono 42-54
perche dal 12+30=42    dal 72+30=102-90 =12 perche i numeri arrivano a 90 42+30=72
24+30=54    54+30=84      84+30=114-90=24

nel gioco del lotto essendo che i numeri arrivano a 90 la distanza arriva a 45
45 e il massimo della distanza
quindi tra il 12 e 72 non si può dire che è distanza 60 perche la distanza il suo limite è 45
esempio 12+45=57  questa e la distanza 45  nel lotto per vedere la distanza prendo in considerazione il 12

se faccio 12-30=72 perchè nel gioco del lotto quando si esegue il meno è il numero arriva al numero 1 poi ancora meno saranno 90-89-88 fino ad arrivare a 72
esempio dal 12-30  togliendo 11 sarà il numero 1 se faccio meno 12 sarà il numero 90 dal 90 tolgo 18 quindi il numero sarà 72
nel lotto se supera il numero 90 si eseque il numero 90 mentre se devi fare la distanza e vai il calcolo con il - quando arrivi al numero 1 poi cè il 90
spero che il concetto si capisce

se avessi solo un'ora per salvare il mondo, passerei 55 minuti per definire bene il problema e 5 a trovare la soluzione

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: help my
« Reply #133 on: July 20, 2020, 07:24:54 am »
Ambi ISOTOPI.... questa Aritmologia e Cabala da lotto mi manda in corto circuito i neuroni :-)

cmq sembra che qui ci sia un programma che ti potrebbe aiutare già fatto da qualcun altro....http://www.pc-facile.com/forum/viewtopic.php?t=110012  guarda in fondo al thread c'è il link per il programma.

Solo a vedere questi ragionamenti cabalistici mi viene l'orticaria :-) https://www.lottogazzetta.it/metodo-dellambo-ripetuto-isotopo-i-parte/ forse è per questo che mi riesce difficile capire quello che ti serve una mia naturale allergia al campo del lotto.
Programming isn't difficult, only it's  consuming time and coffee

Offline Kiara87

  • Forum Regular
  • Posts: 164
    • View Profile
Re: help my
« Reply #134 on: July 20, 2020, 07:46:33 am »
Ambi ISOTOPI.... questa Aritmologia e Cabala da lotto mi manda in corto circuito i neuroni :-)

cmq sembra che qui ci sia un programma che ti potrebbe aiutare già fatto da qualcun altro....http://www.pc-facile.com/forum/viewtopic.php?t=110012  guarda in fondo al thread c'è il link per il programma.

Solo a vedere questi ragionamenti cabalistici mi viene l'orticaria :-) https://www.lottogazzetta.it/metodo-dellambo-ripetuto-isotopo-i-parte/ forse è per questo che mi riesce difficile capire quello che ti serve una mia naturale allergia al campo del lotto.
si ho visto il tuo link ma io volevo farlo con QB64 PER imparare come fare un programma del lotto e anche imparare il QB64
per programmi su internet riguardante al lotto ne ho scaricati una marea ma volevo imparare a crearne uno tutto mio
magari vedndo come si creava qualche algoritmo

nel codice di bplus  parlo del ultimo codi ha fatto un algoritmo valido che stampa le due terzine mancanti

pero' io non riesco a leggere il suo codice perche' sono inesperto

adesempio volevo adesso capire come cercare la distanza 30 invece che verticale cercarla in orizzontale nelle ruota
cmq certamente se non si conosce bene il lotto non e facile creare un programma per il lotto come io non conoscendo la programmazione ma conoscendo solo il lotto non riesco a creare un programma

il fatto che cerco di usare i vostri consigli ma non mi e chiaro dai vostri codici a modificare spero che un giorno riusciro
e magari creare anche programmi diversi dal lotto programmi di ogni tipo
se avessi solo un'ora per salvare il mondo, passerei 55 minuti per definire bene il problema e 5 a trovare la soluzione