423,688 Members | 1,889 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,688 IT Pros & Developers. It's quick & easy.

Lottery analysis - Counting the quantity and size of "blocks" of "hits" in a 7x7 Grid

P: 14
Hi, I am using Visual Basic 5 Learner's edition on a HP envy laptop running Windows 7.

I have written some fairly unsophisticated, but quite useful routines for my personal analysis of the UK 6 from 49 lottery.

For my purposes I have created a 7x7 "grid" consisting of an array of labels (i.e. label1(0) to Label1(48) and have written code to analyse various properties of the patterns generated in each game.

I am only looking at the main numbers, which I visualise on the grid by assigning a vbred backcolor property to each of the selected numbers. (see attachment)

I had thought that counting the number and size of the "blocks" ie highlighted numbers adjacent, in this case, only 2 Blocks, 1 of 5 squares and 1 of 1, would be fairly straightforward, but I am completely stymied.

I have used grids with arrays and without arrays, with extended arrays and with many types of sub-routines utilizing the backcolor property,and invoking other properties, and then analysing the surrounding squares of each selected number, but in the end I have been unable to differentiate between the separate blocks.

I only end up drawing flow diagrams which when coded, work fine to a degree, but ultimately fail to differentiate one block from another. Any help would be greatly appreciated.
May 1 '14 #1
Share this Question
Share on Google+
30 Replies


P: 14
Hi, just to announce that I solved the problem myself. I dispensed with the label array and created a grid of labels 1 to 49 which simplified things somewhat. I then created 6 variables for counting the blocks of numbers, and used the datechanged property of a textbox to increment the variables, hence counting the size of each block. A little clumsy, but effective.
May 7 '14 #2

P: 14
Ooops - ultimately that didn't work. I really would appreciate some help here please. All I want to know is to how to count the sizes and quantity of "blocks" of numbers on the results grid!
For example the numbers 4, 11 and 19 would count as one block of three, while 26, 28 and 34 would also count as one block of three, giving two blocks of 3 numbers each. the numbers 4, 13, 30, 39, 48 and 49 would give 5 blocks, etc. Perhaps I was not explicit previously.
Sep 28 '14 #3

drmdrm
P: 1
For simple detection on random process - like lottery will be better to sort results on 1st step and after count/filter them on 2nd step.
Wherever sort will give you quick rule than each next number from results are bigger (easy to use in loops)- imho is more better tools than VB (example AWK) to quite easier solve such things ;)
Sep 28 '14 #4

P: 14
Thanks drmdrm for your reply. I've had no problem with other filters in vb5, and this is the only remaining block i've come up against. I did write code to sort the results first, and this process i'm trying to do is the 2nd step. As with many other parameters, like odds/evens, decades, number sums etc., I believe that the number and size of blocks in each draw's unique grid pattern will follow a Bell curve, with 3,1,1,1 and 3,2,1 for example being very common It is these statistics from each draw which I wish to gather and analyse. Having used VB5 to study these patterns graphically, I'm reluctant to turn to another programming solution, hence my appeal for vb5 expertise. Hope this clarifies a little.
Sep 28 '14 #5

Rabbit
Expert Mod 10K+
P: 12,272
I have no idea how you arrived at your counts. Please explain in more detail.
Sep 29 '14 #6

P: 14
Hello Rabbit, I took a sample of 500 or so draws of the UK 6 from 49 Lotto. I keep the entire draw history on printed arrays of 7x7 grids so that I can analyse the patterns using various parameters.
Of the 1000 I randomly selected, I found that 18% of the draws' numbers were grouped on the grid into three discrete blocks, 40% had 4 blocks of numbers and 26% had 5 blocks, accounting for 84% of draws. I wish to use VB5 to analyse the complete draw history looking at these patterns for each individual draw with a view to creating filters. There are, of course many other ways of classifying the 7x7 grid patterns. This is the only one I have had trouble coding, the problem arising when I try to differentiate the groups. The groups of course can be from 1 which is very rarely found, to 6 where each number is separated from each other by a minimum of one square diagonally, vertically or horizontally.

I was counting the number of members of eacht group using my VB5 program designating them GroupSize, and then trying to count the number of groups using the variable GroupQuantity, but somewhere in my loops and subroutines, the GroupQuantity variable got scrambled.

I did away with label arrays and merely named the number labels Label1 to Label49 and worked sequentially through the labels, which were coded to show background VBred colour to designate the "hits" for each draw record.

Imagine that the results for a particlar draw were 1,9,16,22,40 and 49.

My program would read label1 find it's backcolour VBRed and thus assign it GroupSize1=1, GroupQuantity=1, then seeing that numbers 2 and 8 were VBwhite backcolour, would reach label9 before incrementing GroupSize to 2, leaving Quantity with value 1. The program would then analyse the labels surrounding Label9 in a simalar fashion, eventually incrementing the first GroupSize to 4 and GroupQuantity remaining at 1 until it reached 40 when it should reach GroupQuantity =2 and 49 where the GroupQuantity should read 3 and the GroupSizes would be 4,1,1 respectively. For some reason though the variables would mess up. I tried stepping the code, but got hopelessly confused. I felt I was so near many times, but my code always let me down.
Sep 29 '14 #7

Rabbit
Expert Mod 10K+
P: 12,272
The missing piece was that a group is defined by a string of numbers connected in any direction without a gap.

Can you post your code that is closest to the solution you are looking for? We can try to diagnose where you went awry.
Sep 29 '14 #8

twinnyfo
Expert Mod 2.5K+
P: 2,667
Yes... No attachments (from post #1) or any code keeps us in the dark about what solution you are actually trying to work on.
Oct 1 '14 #9

P: 14
Sorry twinnyfo, I thought I had attached picture of form to post#1. I also thought I had replied to Rabbit's post enclosing code. I must be doing something wrong.
Oct 1 '14 #10

twinnyfo
Expert Mod 2.5K+
P: 2,667
In your reply, click on the "[ CODE / ]" button. Inserting your code between the Braces "][" and it will display properly.

Typing "[ CODE ]This is Code[ /CODE ]" (I have to add spaces so the forum does not read it as a code tag)

Will produce this:

Expand|Select|Wrap|Line Numbers
  1. This is Code
Also, for screenshots, it's best to embed in a word doc, as resolution is limited for images here.
Oct 1 '14 #11

P: 14
Thanks for your patience - I'll try that.
Oct 1 '14 #12

P: 14
Had trouble submitting code within this window , so have tried adding as attachment....
Attached Files
File Type: docx VB Form1.docx (23.2 KB, 239 views)
File Type: docx Code For Lottery Blocks.docx (42.8 KB, 207 views)
Oct 1 '14 #13

twinnyfo
Expert Mod 2.5K+
P: 2,667
No wonder you couldn't add the code in the code tags--this is hundreds of pages!
Oct 1 '14 #14

twinnyfo
Expert Mod 2.5K+
P: 2,667
Wow! So, my first question is to piggy back on Rabbit's Post #8: You are trying to determine if lottery picks tend to fall within blocks (blocks defined as two numbers falling within your grid in adjacent "cells"). For example in a 3x3 grid, assuming number 5 is selected, any other number in that 3x3 grid meets the criteria? I'm just trying to understand what you are shooting for, first.

Expand|Select|Wrap|Line Numbers
  1. X O O
  2. O X O
  3. O O O
Second, from a coding standpoint, your code looks more like 100's of pages of cut-and-paste of the same code, with just the numerical values changed. I admit, I gave up after the first few pages and just scanned......... Assuming your method of looking at the values is correct, there must be a better way of doing it than what you have!

Third, to give you an alternate way of looking at things, if there are 49 numbers (7x7), and you are looking at your numbers based on this 7x7 grid, then why not calculate your data via rows and columns? If the answer to my first question was correct (numbers falling within the same block), then the evaluation for such a case becomes much more simplified:

Use a boolean Array [fArray(7,7)] which corresponds to the seven rows and seven columns. A True value in the array indicates that number was picked. So, for example, the number 24 would be represented by a "True" value in fArray(4,3)--fourth row, third column [21 values in the first three rows, 22, 23, 24--hence twinnyfo!].

Let's assume the number picked is in row X, column Y (it doesn't matter the actual value of the number, because we are looking at rows and columns.

So, if the number is identified as fArray(X, Y), then another value within the corresponding "block" would be any values that meet the following Criteria: (X-1, Y-1) through (X+1, Y+1):

Expand|Select|Wrap|Line Numbers
  1. X-1,Y-1 | X-1,Y | X-1,Y+1
  2. --------|-------|--------
  3.  X,Y-1  |  X,Y  |  X,Y+1
  4. --------|-------|--------
  5. X+1,Y-1 | X+1,Y | X+1,Y+1
This would streamline the logic behind your process tremendously!

Just a thought!
Oct 1 '14 #15

twinnyfo
Expert Mod 2.5K+
P: 2,667
Jacko,

I just re-re-re-read your Post #3 and I think you answered my question about Blocks--although in your last example, I only came up with four blocks....
Oct 1 '14 #16

twinnyfo
Expert Mod 2.5K+
P: 2,667
And......

have you tried doing this in MS Access? Essentially the same coding techniqes, but you have an easy to use container for your numbers (a table)!
Oct 1 '14 #17

Rabbit
Expert Mod 10K+
P: 12,272
Just to be sure we're on the same page, the result of the screenshot should be 6 groups of quantity 1.

You need to start the code from scratch, there's no need for a function for each and every cell.

In pseudocode, what you want to do is something like this:
Expand|Select|Wrap|Line Numbers
  1. sub button_click()
  2.    dim array(6, 6) 'Because arrays start at 0
  3.    dim groupid = 0
  4.  
  5.    for each cell
  6.       if cell is active
  7.          check left neighbors and top neighbors for existing group id
  8.          if existing id exists
  9.             set array cell to existing id
  10.          else
  11.             increment groupid and set array cell to groupid
  12.    next cell
  13.  
  14.    loop through array and count and output results by groupid
  15. end sub
  16.  
In actual code, it should come out to less than 50 lines of code.
Oct 1 '14 #18

Rabbit
Expert Mod 10K+
P: 12,272
Sorry, I just noticed a logical flaw in the pseudocode, stand by for correct psuedocode.
Oct 1 '14 #19

Rabbit
Expert Mod 10K+
P: 12,272
Here is corrected psuedo code
Expand|Select|Wrap|Line Numbers
  1. dim lottery array(6,6) '6 and not 7 because arrays start at 0
  2. dim groupid
  3.  
  4. sub button_click()
  5.    groupid = 0
  6.  
  7.    for each cell
  8.       if cell is "active" and has no groupid
  9.          groupid = groupid + 1
  10.          call sub markcells(coordinates of cell)
  11.    next cell
  12.  
  13.    loop through lottery array, count by groupid, and output results
  14. end sub
  15.  
  16. ' recursive function to mark every cell of a newly found group
  17. sub markcells(coordinates of cell)
  18.    lottery array(coordinates) = groupid
  19.  
  20.    for each neighboring cell
  21.       if cell is "active" and has no groupid
  22.          call sub markcells(coordinates of cell)
  23. end sub
Oct 1 '14 #20

P: 14
Yes Rabbit, in the screenshot shown, for that set of numbers, there would be six groups of quantity one. Other combinations of 6 from 49 might form two groups of three, three groups of two, a two, a one and a three group, one group of 4 with two groups of one etc. Or even one group of six which happens very rarely (about 0.25% or less of draws) I wish to analyse each draw in the lottery to determine each draw's grouping. Visually, of course it's deceptively simple, and one can tell at a glance by looking at each 7x7 grid as the draw results are inputted. I'm interested more in the patterns than in the numbers themselves, as the 7x7 grid could be laid out in many different (ordered) arrangements.
Oct 1 '14 #21

twinnyfo
Expert Mod 2.5K+
P: 2,667
Anyone ever play the old MS Game Minesweeper? That's what this exercise is reminding me of.

I can grasp the concept for finding a "Group" but extending a group outside the original 3x3 grid surrounding the number is throwing me off (final paragraph in post #7).
Oct 1 '14 #22

P: 14
sorry twinnyfo, you're waaay above my head here!

I don't think I've explained my problem very well.

I'm trying to determine, for any 6 from 49 lottery combination when visualised on a 7x7 grid, how many groupings there are.

There could be one group of six numbers all touching, vertically or diagonally, forming one block or there could be several other possibilities. So in the aforementioned example we would have a six block, designated:

6

Or there could be:

5, 1
4, 2
3, 3
4, 1, 1
3, 2, 1
3, 1, 1, 1
2, 2, 2
2, 2, 1, 1
2, 1, 1, 1, 1

or, if the numbers were all completely separate from each other (spacially on the grid)

1, 1, 1, 1, 1, 1
Oct 1 '14 #23

Rabbit
Expert Mod 10K+
P: 12,272
That's what my second block of pseudocode will do.
Oct 1 '14 #24

P: 14
I must admit Rabbit, that I'm not familiar with pseudocode, but I think I see the logic.

I tried to use a label array initially, (0-48)and tried to specify surrounding squares to each label by subtracting or adding from each label's value in turn. For example, label1(8) would identify the "9" square on the grid, 8-7 would specify label1(1) the "2" square, while 8-6 would specify the "3" square all the way up to 8+8 for the "17" square. The 25 numbers forming the inner grid would follow this pattern, but the perimeter squares of course don't conform, so this threw out my arrays. That's when I decided that the simplest solution for me was to laboriously process each square in the grid separately, hence the long and awkward code. (I hope I'm still making some sense).

Anyway, how would one go about translating your pseudocode into a working VB5 code? I'm afraid your expertise is way, way ahead of my level of understanding at present. But thank you again all for your help.
Oct 1 '14 #25

Rabbit
Expert Mod 10K+
P: 12,272
Pseudo code is just a mixture of stuff that kind of looks like code and natural language. It's meant to convey the general algorithm to use. You take each line of psuedo code and convert that to the language of your choice.

For example, take this psuedocode:
Expand|Select|Wrap|Line Numbers
  1. get a value from the user
  2. value = value + 7
  3. output the value to the user
There are many ways to translate the pseudocode to VBA code. One way could be this:
Expand|Select|Wrap|Line Numbers
  1. Dim x As Variant
  2.  
  3. x = "a"
  4.  
  5. If Not IsNumeric(x) Then
  6.    x = InputBox("Please Enter A Number")
  7. End If
  8.  
  9. x = CInt(x) + 7
  10. MsgBox x
Do the same with the psuedo code I posted above. If you run into a line you don't understand, post what you have so far and we can help you understand it and move on.
Oct 2 '14 #26

P: 14
Thank you, I'll have a go at that. I'll let you know the results.
Oct 2 '14 #27

twinnyfo
Expert Mod 2.5K+
P: 2,667
Here is my code:

Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2.  
  3. Public intArray(7, 7, 2) As Integer
  4. Public intGroup As Integer
  5. Public intBlocks(6) As Integer
  6.  
  7. Public Function FindBlocks(N1 As Integer, N2 As Integer, N3 As Integer, _
  8.     N4 As Integer, N5 As Integer, N6 As Integer) As String
  9.     Dim intRow As Integer
  10.     Dim intCol As Integer
  11.     Dim strBlocks As String
  12.     ResetArrays
  13.     intGroup = 0
  14.     'Assign 1 to all cells that have a lottery number in them
  15.     intArray(Row(N1), Col(N1), 1) = 1
  16.     intArray(Row(N2), Col(N2), 1) = 1
  17.     intArray(Row(N3), Col(N3), 1) = 1
  18.     intArray(Row(N4), Col(N4), 1) = 1
  19.     intArray(Row(N5), Col(N5), 1) = 1
  20.     intArray(Row(N6), Col(N6), 1) = 1
  21.     For intRow = 1 To 7
  22.         For intCol = 1 To 7
  23.             If intArray(intRow, intCol, 1) = 1 And _
  24.                 intArray(intRow, intCol, 2) = 0 Then
  25.                 intGroup = intGroup + 1
  26.                 intArray(intRow, intCol, 2) = intGroup
  27.                 intBlocks(intGroup) = intBlocks(intGroup) + 1
  28.                 CheckCells intRow, intCol
  29.             End If
  30.         Next intCol
  31.     Next intRow
  32.     strBlocks = ""
  33.     For intRow = 1 To 6
  34.         strBlocks = strBlocks & IIf(strBlocks = "", _
  35.              intBlocks(intRow), _
  36.             ", " & intBlocks(intRow))
  37.     Next intRow
  38.     FindBlocks = strBlocks
  39. End Function
  40. Public Function Row(Number As Integer) As Integer
  41.     Row = IIf(Number Mod 7 = 0, (Number / 7), Int(Number / 7) + 1)
  42. End Function
  43. Public Function Col(Number As Integer) As Integer
  44.     Col = Number Mod 7
  45. End Function
  46. Public Function CheckCells(Row As Integer, Col As Integer)
  47.     Dim intRow As Integer
  48.     Dim intCol As Integer
  49.     For intRow = Row - 1 To Row + 1
  50.         For intCol = Col - 1 To Col + 1
  51.             If Not ((intRow < 1) Or (intCol < 1) Or _
  52.                 (intRow > 7) Or (intCol > 7)) Then
  53.                 If intArray(intRow, intCol, 1) = 1 And _
  54.                     intArray(intRow, intCol, 2) = 0 Then
  55.                     intArray(intRow, intCol, 2) = intGroup
  56.                     intBlocks(intGroup) = intBlocks(intGroup) + 1
  57.                     CheckCells intRow, intCol
  58.                 End If
  59.             End If
  60.         Next intCol
  61.     Next intRow
  62. End Function
  63. Public Function ResetArrays()
  64.     Dim intRow As Integer
  65.     Dim intCol As Integer
  66.     For intRow = 1 To 7
  67.         For intCol = 1 To 7
  68.             intArray(intRow, intCol, 1) = 0
  69.             intArray(intRow, intCol, 2) = 0
  70.         Next intCol
  71.     Next intRow
  72.     For intRow = 1 To 6
  73.         intBlocks(intRow) = 0
  74.     Next intRow
  75. End Function
Here are my results, based on 100 sets of random numbers:

Expand|Select|Wrap|Line Numbers
  1. N1  N2  N3  N4  N5  N6  Blocks
  2. 17  16  12  9   33  2   4, 1, 1, 0, 0, 0
  3. 14  31  40  19  10  9   2, 1, 1, 1, 0, 0
  4. 20  48  24  19  34  40  2, 1, 3, 0, 0, 0
  5. 25  31  16  49  42  4   1, 1, 2, 0, 0, 0
  6. 32  6   20  49  27  43  1, 2, 1, 1, 0, 0
  7. 4   19  21  14  45  43  1, 1, 1, 1, 0, 0
  8. 1   25  34  13  2   19  2, 3, 1, 0, 0, 0
  9. 43  26  4   1   42  3   1, 2, 1, 1, 0, 0
  10. 10  41  12  35  8   25  1, 1, 1, 1, 1, 0
  11. 36  41  7   31  24  29  2, 2, 1, 0, 0, 0
  12. 4   20  29  15  16  42  1, 2, 1, 1, 0, 0
  13. 39  7   27  5   30  12  2, 1, 1, 1, 0, 0
  14. 41  45  27  34  4   28  1, 3, 1, 0, 0, 0
  15. 26  6   36  45  41  21  1, 1, 1, 1, 1, 0
  16. 27  36  47  28  38  13  1, 1, 1, 1, 1, 0
  17. 47  29  4   48  39  34  1, 1, 1, 3, 0, 0
  18. 7   46  40  11  5   31  2, 1, 2, 0, 0, 0
  19. 10  43  47  42  14  39  1, 2, 1, 0, 0, 0
  20. 21  39  36  45  43  46  2, 3, 0, 0, 0, 0
  21. 8   38  37  14  24  47  1, 1, 2, 1, 0, 0
  22. 3   8   37  30  43  31  1, 1, 4, 0, 0, 0
  23. 44  42  21  14  7   38  2, 0, 0, 0, 0, 0
  24. 4   22  32  23  17  27  1, 3, 1, 1, 0, 0
  25. 48  22  2   25  6   23  1, 1, 2, 1, 1, 0
  26. 11  15  48  22  13  30  1, 1, 3, 1, 0, 0
  27. 5   25  19  22  15  3   1, 1, 2, 2, 0, 0
  28. 20  27  43  2   38  40  1, 2, 1, 1, 1, 0
  29. 8   7   44  19  47  29  1, 1, 1, 1, 1, 0
  30. 8   14  36  33  44  15  2, 1, 2, 0, 0, 0
  31. 17  5   6   14  28  1   1, 2, 1, 0, 0, 0
  32. 35  38  34  14  20  26  3, 1, 0, 0, 0, 0
  33. 6   7   38  48  24  9   1, 1, 1, 1, 1, 0
  34. 15  31  48  28  41  4   1, 1, 1, 2, 0, 0
  35. 34  24  9   48  25  40  1, 2, 3, 0, 0, 0
  36. 1   16  7   5   49  10  1, 1, 2, 0, 0, 0
  37. 14  36  11  20  10  22  2, 1, 1, 1, 0, 0
  38. 39  36  25  2   4   8   2, 1, 1, 1, 1, 0
  39. 10  7   12  33  44  30  1, 1, 1, 1, 1, 0
  40. 29  37  31  10  45  16  2, 4, 0, 0, 0, 0
  41. 13  9   33  7   44  15  2, 1, 1, 1, 0, 0
  42. 30  38  47  34  4   39  1, 4, 1, 0, 0, 0
  43. 43  2   40  25  11  42  1, 1, 1, 1, 1, 0
  44. 3   38  32  7   13  23  1, 1, 1, 2, 0, 0
  45. 2   9   45  10  6   24  3, 1, 1, 1, 0, 0
  46. 31  21  27  47  10  4   2, 1, 1, 1, 0, 0
  47. 38  6   28  32  12  16  2, 1, 2, 0, 0, 0
  48. 11  48  30  26  47  1   1, 1, 1, 1, 2, 0
  49. 48  11  38  5   23  40  2, 1, 1, 2, 0, 0
  50. 5   11  6   1   37  44  1, 3, 2, 0, 0, 0
  51. 37  5   15  4   1   6   1, 3, 1, 1, 0, 0
  52. 42  37  15  26  7   49  1, 1, 1, 0, 0, 0
  53. 32  16  31  10  40  44  2, 3, 1, 0, 0, 0
  54. 3   35  6   37  19  15  1, 1, 1, 1, 1, 0
  55. 38  31  23  15  24  36  5, 1, 0, 0, 0, 0
  56. 34  11  8   32  20  45  1, 1, 1, 1, 1, 1
  57. 42  23  20  36  2   8   2, 1, 1, 1, 0, 0
  58. 41  7   48  12  11  18  3, 2, 0, 0, 0, 0
  59. 22  33  39  25  35  45  1, 4, 0, 0, 0, 0
  60. 4   39  36  23  2   30  1, 1, 3, 1, 0, 0
  61. 20  31  22  11  13  9   1, 1, 2, 1, 1, 0
  62. 32  15  12  44  45  27  1, 1, 1, 1, 2, 0
  63. 26  10  37  5   49  28  1, 1, 1, 1, 0, 0
  64. 26  14  4   40  34  23  1, 1, 3, 0, 0, 0
  65. 42  32  40  19  27  29  2, 1, 2, 0, 0, 0
  66. 13  23  3   45  47  33  1, 1, 1, 1, 1, 1
  67. 45  5   13  17  21  18  2, 2, 1, 0, 0, 0
  68. 19  21  49  23  43  46  1, 1, 1, 1, 0, 0
  69. 42  40  13  35  45  39  1, 3, 0, 0, 0, 0
  70. 12  14  42  15  43  5   2, 1, 1, 0, 0, 0
  71. 30  34  2   1   47  33  2, 1, 2, 1, 0, 0
  72. 13  47  20  40  39  44  2, 3, 1, 0, 0, 0
  73. 15  49  34  4   18  26  1, 1, 3, 0, 0, 0
  74. 20  6   3   9   48  18  2, 1, 1, 1, 1, 0
  75. 12  3   10  9   26  15  4, 1, 1, 0, 0, 0
  76. 23  33  18  6   20  3   1, 1, 1, 1, 1, 1
  77. 46  22  24  13  44  9   1, 1, 1, 1, 1, 1
  78. 45  17  46  20  18  38  2, 1, 3, 0, 0, 0
  79. 19  4   31  23  2   1   2, 1, 1, 2, 0, 0
  80. 11  34  36  8   21  15  2, 1, 1, 1, 0, 0
  81. 20  44  11  14  34  33  1, 1, 2, 1, 0, 0
  82. 12  24  27  46  8   34  1, 1, 1, 2, 1, 0
  83. 10  16  14  43  19  45  2, 1, 1, 1, 0, 0
  84. 16  31  39  48  26  2   1, 1, 1, 2, 1, 0
  85. 36  42  48  31  8   2   2, 1, 1, 1, 0, 0
  86. 11  36  40  33  48  2   1, 1, 3, 1, 0, 0
  87. 18  21  34  29  7   37  1, 2, 1, 0, 0, 0
  88. 49  13  40  41  32  39  1, 4, 0, 0, 0, 0
  89. 5   27  6   46  13  33  3, 2, 1, 0, 0, 0
  90. 12  16  5   15  34  45  2, 2, 1, 1, 0, 0
  91. 28  30  49  45  38  16  1, 3, 0, 0, 0, 0
  92. 12  8   25  31  21  1   2, 1, 2, 0, 0, 0
  93. 35  20  23  13  26  39  3, 1, 1, 0, 0, 0
  94. 2   34  11  47  44  6   1, 1, 1, 1, 1, 1
  95. 1   31  32  7   18  37  1, 1, 3, 0, 0, 0
  96. 43  18  9   5   33  23  1, 1, 1, 1, 1, 1
  97. 47  9   8   7   34  4   1, 2, 1, 1, 0, 0
  98. 19  47  49  6   33  13  3, 1, 1, 0, 0, 0
  99. 47  42  41  40  18  35  1, 3, 0, 0, 0, 0
  100. 12  45  16  10  44  43  2, 1, 3, 0, 0, 0
  101. 3   23  45  27  49  2   2, 1, 1, 1, 0, 0
I was within the MS Access Environment....

BTW, I KNOW that Arrays start at 0, so we coudl use an array of (6,6), but my mind just grasps 1-7 better than it does 0-6. Easy to convert back to (6,6) if you want to....
Oct 2 '14 #28

P: 14
Thank you Twinnyfo, I can't say how impressed I am with you guys. I can now see how I was tinkering with the wrong kind of Arrays - Control Arrays instead of these two dimensional programming Arrays. I have a lot to learn about VB!

Knowing even less about MS Access than VB5, I'll work at adapting your code for VB5. Your 75 lines of code certainly do the job I was looking for. Cheers!
Oct 2 '14 #29

twinnyfo
Expert Mod 2.5K+
P: 2,667
Glad I could be of service. Let us know if you get it working.
Oct 3 '14 #30

P: 14
I certainly will twinnyfo. Thanks again for evertone's replies.
Oct 3 '14 #31

Post your reply

Sign in to post your reply or Sign up for a free account.