<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/">
	<channel>
		<title>Additional information on the StraightsMatrix Excel File.</title>
		<link>https://blogs.lotterypost.com/jadelottery/2012/3/additional-information-on-the-straightsmatrix.htm</link>
		<atom:link href="https://www.lotterypost.com/rss/blogcomments/64322" rel="self" type="application/rss+xml" />
		<description>JADELottery's Blog: Additional information on the StraightsMatrix Excel File.</description>
		<dc:language>en-us</dc:language>
		<generator>Lottery Post RSS Generator</generator>
		<item>
			<title>Original Blog Entry: Additional information on the StraightsMatrix Excel File.</title>
			<link>https://blogs.lotterypost.com/jadelottery/2012/3/additional-information-on-the-straightsmatrix.htm</link>
			<guid isPermaLink="true">https://blogs.lotterypost.com/jadelottery/2012/3/additional-information-on-the-straightsmatrix.htm</guid>
			<pubDate>Sat, 17 Mar 2012 14:44:50 GMT</pubDate>
			<dc:creator>JADELottery</dc:creator>
			<description><![CDATA[<p>Hello everyone,<br /><br />The other day we posted an Excel file with a simple example of a function we created to find straight combos from a square matrix.<br /><br />You can get the file here for reference -- http://members.lotterypost.com/jadelottery/StraightsMatrix.xls<br /><br />Essentially, this is a simple wheel for Daily Pick 3.<br /><br />We actually use this in our Pick 3 Hot Box program under the &#x27; Fill the Play Combos &#x27; options as &#x27; Straight from the Side &#x27; .<br /><br />It works by creating straight combos from the left side of the square matrix to the right side.<br /><br />The general square matrix is the following.<br /><br />Inputs<br /><br />A B C<br /><br />D E F<br /><br />G H I<br /><br />The function takes the inputs and runs through the permutations for each column and removes any duplication after creating the playable list.<br /><br />The playable list is generally the following.<br /><br />Outputs<br /><br />A B C<br /><br />A B F<br /><br />A B I<br /><br />A E C<br /><br />A E F<br /><br />A E I<br /><br />A H C<br /><br />A H F<br /><br />A H I<br /><br />D B C<br /><br />D B F<br /><br />D B I<br /><br />D E C<br /><br />D E F<br /><br />D E I<br /><br />D H C<br /><br />D H F<br /><br />D H I<br /><br />G B C<br /><br />G B F<br /><br />G B I<br /><br />G E C<br /><br />G E F<br /><br />G E I<br /><br />G H C<br /><br />G H F<br /><br />G H I<br /><br />By example, if the following are the inputs.<br /><br />Inputs<br /><br />2 4 5<br /><br />5 2 8<br /><br />9 6 4<br /><br />Then the outputs are...<br /><br />Outputs<br /><br />224<br /><br />225<br /><br />228<br /><br />244<br /><br />245<br /><br />248<br /><br />264<br /><br />265<br /><br />268<br /><br />524<br /><br />525<br /><br />528<br /><br />544<br /><br />545<br /><br />548<br /><br />564<br /><br />565<br /><br />568<br /><br />924<br /><br />925<br /><br />928<br /><br />944<br /><br />945<br /><br />948<br /><br />964<br /><br />965<br /><br />968<br /><br />An example of a case where duplicates are removed.<br /><br />Inputs<br /><br />4 9 4<br /><br />4 0 3<br /><br />2 5 3<br /><br />Outputs<br /><br />203<br /><br />204<br /><br />253<br /><br />254<br /><br />293<br /><br />294<br /><br />403<br /><br />404<br /><br />453<br /><br />454<br /><br />493<br /><br />494<br /><br />Duplicates are created when any two or more numbers are the same; in the same column.<br /><br />In the above example, because 4 and 4 are in the first column; 3 and 3 are in the last column, it creates duplicates through the permutation process.<br /><br />The original output would look like the following, color highlighted for the duplication and the non-duplication are Italic.<br /><br />Outputs<br /><br />494<br /><br />493<br /><br />493<br /><br />404<br /><br />403<br /><br />403<br /><br />454<br /><br />453<br /><br />453<br /><br />494<br /><br />493<br /><br />493<br /><br />404<br /><br />403<br /><br />403<br /><br />454<br /><br />453<br /><br />453<br /><br />294<br /><br />293<br /><br />293<br /><br />204<br /><br />203<br /><br />203<br /><br />254<br /><br />253<br /><br />253<br /><br />The program code working behind the scenes is the following.<br /><br />__________<br /><br />Dim arry() As Integer<br /><br />Public Function StraightsMatrix(ByVal theRange As Range) As String<br /><br />Randomize(Timer)<br /><br />ReDim arry(27) As Integer<br /><br />Dim tmp As String<br /><br />tmp =<br /><br />If (theRange.Rows.Count = 3) And (theRange.Columns.Count = 3) Then<br /><br />For a = 1 To 3<br /><br />For b = 1 To 3<br /><br />For c = 1 To 3<br /><br />arry(1 + 1 * (c - 1) + 3 * (b - 1) + 9 * (a - 1)) = 100 * Val(theRange.Cells(a, 1)) + 10 * Val(theRange.Cells(b, 2)) + 1 * Val(theRange.Cells(c, 3))<br /><br />Next<br /><br />Next<br /><br />Next<br /><br />QuickSort(1, 27)<br /><br />For r = 1 To 26<br /><br />If arry(r) arry(r + 1) Then<br /><br />tmp = tmp Format(arry(r), 000 )<br /><br />End If<br /><br />If r = 26 Then<br /><br />tmp = tmp Format(arry(r + 1), 000 )<br /><br />End If<br /><br />Next<br /><br />StraightsMatrix = tmp<br /><br />Else<br /><br />StraightsMatrix =<br /><br />End If<br /><br />End Function<br /><br />Sub QuickSort(ByVal Low As Long, ByVal High As Long)<br /><br />Dim RandIndex, i, j As Integer<br /><br />Dim p As Integer<br /><br />If Low High Then<br /><br />If High - Low = 1 Then<br /><br />If arry(Low) arry(High) Then<br /><br />SwapArrayElements(Low, High)<br /><br />End If<br /><br />Else<br /><br />RandIndex = RandInt(Low, High)<br /><br />SwapArrayElements(High, RandIndex)<br /><br />p = arry(High)<br /><br />Do<br /><br />i = Low : j = High<br /><br />Do While (i j) And (arry(i) = p)<br /><br />i = i + 1<br /><br />Loop<br /><br />Do While (j i) And (arry(j) = p)<br /><br />j = j - 1<br /><br />Loop<br /><br />If i j Then<br /><br />SwapArrayElements(i, j)<br /><br />End If<br /><br />Loop While i j<br /><br />SwapArrayElements(i, High)<br /><br />If (i - Low) (High - i) Then<br /><br />QuickSort(Low, i - 1)<br /><br />QuickSort(i + 1, High)<br /><br />Else<br /><br />QuickSort(i + 1, High)<br /><br />QuickSort(Low, i - 1)<br /><br />End If<br /><br />End If<br /><br />End If<br /><br />End Sub<br /><br />Sub SwapArrayElements(ByVal a, ByVal b)<br /><br />Dim hold As Integer<br /><br />hold = arry(a)<br /><br />arry(a) = arry(b)<br /><br />arry(b) = hold<br /><br />End Sub<br /><br />Function RandInt(ByVal Lower, ByVal Upper) As Integer<br /><br />RandInt = Int(Rnd * (Upper - Lower + 1)) + Lower<br /><br />End Function<br /><br />__________<br /><br />... &#x5b;&#xa0;<a href="https://blogs.lotterypost.com/jadelottery/2012/3/additional-information-on-the-straightsmatrix.htm">More</a>&#xa0;&#x5d;</p>]]></description>
			<category>Blog Entry</category>
			<category>JADELottery</category>
			<wfw:comment>https://www.lotterypost.com/blogentry/64322</wfw:comment>
		</item>
	</channel>
</rss>

