Author Topic: Looking for old program or help recreating it  (Read 9126 times)

0 Members and 1 Guest are viewing this topic.

Offline random1

  • Newbie
  • Posts: 86
Re: Looking for old program or help recreating it
« Reply #45 on: December 10, 2021, 12:21:13 am »
Once I have my predictor back up and running I will test it against the strings you provided.
As I stated, I removed the predictor code and for testing other parts of the program I have
inserted a PRNG  with a range of 0 to 2.  0&1+2 for wildcard.  This allows me to make sure all
other code functions properly.  I still think it's going to take more than one method and maybe
several to get the job done although the results were impressive for being straight out of the box
playing against actual data.  The strings I provided range from easy to very difficult.  I selected
them to get a better idea how well your predictor works overall.   

R1

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
Re: Looking for old program or help recreating it
« Reply #46 on: December 10, 2021, 12:55:31 am »
On what basis are you assigning me these marks? Are you saying your sequences are deterministic? Or are you saying you just concealed the final digit from your data and then just brought it back in to grade my program? If you did the second thing, that's an extreme fallacy and you can just toss those results no matter how good they look. I kid... kinda... still deciding if that was a dirty move or not but I'll take a 77 anyway. :-)
« Last Edit: December 10, 2021, 05:48:03 am by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline random1

  • Newbie
  • Posts: 86
Re: Looking for old program or help recreating it
« Reply #47 on: December 10, 2021, 03:33:11 pm »
STxAxTIC
Please read this entire post.

I don't think your reading my post very carefully and just took the prediction idea and ran
with it.  Yes, your first attempt done very well IMHO, however I need to run hundreds of
test using other real data.

Nothing underhanded going on here, I run my programs updater each day which updates
the strings. If the event happened then a 1 is added to the string, if the event did not
happen then a 0 is added.  A type of web-crawler gathers the information, simple as that.

What benefit could I possibly gain by trying to trick you somehow, I want this to work?  I
don't expect to achieve perfect predictions.   My goal is to find which strings out of the 800+
that I use are the most predictable overall. 

The predictor is a small part of a much larger program, over 25K lines as it now stands. The
predictor / forecaster contains several stages which includes formatting the data that's fed to
the actual predictor and another stage that takes the predictors output and turns it into real
world data.  I tried to code it in a manner that allows me to paste prediction code directly into
the program without making any other changes.  This allows for fast turn around time and
also allows me to evaluate the many predictor codes I have came up with over the years.  My
code even allows stacking predictors as a means to compare them against each other or allow
several predictors outputs to be combined for the final prediction.   

The program gathers the information, does all the data processing / formatting and builds the
data strings formatted and ready for the predictor.  The input string variable is named Dat1$. 
Once the predictor is finished processing it prints the predicted value to a string named PV1$,
ie, predicted value.
     
If you want to make it easier for me to test your code then keep these in mind.  The program feeds
the predictor one string at a time, processes the prediction, then adds that value to an array before
moving to the next string where it repeats the process.  Once all the strings have been processed the
program then enters the final stage where the predictions are converted to real world data.

All I need is a program that will try to predict the next value for the string being processed, everything
else is complete.  Input = Dat1$, Output to PV1$.   String data flow is right to left.

I removed my predictor code and replaced it with a simple PRNG that generates a value from
0 to 2.  This was done as a means to test the pre and post processing stages of my code and
provide me a simple easy way to add code posted by others .  A output range of 0 to 2 is used
to produce a 0,1 or 2.  2=the wildcard option, or 50/50, the coin landing on it's side so to say.   

The average PRNG run is around 32% correct, "wildcards removed" from the calculation so the
77% is nothing to scoff at.  I consider it scored very well.  This however is based on a single
event, who knows if may of just been a bad day.

My main program will in the final stages kick out certain predictions based on it's overall past 
performance.  The program only needs 20 to 25 trusted predictions out of the 800+ that it
processes to give me what I need.

Anyway, hope this gives you a better understanding of what I am doing.  Again, 77% is a high
enough score to put this in the keeper box, but it also needs more real world testing to get a
better understanding of how it fairs overall.  It may prove better than a 77% hit rate as it was
only given 44 strings to process.  I spend much more time testing than coding.
 
R1

Edit

The PRNG baseline it taken from the real world, ie, final result where the 77% is gotten from
the string hit rate.  The PRNG taken at the string process averages form 46 to 52%.  On the
other hand the 77% translates to 60% real world, still much higher that the PRNG's 27 to 32%

Just wanted to clear that up.
R1

 
« Last Edit: December 10, 2021, 04:00:16 pm by random1 »

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
Re: Looking for old program or help recreating it
« Reply #48 on: December 12, 2021, 02:55:34 am »
Hey R1,

I read ya carefully m8, you've got a big project on your hands. As soon as your predictor part is working how you like it, we can resume the nitty-gritty. As for my code, I made some effort to make it better in case you are still wanting to use it for testing. Noticeable changes are better layering, more systematic and varied test cases, and overall bugfixes. I also am experimenting with how the guess is calculated. These experiments are subject to tweaking or outright removal.

The code below has over a hundred total test cases, but we start at case 79, skipping my data and going right to yours. I think it still scores a 77 in this form, for what that's worth. I honestly think the answer key has errors, but we can skip worrying about that. :-)

Code: QB64: [Select]
  1.  
  2. ' Version: 6
  3.  
  4. Type LetterBin
  5.     Signature As String
  6.     Count As Integer
  7.  
  8. Dim Shared TestData(1000, 2) As String
  9. Call LoadTestData
  10.  
  11. Dim Shared Alphabet1(2) As LetterBin ' 0 1
  12. Dim Shared Alphabet2(4) As LetterBin ' 00 01 10 11
  13. Dim Shared Alphabet3(8) As LetterBin ' 000 001 010 011 100 101 110 111
  14. Dim Shared Alphabet4(16) As LetterBin ' etc
  15. Dim Shared Alphabet5(32) As LetterBin
  16. Dim Shared Alphabet6(64) As LetterBin
  17. Dim Shared Alphabet7(128) As LetterBin
  18. Dim Shared Alphabet8(256) As LetterBin
  19. Dim Shared Alphabet9(512) As LetterBin
  20. Dim Shared Alphabet10(1024) As LetterBin
  21. Dim Shared Alphabet11(2048) As LetterBin
  22. Dim Shared Alphabet12(4096) As LetterBin
  23. Dim Shared Alphabet13(8192) As LetterBin
  24.  
  25. Alphabet1(1).Signature = "0"
  26. Alphabet1(2).Signature = "1"
  27. Call NewAlphabet(Alphabet1(), Alphabet2())
  28. Call NewAlphabet(Alphabet2(), Alphabet3())
  29. Call NewAlphabet(Alphabet3(), Alphabet4())
  30. Call NewAlphabet(Alphabet4(), Alphabet5())
  31. Call NewAlphabet(Alphabet5(), Alphabet6())
  32. Call NewAlphabet(Alphabet6(), Alphabet7())
  33. Call NewAlphabet(Alphabet7(), Alphabet8())
  34. Call NewAlphabet(Alphabet8(), Alphabet9())
  35. Call NewAlphabet(Alphabet9(), Alphabet10())
  36. Call NewAlphabet(Alphabet10(), Alphabet11())
  37. Call NewAlphabet(Alphabet11(), Alphabet12())
  38. Call NewAlphabet(Alphabet12(), Alphabet13())
  39.  
  40. Dim thestring As String
  41. Dim actual As String
  42.  
  43. m = 79
  44. thestring = ""
  45.  
  46.     ' If analyzing pre-cooked data, load test string into Fingerprint(1).
  47.     If (m > 0) Then
  48.         thestring = TestData(m, 1)
  49.         actual = TestData(m, 2)
  50.     Else
  51.         actual = "?"
  52.     End If
  53.  
  54.     Cls
  55.     For k = 1 To _Width
  56.         Print "-";
  57.     Next
  58.     Print
  59.     Print "Case:"; m
  60.     Print
  61.     Call Analyze(thestring, actual)
  62.     Print
  63.  
  64.  
  65.     If (m > 0) Then
  66.         m = UserInput1(k, m)
  67.     Else
  68.         thestring = UserInput2$(k, thestring)
  69.     End If
  70.  
  71.     _KeyClear
  72.     _Limit 30
  73.  
  74.  
  75. Sub Analyze (TheStringIn As String, ActualIn As String)
  76.     Dim As Integer j, k
  77.     Dim As Double r
  78.     Dim Fingerprint(16) As String
  79.     Dim p(2 To 13) As Double
  80.  
  81.     ' Create shifted versions of string, i.e. ABCD -> BCDA, CDAB, DABC, ABCD, BCDA, etc.
  82.     Fingerprint(1) = TheStringIn
  83.     For k = 2 To UBound(Fingerprint)
  84.         Fingerprint(k) = Right$(Fingerprint(k - 1), Len(Fingerprint(k - 1)) - 1) + Left$(Fingerprint(k - 1), 1)
  85.     Next
  86.  
  87.     ' Initialize partial results.
  88.     For k = LBound(p) To UBound(p)
  89.         p(k) = -999
  90.     Next
  91.  
  92.     Call CreateHisto(Fingerprint(), Alphabet2(), 2)
  93.     Call CreateHisto(Fingerprint(), Alphabet3(), 3)
  94.     Call CreateHisto(Fingerprint(), Alphabet4(), 4)
  95.     Call CreateHisto(Fingerprint(), Alphabet5(), 5)
  96.     Call CreateHisto(Fingerprint(), Alphabet6(), 6)
  97.     Call CreateHisto(Fingerprint(), Alphabet7(), 7)
  98.     Call CreateHisto(Fingerprint(), Alphabet8(), 8)
  99.     Call CreateHisto(Fingerprint(), Alphabet9(), 9)
  100.     Call CreateHisto(Fingerprint(), Alphabet10(), 10)
  101.     Call CreateHisto(Fingerprint(), Alphabet11(), 11)
  102.     Call CreateHisto(Fingerprint(), Alphabet12(), 12)
  103.     Call CreateHisto(Fingerprint(), Alphabet13(), 13)
  104.  
  105.     If (Len(TheStringIn) >= 2) Then Call PrintHisto(Alphabet2(), 0) ' Turn the last number high to print stats for that histogram.
  106.     If (Len(TheStringIn) >= 3) Then Call PrintHisto(Alphabet3(), 0)
  107.     If (Len(TheStringIn) >= 4) Then Call PrintHisto(Alphabet4(), 0)
  108.     If (Len(TheStringIn) >= 5) Then Call PrintHisto(Alphabet5(), 0)
  109.     If (Len(TheStringIn) >= 6) Then Call PrintHisto(Alphabet6(), 0)
  110.     If (Len(TheStringIn) >= 7) Then Call PrintHisto(Alphabet7(), 0)
  111.     If (Len(TheStringIn) >= 8) Then Call PrintHisto(Alphabet8(), 0)
  112.     If (Len(TheStringIn) >= 9) Then Call PrintHisto(Alphabet9(), 0)
  113.     If (Len(TheStringIn) >= 10) Then Call PrintHisto(Alphabet10(), 0)
  114.     If (Len(TheStringIn) >= 11) Then Call PrintHisto(Alphabet11(), 0)
  115.     If (Len(TheStringIn) >= 12) Then Call PrintHisto(Alphabet12(), 0)
  116.     If (Len(TheStringIn) >= 13) Then Call PrintHisto(Alphabet13(), 0)
  117.     Print
  118.  
  119.     If (Len(TheStringIn) >= 2) Then p(2) = MakeGuess(TheStringIn, Alphabet2(), 2, 1) ' Set the last number =1 to print guess for that histogram.
  120.     If (Len(TheStringIn) >= 3) Then p(3) = MakeGuess(TheStringIn, Alphabet3(), 3, 1)
  121.     If (Len(TheStringIn) >= 4) Then p(4) = MakeGuess(TheStringIn, Alphabet4(), 4, 1)
  122.     If (Len(TheStringIn) >= 5) Then p(5) = MakeGuess(TheStringIn, Alphabet5(), 5, 1)
  123.     If (Len(TheStringIn) >= 6) Then p(6) = MakeGuess(TheStringIn, Alphabet6(), 6, 1)
  124.     If (Len(TheStringIn) >= 7) Then p(7) = MakeGuess(TheStringIn, Alphabet7(), 7, 1)
  125.     If (Len(TheStringIn) >= 8) Then p(8) = MakeGuess(TheStringIn, Alphabet8(), 8, 1)
  126.     If (Len(TheStringIn) >= 9) Then p(9) = MakeGuess(TheStringIn, Alphabet9(), 9, 1)
  127.     If (Len(TheStringIn) >= 10) Then p(10) = MakeGuess(TheStringIn, Alphabet10(), 10, 1)
  128.     If (Len(TheStringIn) >= 11) Then p(11) = MakeGuess(TheStringIn, Alphabet11(), 11, 1)
  129.     If (Len(TheStringIn) >= 12) Then p(12) = MakeGuess(TheStringIn, Alphabet12(), 12, 1)
  130.     If (Len(TheStringIn) >= 13) Then p(13) = MakeGuess(TheStringIn, Alphabet13(), 13, 1)
  131.     Print
  132.  
  133.     Print "Analyzing:"
  134.     Print TheStringIn
  135.     Print
  136.     Print "Thinking:";
  137.     For k = LBound(p) To UBound(p)
  138.         If (p(k) <> -999) Then Print p(k); Else Print "_ ";
  139.     Next
  140.     Print: Print
  141.  
  142.     j = 0
  143.     r = 0
  144.     Dim h
  145.     ' the only human disgression allowed is in the next 10 or so lines
  146.     For k = UBound(p) To LBound(p) Step -1
  147.         h = 1 + k - LBound(p)
  148.         h = h * h ' proposed model: later guesses count for more. this line can be commented out or made more elaborate
  149.         If (p(k) <> -999) Then
  150.             ' weighted average calculated here
  151.             r = r + h * p(k)
  152.             j = j + h
  153.         End If
  154.     Next
  155.     If (j <> 0) Then r = r / j
  156.     Print "Predicting:  "; _Trim$(Str$(r))
  157.     If (r > .5) Then
  158.         r = 1
  159.     Else
  160.         r = 0
  161.     End If
  162.     Print
  163.     Print "Rounding to: "; _Trim$(Str$(r))
  164.  
  165.     If (ActualIn <> "?") Then
  166.         Print
  167.         Print "Actual:      "; ActualIn
  168.         If (_Trim$(Str$(r)) <> ActualIn) Then
  169.             'Beep
  170.             Print
  171.             Print "*** MISMATCH ***"
  172.         End If
  173.     End If
  174.  
  175.  
  176. Function MakeGuess (OrigString As String, arralpha() As LetterBin, wid As Integer, p As Integer)
  177.     Dim TheReturn As Double
  178.     Dim As Integer j, k, n
  179.     TheReturn = 0
  180.     j = 1
  181.     k = 0
  182.     For n = 1 To UBound(arralpha)
  183.         If (Left$(arralpha(n).Signature, wid - 1) = Right$(OrigString, wid - 1)) Then
  184.             If (arralpha(n).Count >= j) Then
  185.                 If (p = 1) Then Print "Order "; _Trim$(Str$(wid)); " guess: "; arralpha(n).Signature; " . "; _Trim$(Str$(arralpha(n).Count))
  186.                 TheReturn = TheReturn + Val(Right$(arralpha(n).Signature, 1))
  187.                 k = k + 1
  188.                 j = arralpha(n).Count
  189.             End If
  190.         End If
  191.     Next
  192.     If (k <> 0) Then
  193.         TheReturn = TheReturn / k
  194.     Else
  195.         TheReturn = .5
  196.     End If
  197.     MakeGuess = TheReturn
  198.  
  199. Sub CreateHisto (arrfinger() As String, arralpha() As LetterBin, w As Integer)
  200.     Dim As Integer j, k, n
  201.     For n = 1 To UBound(arralpha)
  202.         arralpha(n).Count = 0
  203.     Next
  204.     For j = 1 To w
  205.         For k = 1 To Len(arrfinger(j)) - 0 Step w 'make the 0 a -w? might not matter at all
  206.             For n = 1 To UBound(arralpha)
  207.                 If (Mid$(arrfinger(j), k, w) = arralpha(n).Signature) Then
  208.                     arralpha(n).Count = arralpha(n).Count + 1
  209.                 End If
  210.             Next
  211.         Next
  212.     Next
  213.     Call QuickSort(arralpha(), 1, UBound(arralpha))
  214.  
  215. Sub PrintHisto (arr() As LetterBin, w As Integer)
  216.     Dim As Integer j, n
  217.     If (w > 0) Then
  218.         If (w > UBound(arr)) Then
  219.             j = UBound(arr)
  220.         Else
  221.             j = w
  222.         End If
  223.         Print "Un-scaled histogram: "; _Trim$(Str$(UBound(arr))); "-letter regroup, showing top "; _Trim$(Str$(w))
  224.         For n = 1 To j
  225.             Print arr(n).Signature; arr(n).Count
  226.         Next
  227.     End If
  228.  
  229. Function UserInput1 (TheKeyIn As Integer, PresentIndexIn As Integer)
  230.     Dim TheReturn As Integer
  231.     Dim As Integer j, k
  232.     k = TheKeyIn
  233.     j = -1
  234.     Select Case k ' Arrows
  235.         Case 19712
  236.             j = PresentIndexIn + 1
  237.         Case 19200
  238.             j = PresentIndexIn - 1
  239.     End Select
  240.     TheReturn = j
  241.     UserInput1 = TheReturn
  242.  
  243. Function UserInput2$ (TheKeyIn As Integer, TheStringIn As String)
  244.     Dim TheReturn As String
  245.     Dim As Integer k
  246.     Dim As String t
  247.     k = TheKeyIn
  248.     t = TheStringIn
  249.     Select Case k ' 0, 1, Backspace
  250.         Case 48
  251.             t = t + "0"
  252.         Case 49
  253.             t = t + "1"
  254.         Case 8
  255.             t = Left$(t, Len(t) - 1)
  256.     End Select
  257.     TheReturn = t
  258.     UserInput2$ = TheReturn
  259.  
  260. Sub NewAlphabet (arrold() As LetterBin, arrnew() As LetterBin)
  261.     Dim As Integer j, k, n
  262.     n = 0
  263.     For k = 1 To 2
  264.         For j = 1 To UBound(arrold)
  265.             n = n + 1
  266.             arrnew(n).Signature = arrold(j).Signature
  267.         Next
  268.     Next
  269.     For j = 1 To UBound(arrnew)
  270.         If (j <= UBound(arrnew) / 2) Then
  271.             arrnew(j).Signature = "0" + arrnew(j).Signature
  272.         Else
  273.             arrnew(j).Signature = "1" + arrnew(j).Signature
  274.         End If
  275.     Next
  276.  
  277. 'Sub BubbleSort (arr() As LetterBin)
  278. '    Dim As Integer i, j
  279. '    Dim As Integer u, v
  280. '    For j = UBound(arr) To 1 Step -1
  281. '        For i = 2 To UBound(arr)
  282. '            u = arr(i - 1).Count
  283. '            v = arr(i).Count
  284. '            If (u < v) Then
  285. '                Swap arr(i - 1), arr(i)
  286. '            End If
  287. '        Next
  288. '    Next
  289. 'End Sub
  290.  
  291. Sub QuickSort (arr() As LetterBin, LowLimit As Long, HighLimit As Long)
  292.     Dim As Long piv
  293.     If (LowLimit < HighLimit) Then
  294.         piv = Partition(arr(), LowLimit, HighLimit)
  295.         Call QuickSort(arr(), LowLimit, piv - 1)
  296.         Call QuickSort(arr(), piv + 1, HighLimit)
  297.     End If
  298.  
  299. Function Partition (arr() As LetterBin, LowLimit As Long, HighLimit As Long)
  300.     Dim As Long i, j
  301.     Dim As Double pivot, tmp
  302.     pivot = arr(HighLimit).Count
  303.     i = LowLimit - 1
  304.     For j = LowLimit To HighLimit - 1
  305.         tmp = arr(j).Count - pivot
  306.         If (tmp >= 0) Then
  307.             i = i + 1
  308.             Swap arr(i), arr(j)
  309.         End If
  310.     Next
  311.     Swap arr(i + 1), arr(HighLimit)
  312.     Partition = i + 1
  313.  
  314. Sub LoadTestData
  315.     Dim n As Integer
  316.     '''
  317.     n = 0
  318.     '''
  319.     ' Test: counting linearly
  320.     n = n + 1: TestData(n, 1) = "000001010011100101110111": TestData(n, 2) = "0" '0 to 7
  321.     n = n + 1: TestData(n, 1) = "0000000100100011010001010110011110001001101010111100110111101111": TestData(n, 2) = "0" '0 to 15
  322.     n = n + 1: TestData(n, 1) = "0000000001000100001100100001010011000111010000100101010010110110001101011100111110000100011001010011101001010110110101111100011001110101101111100111011111011111": TestData(n, 2) = "0" '0 to 31
  323.     '''
  324.     'n = 0
  325.     '''
  326.     ' Test: single-one patterns at stepping frequencies, all phases
  327.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0"
  328.     n = n + 1: TestData(n, 1) = "01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101": TestData(n, 2) = "0"
  329.     n = n + 1: TestData(n, 1) = "10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010": TestData(n, 2) = "1"
  330.     n = n + 1: TestData(n, 1) = "00100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100": TestData(n, 2) = "1"
  331.     n = n + 1: TestData(n, 1) = "01001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001": TestData(n, 2) = "0"
  332.     n = n + 1: TestData(n, 1) = "10010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010": TestData(n, 2) = "0"
  333.     n = n + 1: TestData(n, 1) = "00010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001": TestData(n, 2) = "0"
  334.     n = n + 1: TestData(n, 1) = "00100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010": TestData(n, 2) = "0"
  335.     n = n + 1: TestData(n, 1) = "01000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100": TestData(n, 2) = "0"
  336.     n = n + 1: TestData(n, 1) = "10001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000": TestData(n, 2) = "1"
  337.     n = n + 1: TestData(n, 1) = "00001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000": TestData(n, 2) = "0"
  338.     n = n + 1: TestData(n, 1) = "00010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000": TestData(n, 2) = "1"
  339.     n = n + 1: TestData(n, 1) = "00100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001": TestData(n, 2) = "0"
  340.     n = n + 1: TestData(n, 1) = "01000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010": TestData(n, 2) = "0"
  341.     n = n + 1: TestData(n, 1) = "10000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100": TestData(n, 2) = "0"
  342.     n = n + 1: TestData(n, 1) = "00000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100": TestData(n, 2) = "0"
  343.     n = n + 1: TestData(n, 1) = "00001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000": TestData(n, 2) = "0"
  344.     n = n + 1: TestData(n, 1) = "00010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000": TestData(n, 2) = "0"
  345.     n = n + 1: TestData(n, 1) = "00100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000": TestData(n, 2) = "1"
  346.     n = n + 1: TestData(n, 1) = "01000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001": TestData(n, 2) = "0"
  347.     n = n + 1: TestData(n, 1) = "10000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010": TestData(n, 2) = "0"
  348.     '''
  349.     'n = 0
  350.     '''
  351.     ' Test: single-one patterns, select phases
  352.     n = n + 1: TestData(n, 1) = "00000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100": TestData(n, 2) = "0"
  353.     n = n + 1: TestData(n, 1) = "00100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000": TestData(n, 2) = "1"
  354.     n = n + 1: TestData(n, 1) = "00000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001": TestData(n, 2) = "0"
  355.     n = n + 1: TestData(n, 1) = "10000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000": TestData(n, 2) = "1"
  356.     '''
  357.     'n = 0
  358.     '''
  359.     ' Test: double-one patterns
  360.     n = n + 1: TestData(n, 1) = "00110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011": TestData(n, 2) = "0"
  361.     n = n + 1: TestData(n, 1) = "01100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110": TestData(n, 2) = "0"
  362.     n = n + 1: TestData(n, 1) = "11001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100": TestData(n, 2) = "1"
  363.     n = n + 1: TestData(n, 1) = "10011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001": TestData(n, 2) = "1"
  364.     n = n + 1: TestData(n, 1) = "00011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100": TestData(n, 2) = "0"
  365.     n = n + 1: TestData(n, 1) = "00111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000": TestData(n, 2) = "1"
  366.     n = n + 1: TestData(n, 1) = "01110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001": TestData(n, 2) = "1"
  367.     n = n + 1: TestData(n, 1) = "11100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011": TestData(n, 2) = "1"
  368.     n = n + 1: TestData(n, 1) = "11000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111": TestData(n, 2) = "0"
  369.     n = n + 1: TestData(n, 1) = "10001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110": TestData(n, 2) = "0"
  370.     '''
  371.     'n = 0
  372.     '''
  373.     ' Test: repeated staggered pattern: 010011000111, all phases
  374.     n = n + 1: TestData(n, 1) = "010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111": TestData(n, 2) = "0"
  375.     n = n + 1: TestData(n, 1) = "100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110": TestData(n, 2) = "1"
  376.     n = n + 1: TestData(n, 1) = "001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101": TestData(n, 2) = "0"
  377.     n = n + 1: TestData(n, 1) = "011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010": TestData(n, 2) = "0"
  378.     n = n + 1: TestData(n, 1) = "110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100": TestData(n, 2) = "1"
  379.     n = n + 1: TestData(n, 1) = "100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001": TestData(n, 2) = "1"
  380.     n = n + 1: TestData(n, 1) = "000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011": TestData(n, 2) = "0"
  381.     n = n + 1: TestData(n, 1) = "001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110": TestData(n, 2) = "0"
  382.     n = n + 1: TestData(n, 1) = "011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100": TestData(n, 2) = "0"
  383.     n = n + 1: TestData(n, 1) = "111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000": TestData(n, 2) = "1"
  384.     n = n + 1: TestData(n, 1) = "110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001": TestData(n, 2) = "1"
  385.     n = n + 1: TestData(n, 1) = "101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011": TestData(n, 2) = "1"
  386.     '''
  387.     'n = 0
  388.     '''
  389.     ' Test: repeated staggered pattern: 0100101010101001010101000111, all phases
  390.     n = n + 1: TestData(n, 1) = "01001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111": TestData(n, 2) = "0"
  391.     n = n + 1: TestData(n, 1) = "10010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110": TestData(n, 2) = "1"
  392.     n = n + 1: TestData(n, 1) = "00101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101": TestData(n, 2) = "0"
  393.     n = n + 1: TestData(n, 1) = "01010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010": TestData(n, 2) = "0"
  394.     n = n + 1: TestData(n, 1) = "10101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100": TestData(n, 2) = "1"
  395.     n = n + 1: TestData(n, 1) = "01010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001": TestData(n, 2) = "0"
  396.     n = n + 1: TestData(n, 1) = "10101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010": TestData(n, 2) = "1"
  397.     n = n + 1: TestData(n, 1) = "01010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101": TestData(n, 2) = "0"
  398.     n = n + 1: TestData(n, 1) = "10101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010": TestData(n, 2) = "1"
  399.     n = n + 1: TestData(n, 1) = "01010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101": TestData(n, 2) = "0"
  400.     n = n + 1: TestData(n, 1) = "10100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010": TestData(n, 2) = "1"
  401.     n = n + 1: TestData(n, 1) = "01001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101": TestData(n, 2) = "0"
  402.     n = n + 1: TestData(n, 1) = "10010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010": TestData(n, 2) = "1"
  403.     n = n + 1: TestData(n, 1) = "00101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101": TestData(n, 2) = "0"
  404.     n = n + 1: TestData(n, 1) = "01010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010": TestData(n, 2) = "0"
  405.     n = n + 1: TestData(n, 1) = "10101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100": TestData(n, 2) = "1"
  406.     n = n + 1: TestData(n, 1) = "01010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001": TestData(n, 2) = "0"
  407.     n = n + 1: TestData(n, 1) = "10101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010": TestData(n, 2) = "1"
  408.     n = n + 1: TestData(n, 1) = "01010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101": TestData(n, 2) = "0"
  409.     n = n + 1: TestData(n, 1) = "10100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010": TestData(n, 2) = "1"
  410.     n = n + 1: TestData(n, 1) = "01000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101": TestData(n, 2) = "0"
  411.     n = n + 1: TestData(n, 1) = "10001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010": TestData(n, 2) = "1"
  412.     n = n + 1: TestData(n, 1) = "00011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101": TestData(n, 2) = "0"
  413.     n = n + 1: TestData(n, 1) = "00111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010": TestData(n, 2) = "0"
  414.     n = n + 1: TestData(n, 1) = "01110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100": TestData(n, 2) = "0"
  415.     n = n + 1: TestData(n, 1) = "11101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000": TestData(n, 2) = "1"
  416.     n = n + 1: TestData(n, 1) = "11010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001": TestData(n, 2) = "1"
  417.     n = n + 1: TestData(n, 1) = "10100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011": TestData(n, 2) = "1"
  418.     '''
  419.     'n = 0
  420.     '''
  421.     ' Test: r1's custom quiz
  422.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '1
  423.     n = n + 1: TestData(n, 1) = "00000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  424.     n = n + 1: TestData(n, 1) = "00000100000101110000001100010001100001001000000000000000001100000000000000000111001000000000000111100000000100111000000000000010000000001111000000000000000000000000000001010000000000000000010000000000000011000111100001000100000000000000000001101000000000000000001000110110000010000100000011001100001101001000000000000000000010000100001100011000101000000010000000000000000000000000000000000001000000000010000000000000001010000010000000000000000000000000000000000010000100000000000000001011010000000000": TestData(n, 2) = "0" '
  425.     n = n + 1: TestData(n, 1) = "00011101100000000001011100001011101000100111101100011000000011001010101000101000111111011000111000100000000000000110110000000001001001110110100001011011101100000011001010001111111110101100001101100001100011000111101100110000000101101101110000001110110111000011000110000000001101111000110000000011111100110001111000011101111101010011111111101111010011011001111101100010001100101101001011000010100111111101111010111111010110001100011000000100010001100111111001101101111000000010110111110000001011010011": TestData(n, 2) = "0" '
  426.     n = n + 1: TestData(n, 1) = "00000000100000000000110000000000000000010000000000000000010000000000000000001000000000000000000000000000000001000000010000000000000000000000000000000000000000000000000000011000000000000000001000000001000000000000000000000000000000000000000001001011001000000000000110000000000000000000000000000000000100010000000000000000000000000000000000001100000000000000000000000000000000100000000000000000001000000000000000000000000000000000000000000000100000000000000000100000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  427.     n = n + 1: TestData(n, 1) = "01111011010110000100001000011001101101000011000011000000000100110010001010000100010000001110111000001000000000101110101100000000100011100101101110000010110101111001011010100000111011100110100001100100111010111110000010000110010000000100111100110000000101010100111001000000101000100101111001001001000010000100110011011010011011101000110011000000101000000100010000101101000101000110000100010101010111100000000001100000110010000001000011100001001000100000011100000101000001010101000100011010000100010011": TestData(n, 2) = "0" '
  428.     n = n + 1: TestData(n, 1) = "11000110011000111000001101000010001000001110001001110010000110000111010001010001100010101100001111100000111100101100000011000111101101110010101101010000101010000001111100000111110101010000000011011100100110101100111101000000100100101000011010000000010110101010011001110011111000010001100110001111111001100010011100010101001100000101010101100000000001001010000011011100010011001000001001110111100110010010000010000111111101100011010101010101000111010110101000000010001001001011011011100101111110110010": TestData(n, 2) = "0" '
  429.     n = n + 1: TestData(n, 1) = "10101101010001010110010110011111011111111101110100010011101110000000100011010000100111111001110110100011011110011101110001110011110000111011011110111011101100000010100111100010000010100111110010100100010001010101111000111010011101010111001110110000101101110001110010011101010110101110001111000101011001001101001011111101110010110101001100110010111101010111010010000010110100010001101110110101101110000101101010001001101101011000111110100000011101110010101111011110111110100110101001111101110001010110": TestData(n, 2) = "1" '
  430.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  431.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000001000000000000000000000000000100000000000000000000000000000000000000000000000100000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000": TestData(n, 2) = "0" '10
  432.     n = n + 1: TestData(n, 1) = "00000110110101110000001100100101000001001111101111100000011000000000001001000100011000000000100011100000100000001001000001000010000000010111001101000001100000010101100011010011111000100111010000000000001010001011101110010100000000000010001011101000010000100000101100110100000011111000000001110000010101010000111111110000000110000100111110011000100000010001010100000000000110000000011000100000000111110011110010000100001010000010011100000000010001101010000000000110010000000110000000110011000000000000": TestData(n, 2) = "0" '
  433.     n = n + 1: TestData(n, 1) = "11011001010011000110101011011010000110001001010001001111100111001011110110111010001111010110010100100101011010110010010100111010111001101011100100001010011111111010011100101101000011011011000111011011010110111100110011100010100001101010110101110101110111010111010010011001110100011010011010101111101110100100100111101101001011100001001100100111010101100100101000111111111001001111100111010110111100001000000111101000111000001101011001001110001000010100110011111001001010101001110111010101111001100001": TestData(n, 2) = "0" '
  434.     n = n + 1: TestData(n, 1) = "00000000000000000000010000000001100000000000000000000001010000000000110010000000000000000000000000000000000000000000000000001100000000000111000101000000000000000000000000000100010001000000000000000000000000000000001100010010000000000000000001100000000000000000000000000001000000000000000000000000000000000010000011000000000000010000000000000001000000001000000000000000000000000000000000000100100000000000100000000000000000000000000000000000100000000000000000000000000000000000000000100000000000000000": TestData(n, 2) = "0" '
  435.     n = n + 1: TestData(n, 1) = "11101000011011010000101000100000010001001000000110011110001011010001001101101010001100111000000101001000011000001010010100010011100110101000101000000000010100111001010100010010101010100011000011000001011010000000010000000001011110110111000010000001011011100000000111001110100000110000000011000101100000001001000100110011000100100000100001001000000011010010100000000100100000101001100000110001001001110101010001000000011000000010101000110010000100001011000001101000101010011011001110010110000010000000": TestData(n, 2) = "0" '
  436.     n = n + 1: TestData(n, 1) = "00000010100110101001001000100000010100100100101101010010000001001100000000001011001110011011000010000111111001100010110011000010100110110000000000011010011010010100100011011011001100110001101001110000101001001100100010001101001000001011111100011011100000011001001010111000000000111101111001111001111111101000000000101100011001001011011010010000100001100010011110010000001011000001010111010010011111001001001110111100110010000110100111101000000101110100101010001111001111101100010101001001010101000101": TestData(n, 2) = "0" '
  437.     n = n + 1: TestData(n, 1) = "00111100000000000111001001100000111010010010010011100010001100001100000011011000100010000101110010110100110110011100010001111110011011000110010000001001101111111000011000010001101110011101111010100110100110000111011101001111110011011111100110111000001101101110001001001000011110100110000111110111010000001100100100100111110110100001001011100110111000100011110100100100110010011110011011100011101111010010000110000011101100000111001011000110000010001101111011111011001100000010000101000000000000101110": TestData(n, 2) = "0" '
  438.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  439.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000100000000000000000000000010000000000000001000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000": TestData(n, 2) = "0" '
  440.     n = n + 1: TestData(n, 1) = "00000000010111101100110000001011000001001011001100000001001100001001000001001100010000111111000011100001000000001111010010000100001000000010001101001011101011011010000101010011110110110001100001000010000010100011000000110001000000011101110001000000000000110000100000101100000001011010000101000000100100011000111111110010110101010100011110100110110000010001101000000000101001000010100110000100010100111000010010100100001000110000000100010100010000000010000100011100010010110100010000010010001001000010": TestData(n, 2) = "0" '
  441.     n = n + 1: TestData(n, 1) = "11111111011001010010001100000100110110101110100011010010111011110100101000100000000101100000000100110010111110111000110101101010111111011101101010011111100100110100010011011001100000001110111110000101000000001100110101011110011111101100001110011101111100111100011100010010110111100001010000010001101001001111000000000101001000100100000110011000101011100100000100111011010110100000010001011010101011010010100111011000100011001000001010001011101010000100001011001011100001001011101110100110110010111100": TestData(n, 2) = "1" '20
  442.     n = n + 1: TestData(n, 1) = "00000000000000000000000000010000000000000000000000000000000100000000100000000000000000000011100000000000000000000000000001000000000000000000000000000011001000000000000100000000000000000000000000010010000000000000000000000000000000000000000000000000000000000000000000000000000010001000000000000000000000000000000000000010000000000000000000000010000000000000000000000000000000000000000000000001001000000000011100000000000000001000000000000000000100000000100010000110100000000000000000000000000000000000": TestData(n, 2) = "0" '
  443.     n = n + 1: TestData(n, 1) = "01011000100010001000011010000010010010000100100101000100011001000010000010110110010110001100010001000010110110000011010100000100100010010011111101111100110010101100000001000000100111010000010000100000000111100110000101110001100100000001000001001100100100010000001001000110000000000100011100110110000101100011100010110100000011001001011000010001001000101010010010000001000000100101100101001110110010010000100010100010000000100111001100000000001000111111010100001000001010000010101010110101101000001100": TestData(n, 2) = "0" '
  444.     n = n + 1: TestData(n, 1) = "00000101000010010110000110001101111110010001110010000010101001111111010000011011100000110000010101101110101111110101001100000100000000100110001000000000000001110011101011011110000001000110101001000000000000010100010010110110000010001100100010011001010011111011001110110000110100010010000010010110011000010110110010101000111000000100000001101100100110010100110111001110110101010001101100000000110010100010000001000101011100000000000111101110101011001011001100100000001101110000001001101010000000111011": TestData(n, 2) = "0" '
  445.     n = n + 1: TestData(n, 1) = "10100010000111100111110001101101100001100111001010011110011001101110100111000111001010100111100010110010101010100100100000101010111100100000010111001000101110010010111000001100011011001011010100101101101110001001111100110000001011100000010110011010001000001101101111001000011101001000110010110111100011111011001100011110100110100111001110000101010001010001101001101001011001111010011001101010000001111010110011100001010100011100110100011011110011100101000001110010010111100111110011001110011111001010": TestData(n, 2) = "1" '
  446.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  447.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000100000000000001100000000000000000000000000000000000000000010000000000000000000000000000000001000000000000000000000000000000000001000000000000100000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  448.     n = n + 1: TestData(n, 1) = "00100000011101101100000000000000000000001010001010001010010000000011101000010100001000000110000110100000000010001000111100100100001010110000011000001010110100110011000010001000110101001001100001011000001000000000000010110000100000110000001001000000100000110100100100100001010011000000010101010010100101000000001011100010000000001100000110100010100010000001110000000100000001110010100100001110000001100110000100001000001000000000010000001000001000000001001100000000010011110100000000001010100001111111": TestData(n, 2) = "0" '
  449.     n = n + 1: TestData(n, 1) = "01010110100011101001111011101011111111101001100000010100001001111110010111100011101100011111110001101101111000110011010011010011110000101111110110010001000001010100100100110011010010010110101011100000111111111101111110110011111101010011110000111101000010010011010000011100001000011011000011001101100011011101000101010101111011000100001111010100111001011100011100011011011000000010011010010100110010011001111011010010110011111000101110010111111100100100111110111010101001101011010100000001011010010000": TestData(n, 2) = "1" '
  450.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000000000000000000000000001000000000000000000000000000000000000000010000000000000010010100000000000001000000000001000100000000000000000000001000000000000000000000000000000010000000010000000000000000000000001000000010000000000000000000000000000000000000000010000000110000000000000000000000001000000000010000100000000000000000100000001000000010000000000000000000000010000000000000000001000000000000000": TestData(n, 2) = "0" '
  451.     n = n + 1: TestData(n, 1) = "00000001100010111010101010001001000011001100000000000000010011000111001101001010110010010010010100101010000001001000111000000010110000010001001110100000000101101001110100010100000101000100000101000000010000110000010011010000100101001111000000011110001000001101101100000001000101000000011001011001110111100010010001000011110011110010010001000001110100100010101001110000010100000010010100000000101001000100101000011000000001001010111010110100000011001100101010000000100100100111111001110101000100000001": TestData(n, 2) = "0" '30
  452.     n = n + 1: TestData(n, 1) = "11010010010101000010000011010000101110111010011001101000101111011101001110000001011110100101101111000100000010110001010101000110100001100000111000111100011110110011101101101111101010100100011101000000010010101110000011011100010010101110101010000001110001001111110011011101000010110000101111000000101100011100101100001001100001111110000101110000010010000001001010000000011011000001000101000100000111101100110011000111010000001000010000000000100101010001100001011000001010001000111111110110101000011111": TestData(n, 2) = "0" '
  453.     n = n + 1: TestData(n, 1) = "11011111000111100000010011111111101111001100100010111010010000011000110100111010011000111101000111010000110110101010011010101011100110011101000001011011111110011100110100001001010000001000010010100101111011000101001000000011110011110001100100100011011001010000101101111110101011011100000111000111000011110101111011101000101010000111011110000111111101011101110110001000011000111011011011111100110000001011011010110101101111011001011000111100101100111010011100110111101100110110100110000010011111110101": TestData(n, 2) = "0" '
  454.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  455.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  456.     n = n + 1: TestData(n, 1) = "00100000000000000011000000000000000000000110000010011111100000000000000001000000001000000000000000010110000110000001100010000000000011110000000001100000000000110011000011000000010000001110000000011000001000010000110100000010000000111101000000000000000000100000000001100000100011000000000100000000000101000000000011010000001100010100000110110010100001010000110000001000000001100000110000001100000000011010000000000000101001100000000000000000100000011010100000000010010000100100010000000000000001111000": TestData(n, 2) = "0" '
  457.     n = n + 1: TestData(n, 1) = "00010100011101010101100000101000001100111001101101000000011001111001100110110111010111111011110001100000000001100000011001111000111001000110011010001110100110011001110111100000101000110001100110100111000111001000001001110101101110000000110000000000011001010101000110011101011001100011001001011001101100011110000101101001100011001010011000001100110000101000001111110110000000001100001100010010101111100101001101010000000110011011111100011111010000000101000000100101100111010110001101111010101010000110": TestData(n, 2) = "1" '
  458.     n = n + 1: TestData(n, 1) = "00000010000000000001100000000000000001000000000000000000000000000000000000000000000001001000000000000000000100000000000000000000010000000000000000100100000101000001000000100001100000000000000000000000000010110000000000000000100001000000000000001000000001100010000000010000010000000000000110000000001000000000001000010000000000010000000000000000000000000000000000000100001000000000000100001000000000000000000100000000000100000000000000000000000001001000000000000000000001000010000000000010000011000000": TestData(n, 2) = "0" '
  459.     n = n + 1: TestData(n, 1) = "11010000111110000000000011000001011000010011010100100000000000110011011101010010100100000000000000010001101001000001001010011000100101101000111011000001000010010000010000010100001000100110100001100100001001001001100011110010011000110111000011000000011000000000100110001000101101100000001000000000000100000000000001001110001110100000010100001011101010110100001001001000000010010100001010100111011111000100001010000011010001000011001101110001101110000011010101101001010100110100010001011100110100110111": TestData(n, 2) = "1" '
  460.     n = n + 1: TestData(n, 1) = "00000000110110001000000011001000100000001110011010100010101101111100101100101000001010000000101101010100101011010000010001001110001001100001110101011010111010000100001011001010010100011001011000010000100001000000000100001111001000101011111110100001110010011000100001101000101001101011110001011111000110111010010101000001001011101101110000001011110000011001100011111001010100010101110011000100110000101101010010110000000000010011001001101101000010000010001110000011111100111101100100110000001000110000": TestData(n, 2) = "0" '
  461.     n = n + 1: TestData(n, 1) = "00101101111001100011001000011101001000000001100000101001000010110101000011001101110010110011000010101100111010101111100101100111000010110111010100000000001010000111111011001000111011100100011111101010010101011111111010010110010001101010100101010110111010111000101111001101001101101111010101010010110001000110110110101000010100001000010011101010011110001000001111001100110001011010100011101011100000100000111001000111001010101111010010010100110111001000100011010110100011111011101001101010111101101010": TestData(n, 2) = "0" '40
  462.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  463.     n = n + 1: TestData(n, 1) = "10000000100000000000000001001001000000100011010001010100000100000000010101100110101000000000000100000101010000000101000000000101100000000000010000001000001011000110100110100010010100010111000100000100001010000000101010001000111001000000010000100100000000000000100000001001000000110001010001001010010000000010101001000111011000100100100000010010000100100000000000001000010010000110010110000110100000000000101001010100000110010001110000111000000110000000000000000000000100101100001010000100000101100010": TestData(n, 2) = "0" '
  464.     n = n + 1: TestData(n, 1) = "00001101011011101101111110010000011011010000101110101011001001111000101010010001010111100001110011011010100011011010101010111010001010100110101100000110110100101001011001010000001010100000111010111011100100110111010101010100000010000010101110001011010011001111011110110000110010001010001000110100101111101100000110111000000000000010001111101001011011010111110110000100101000111000101001110001010011110100010100100011110000001100001011000100100000011110111111100011000011000011100101111010111010010101": TestData(n, 2) = "1" '
  465.     n = n + 1: TestData(n, 1) = "01110011000100111110101110110110101110011100101000000011111010011111101010001000000000111110011010111010001110111000111111010010011101111101100111110001000000011000001000001101101001001000010001011000010001111100010001100111000100111111100011010001101101110110000001010110001111000100101110010001101101010001010110110000100111011001010100101101110000001111001111110111100101101001001001111001011111111011000010101001001001101010001111000011011001111111001011111101111001010010110000100001010000011000": TestData(n, 2) = "0" '
You're not done when it works, you're done when it's right.

Offline random1

  • Newbie
  • Posts: 86
Re: Looking for old program or help recreating it
« Reply #49 on: December 12, 2021, 09:42:46 pm »
Sounds good, I am making a few changes to your code so that it's more compatible with my
programs existing code.  Once it's in the loop so to say I can automate the testing process 
and use all 800+ strings.  Should be interesting. 

R1             
 

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
Re: Looking for old program or help recreating it
« Reply #50 on: December 12, 2021, 10:44:39 pm »
Hey r1 - without wearing the subject out, I'll forewarn that I am still streamlining the code. Today I realized I had a few variables of the wrong type, which was actually making the guesses too crude. Very hard to notice this, but it was true. Anyway, i'll try to find a sensible place to post the latest code so you always get the best. Good luck in the meantime!
You're not done when it works, you're done when it's right.

Offline random1

  • Newbie
  • Posts: 86
Re: Looking for old program or help recreating it
« Reply #51 on: December 13, 2021, 02:49:32 pm »
Glad to see I'm not the only one. For me it's mixing variable types, one works for this
but need another for that.  I started storing the product as a string$ then use val($)
in my final calculations.  Maybe not the most efficient method but it helps keep things
straight.  I have a old function I picked up years ago called StrNum$.  Don't remember
the original author.

Code: QB64: [Select]
  1. FUNCTION StrNum$ (n#)
  2. value$ = UCASE$(LTRIM$(STR$(n#)))
  3. XPOS1% = INSTR(value$, "D") + INSTR(value$, "E") 'only D or E can be present
  4. IF XPOS1% THEN
  5. expo% = VAL(MID$(value$, XPOS1% + 1))
  6. IF VAL(value$) < 0 THEN
  7. sign$ = "-": value$ = MID$(value$, 2, XPOS1% - 2)
  8. ELSE value$ = MID$(value$, 1, XPOS1% - 1)
  9. dot% = INSTR(value$, "."): L% = LEN(value$)
  10. IF expo% > 0 THEN ADD$ = STRING$(expo% - (L% - dot%), "0")
  11. IF expo% < 0 THEN min$ = STRING$(ABS(expo%) - (dot% - 1), "0"): DP$ = "."
  12. FOR n = 1 TO L%
  13. IF MID$(value$, n, 1) <> "." THEN num$ = num$ + MID$(value$, n, 1)
  14. ELSE STRNUM$ = value$: EXIT FUNCTION
  15. STRNUM$ = sign$ + DP$ + min$ + num$ + ADD$

Offline random1

  • Newbie
  • Posts: 86
Re: Looking for old program or help recreating it
« Reply #52 on: December 13, 2021, 03:38:47 pm »
P.S.
While your streamlining your code, if you could change it so that it processes a single string, makes
it's prediction then passes that value on, it would be much easier to add to my code.  There is quite
a bit of processing going on before and after each prediction is made.   My program is designed to
cook the data so to say, hand that data to the predictor then take the predicted value and move on. 

I am in the process of editing your code so that it works well with my code.  If there is going to be
several versions / updates then I think you can see the advantages.  I have at least 10 old predictors
that I can add or remove from the main program by simply using copy and paste.  I keep my old
prediction tools thinking some day I might be able to improve them.

R1       


   

Offline random1

  • Newbie
  • Posts: 86
Re: Looking for old program or help recreating it
« Reply #53 on: December 13, 2021, 05:26:33 pm »
I attached another string file.  These strings, show the same data in a different format.

If the string value repeated, ie, the same value (0) or (1) carried over from the previous
event then the value is (1), if not then (0).  This list contains 112 strings 500 values in
length.  The strings flow is right to left.  The strings with  "****"  indicate events that
have been culled from the list but kept in place for later use.

At the bottom of the file is a small set of stats that that show the number of times each
value repeated within each string and the repeat probability.   

This data could be a bit easier to predict, my code is already capable of generating the
data and make all the needed conversions.

R1

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
Re: Looking for old program or help recreating it
« Reply #54 on: December 13, 2021, 08:54:02 pm »
Hey r1,

So a few updates...

(Part I) I made my prediction function into more of a black box so it can be used in isolation. Of course, it still needs to the "alphabet" arrays

Code: QB64: [Select]
  1. Dim Shared Alphabet1(2) As LetterBin ' 0 1
  2. Dim Shared Alphabet2(4) As LetterBin ' 00 01 10 11
  3. Dim Shared Alphabet3(8) As LetterBin ' 000 001 010 011 100 101 110 111
  4. Dim Shared Alphabet4(16) As LetterBin ' etc.
  5.  

defined and filled in order to work. In practice that full chunk of code would go in the BI section, and then all one needs to do is use one line:

Code: QB64: [Select]
  1. prediction = Analyze(thestring, actual, 1)

Pretty simple, the answer "prediction" is a 1 or a 0, the "Analyze" function takes three arguments:
(a) the string to analyze, i.e. "1001101001010101"
(b) the known next digit, if it exists. otherwise, this argument must be a "?"
(c) an optional flag for printing, just set this to zero

...so that should help....

Part (II) is more intersting...

So I looked at the file you provided, and then read what you said about it, and then had to write another program to wrestle your data into a form that my program already uses. Reading a string left-to-right is a little more natural to me, so I reversed all your strings. I also (as kindof a checksum) made sure I could re-derive all of the decimal values you included at the bottom. I unambiguously know exactly where those come from. Inspired by this, I edited my analysis function to calculate those same numbers (for any input string, not just the new ones).

The new results are only mildly interesting, and hardly surprising. Punchline is, using that decimal is a rather crummy way to estimate what number comes next. Case in point would be something like:

0101010101010101010101
versus
1010101010101010101010

Those two strings differ by just a phase but would produce identical decimals. All the reason why an n-gram based approach is much more revealing. But anyway, I ramble. This program is pre-set to analyze your newest data:

Code: QB64: [Select]
  1.  
  2. Screen _NewImage(120, 60)
  3.  
  4. ' Version: 7
  5.  
  6. Type LetterBin
  7.     Signature As String
  8.     Count As Integer
  9.  
  10. Dim Shared TestData(1000, 2) As String
  11. Call LoadTestData
  12.  
  13. Dim Shared Alphabet1(2) As LetterBin ' 0 1
  14. Dim Shared Alphabet2(4) As LetterBin ' 00 01 10 11
  15. Dim Shared Alphabet3(8) As LetterBin ' 000 001 010 011 100 101 110 111
  16. Dim Shared Alphabet4(16) As LetterBin ' etc.
  17. Dim Shared Alphabet5(32) As LetterBin
  18. Dim Shared Alphabet6(64) As LetterBin
  19. Dim Shared Alphabet7(128) As LetterBin
  20. Dim Shared Alphabet8(256) As LetterBin
  21. Dim Shared Alphabet9(512) As LetterBin
  22. Dim Shared Alphabet10(1024) As LetterBin
  23. Dim Shared Alphabet11(2048) As LetterBin
  24. Dim Shared Alphabet12(4096) As LetterBin
  25. Dim Shared Alphabet13(8192) As LetterBin
  26.  
  27. Alphabet1(1).Signature = "0"
  28. Alphabet1(2).Signature = "1"
  29. Call NewAlphabet(Alphabet1(), Alphabet2())
  30. Call NewAlphabet(Alphabet2(), Alphabet3())
  31. Call NewAlphabet(Alphabet3(), Alphabet4())
  32. Call NewAlphabet(Alphabet4(), Alphabet5())
  33. Call NewAlphabet(Alphabet5(), Alphabet6())
  34. Call NewAlphabet(Alphabet6(), Alphabet7())
  35. Call NewAlphabet(Alphabet7(), Alphabet8())
  36. Call NewAlphabet(Alphabet8(), Alphabet9())
  37. Call NewAlphabet(Alphabet9(), Alphabet10())
  38. Call NewAlphabet(Alphabet10(), Alphabet11())
  39. Call NewAlphabet(Alphabet11(), Alphabet12())
  40. Call NewAlphabet(Alphabet12(), Alphabet13())
  41.  
  42. Dim thestring As String
  43. Dim actual As String
  44. Dim prediction As Integer
  45.  
  46. m = 1
  47. thestring = ""
  48.  
  49.     ' If analyzing pre-cooked data, load a test string.
  50.     If (m > 0) Then
  51.         thestring = TestData(m, 1)
  52.         actual = TestData(m, 2)
  53.     Else
  54.         actual = "?"
  55.     End If
  56.  
  57.     Cls
  58.     For k = 1 To _Width
  59.         Print "-";
  60.     Next
  61.     Print
  62.     Print "Case:"; m
  63.     Print
  64.     prediction = Analyze(thestring, actual, 1)
  65.     'Print "("; prediction; ")"
  66.  
  67.  
  68.     If (m > 0) Then
  69.         m = UserInput1(k, m)
  70.     Else
  71.         thestring = UserInput2$(k, thestring)
  72.     End If
  73.  
  74.     '_Delay 1
  75.     'm = m + 1
  76.  
  77.     _KeyClear
  78.     _Limit 30
  79.  
  80.  
  81. Function Analyze (TheStringIn As String, ActualIn As String, pswitch As Integer)
  82.     Dim TheReturn As Integer
  83.     Dim As Integer n
  84.     Dim As Double r, j, k, h
  85.     Dim Fingerprint(16) As String
  86.     Dim p(2 To 13, 2) As Double
  87.  
  88.     ' Create shifted versions of string, i.e. ABCD -> BCDA, CDAB, DABC, ABCD, BCDA, etc.
  89.     Fingerprint(1) = TheStringIn
  90.     For n = 2 To UBound(Fingerprint)
  91.         Fingerprint(n) = Right$(Fingerprint(n - 1), Len(Fingerprint(n - 1)) - 1) + Left$(Fingerprint(n - 1), 1)
  92.     Next
  93.  
  94.     ' Initialize partial results.
  95.     For n = LBound(p) To UBound(p)
  96.         p(n, 1) = -999
  97.     Next
  98.  
  99.     Call CreateHisto(Fingerprint(), Alphabet2(), 2, 0) ' Set the last number =1 to print steps.
  100.     Call CreateHisto(Fingerprint(), Alphabet3(), 3, 0)
  101.     Call CreateHisto(Fingerprint(), Alphabet4(), 4, 0)
  102.     Call CreateHisto(Fingerprint(), Alphabet5(), 5, 0)
  103.     Call CreateHisto(Fingerprint(), Alphabet6(), 6, 0)
  104.     Call CreateHisto(Fingerprint(), Alphabet7(), 7, 0)
  105.     Call CreateHisto(Fingerprint(), Alphabet8(), 8, 0)
  106.     Call CreateHisto(Fingerprint(), Alphabet9(), 9, 0)
  107.     Call CreateHisto(Fingerprint(), Alphabet10(), 10, 0)
  108.     Call CreateHisto(Fingerprint(), Alphabet11(), 11, 0)
  109.     Call CreateHisto(Fingerprint(), Alphabet12(), 12, 0)
  110.     Call CreateHisto(Fingerprint(), Alphabet13(), 13, 0)
  111.  
  112.     If (pswitch = 1) Then
  113.         If (Len(TheStringIn) >= 2) Then Call PrintHisto(Alphabet2(), 3) ' Set the last number >=1 to print stats for that histogram.
  114.         If (Len(TheStringIn) >= 3) Then Call PrintHisto(Alphabet3(), 3)
  115.         If (Len(TheStringIn) >= 4) Then Call PrintHisto(Alphabet4(), 3)
  116.         If (Len(TheStringIn) >= 5) Then Call PrintHisto(Alphabet5(), 3)
  117.         If (Len(TheStringIn) >= 6) Then Call PrintHisto(Alphabet6(), 0)
  118.         If (Len(TheStringIn) >= 7) Then Call PrintHisto(Alphabet7(), 0)
  119.         If (Len(TheStringIn) >= 8) Then Call PrintHisto(Alphabet8(), 0)
  120.         If (Len(TheStringIn) >= 9) Then Call PrintHisto(Alphabet9(), 0)
  121.         If (Len(TheStringIn) >= 10) Then Call PrintHisto(Alphabet10(), 0)
  122.         If (Len(TheStringIn) >= 11) Then Call PrintHisto(Alphabet11(), 0)
  123.         If (Len(TheStringIn) >= 12) Then Call PrintHisto(Alphabet12(), 0)
  124.         If (Len(TheStringIn) >= 13) Then Call PrintHisto(Alphabet13(), 0)
  125.         Print
  126.     End If
  127.  
  128.     If (Len(TheStringIn) >= 2) Then Call MakeGuess(TheStringIn, Alphabet2(), 2, p(), pswitch) ' Set the last number =1 to print guess for that histogram.
  129.     If (Len(TheStringIn) >= 3) Then Call MakeGuess(TheStringIn, Alphabet3(), 3, p(), pswitch)
  130.     If (Len(TheStringIn) >= 4) Then Call MakeGuess(TheStringIn, Alphabet4(), 4, p(), pswitch)
  131.     If (Len(TheStringIn) >= 5) Then Call MakeGuess(TheStringIn, Alphabet5(), 5, p(), pswitch)
  132.     If (Len(TheStringIn) >= 6) Then Call MakeGuess(TheStringIn, Alphabet6(), 6, p(), pswitch)
  133.     If (Len(TheStringIn) >= 7) Then Call MakeGuess(TheStringIn, Alphabet7(), 7, p(), pswitch)
  134.     If (Len(TheStringIn) >= 8) Then Call MakeGuess(TheStringIn, Alphabet8(), 8, p(), pswitch)
  135.     If (Len(TheStringIn) >= 9) Then Call MakeGuess(TheStringIn, Alphabet9(), 9, p(), pswitch)
  136.     If (Len(TheStringIn) >= 10) Then Call MakeGuess(TheStringIn, Alphabet10(), 10, p(), pswitch)
  137.     If (Len(TheStringIn) >= 11) Then Call MakeGuess(TheStringIn, Alphabet11(), 11, p(), pswitch)
  138.     If (Len(TheStringIn) >= 12) Then Call MakeGuess(TheStringIn, Alphabet12(), 12, p(), pswitch)
  139.     If (Len(TheStringIn) >= 13) Then Call MakeGuess(TheStringIn, Alphabet13(), 13, p(), pswitch)
  140.     If (pswitch = 1) Then Print
  141.  
  142.     If (pswitch = 1) Then
  143.         Print "Analyzing:"
  144.         Print TheStringIn
  145.         Print
  146.         Print "Thinking:";
  147.         For k = LBound(p) To UBound(p)
  148.             If (p(k, 1) <> -999) Then
  149.                 Print p(k, 1);
  150.             Else
  151.                 Print "_ ";
  152.             End If
  153.         Next
  154.         Print: Print
  155.     End If
  156.  
  157.     j = 0
  158.     r = 0
  159.  
  160.     For k = UBound(p) To LBound(p) Step -1
  161.         If (p(k, 1) <> -999) Then
  162.  
  163.             ' This is the made-up part of the model:
  164.             ' The variable r contributes to weighted average.
  165.             ' The variable j is used for normalization.
  166.             ' Scaling factor h influences weighted average calculaton.
  167.             ' The factors multiplying h are totally arbitrary. Notes:
  168.             '   setting o(h^2) means the later alphabets count for more.
  169.             '   p(k, 1) euqals the calculated guess at frequency k.
  170.             '   p(k, 2) euqals the peak count of the unscaled histogram.
  171.             '   ...while p(k, 2) is here, it does not seem to help calculations.
  172.  
  173.             h = 1 + k - LBound(p)
  174.  
  175.             h = h ^ 2
  176.  
  177.             ' Standard weighted average:
  178.             r = r + h * p(k, 1)
  179.             j = j + h
  180.  
  181.         End If
  182.     Next
  183.     If (j <> 0) Then
  184.         r = r / j
  185.     End If
  186.  
  187.     If (pswitch = 1) Then Print "Predicting:  "; _Trim$(Str$(r))
  188.  
  189.     If (r > .5) Then
  190.         r = 1
  191.     Else
  192.         r = 0
  193.     End If
  194.  
  195.     If (pswitch = 1) Then
  196.         Print "Rounding to: "; _Trim$(Str$(r))
  197.         If (ActualIn <> "?") Then
  198.             Print
  199.             Print "Actual:      "; ActualIn
  200.             If (_Trim$(Str$(r)) <> ActualIn) Then
  201.                 Beep
  202.                 Print
  203.                 Print "*** MISMATCH ***"
  204.             End If
  205.         Else
  206.             n = Len(TheStringIn)
  207.             h = 0
  208.             For k = 1 To n
  209.                 If Val(Mid$(TheStringIn, k, 1)) = 1 Then h = h + 1
  210.             Next
  211.             h = h / n
  212.             Print
  213.             Print "Naive (dec): "; _Trim$(Str$(h))
  214.             If (h > .5) Then
  215.                 h = 1
  216.             Else
  217.                 h = 0
  218.             End If
  219.             Print "Naive (int): "; _Trim$(Str$(h))
  220.             If (r <> h) Then
  221.                 Beep
  222.                 Print
  223.                 Print "*** MISMATCH ***"
  224.             End If
  225.         End If
  226.     End If
  227.  
  228.     TheReturn = r
  229.     Analyze = TheReturn
  230.  
  231. Sub MakeGuess (OrigString As String, arralpha() As LetterBin, wid As Integer, arrbeta() As Double, pswitch As Integer)
  232.     Dim TheReturn As Double
  233.     Dim As Integer j, k, n
  234.     TheReturn = 0
  235.     j = 1 '0
  236.     k = 0
  237.     For n = 1 To UBound(arralpha)
  238.         If (Left$(arralpha(n).Signature, wid - 1) = Right$(OrigString, wid - 1)) Then
  239.             If (arralpha(n).Count >= j) Then
  240.                 If (pswitch = 1) Then Print "Order-"; Right$("0" + _Trim$(Str$(wid)), 2); " guess: "; arralpha(n).Signature; " . "; _Trim$(Str$(arralpha(n).Count))
  241.                 TheReturn = TheReturn + Val(Right$(arralpha(n).Signature, 1))
  242.                 k = k + 1
  243.                 j = arralpha(n).Count
  244.             End If
  245.         End If
  246.     Next
  247.     If (k <> 0) Then
  248.         TheReturn = TheReturn / k
  249.         arrbeta(wid, 1) = TheReturn
  250.         arrbeta(wid, 2) = j
  251.     Else
  252.         TheReturn = .5
  253.         arrbeta(wid, 1) = TheReturn
  254.         arrbeta(wid, 2) = j
  255.     End If
  256.  
  257. Sub CreateHisto (arrfinger() As String, arralpha() As LetterBin, w As Integer, pswitch As Integer)
  258.     Dim As Integer j, k, n
  259.     For n = 1 To UBound(arralpha)
  260.         arralpha(n).Count = 0
  261.     Next
  262.     For j = 1 To w '1 'w
  263.         For k = 1 To Len(arrfinger(j)) - (Len(arrfinger(j)) Mod w) Step w '- 0 Step 1 'w 'make the 0 a -w? might not matter at all
  264.             If (pswitch = 1) Then Print j; " "; arrfinger(j)
  265.             For n = 1 To UBound(arralpha)
  266.                 If (pswitch = 1) Then
  267.                     Print "@@@"; n; " "; Mid$(arrfinger(j), k, w); " "; arralpha(n).Signature;
  268.                 End If
  269.                 If (Mid$(arrfinger(j), k, w) = arralpha(n).Signature) Then
  270.                     arralpha(n).Count = arralpha(n).Count + 1
  271.                     If (pswitch = 1) Then Print "***";
  272.                 End If
  273.                 If pswitch = 1 Then Print
  274.             Next
  275.         Next
  276.     Next
  277.     Call QuickSort(arralpha(), 1, UBound(arralpha))
  278.  
  279. Sub PrintHisto (arr() As LetterBin, w As Integer)
  280.     Dim As Integer j, n
  281.     If (w > 0) Then
  282.         If (w > UBound(arr)) Then
  283.             j = UBound(arr)
  284.         Else
  285.             j = w
  286.         End If
  287.         Print "Histogram: "; _Trim$(Str$(UBound(arr))); "-letter regroup, showing top "; _Trim$(Str$(w))
  288.         For n = 1 To j
  289.             Print arr(n).Signature; arr(n).Count
  290.         Next
  291.     End If
  292.  
  293. Function UserInput1 (TheKeyIn As Integer, PresentIndexIn As Integer)
  294.     Dim TheReturn As Integer
  295.     Dim As Integer j, k
  296.     k = TheKeyIn
  297.     j = -1
  298.     Select Case k ' Arrows
  299.         Case 19712
  300.             j = PresentIndexIn + 1
  301.         Case 19200
  302.             j = PresentIndexIn - 1
  303.     End Select
  304.     TheReturn = j
  305.     UserInput1 = TheReturn
  306.  
  307. Function UserInput2$ (TheKeyIn As Integer, TheStringIn As String)
  308.     Dim TheReturn As String
  309.     Dim As Integer k
  310.     Dim As String t
  311.     k = TheKeyIn
  312.     t = TheStringIn
  313.     Select Case k ' 0, 1, Backspace
  314.         Case 48
  315.             t = t + "0"
  316.         Case 49
  317.             t = t + "1"
  318.         Case 8
  319.             t = Left$(t, Len(t) - 1)
  320.     End Select
  321.     TheReturn = t
  322.     UserInput2$ = TheReturn
  323.  
  324. Sub NewAlphabet (arrold() As LetterBin, arrnew() As LetterBin)
  325.     Dim As Integer j, k, n
  326.     n = 0
  327.     For k = 1 To 2
  328.         For j = 1 To UBound(arrold)
  329.             n = n + 1
  330.             arrnew(n).Signature = arrold(j).Signature
  331.         Next
  332.     Next
  333.     For j = 1 To UBound(arrnew)
  334.         If (j <= UBound(arrnew) / 2) Then
  335.             arrnew(j).Signature = "0" + arrnew(j).Signature
  336.         Else
  337.             arrnew(j).Signature = "1" + arrnew(j).Signature
  338.         End If
  339.     Next
  340.  
  341. Sub QuickSort (arr() As LetterBin, LowLimit As Long, HighLimit As Long)
  342.     Dim As Long piv
  343.     If (LowLimit < HighLimit) Then
  344.         piv = Partition(arr(), LowLimit, HighLimit)
  345.         Call QuickSort(arr(), LowLimit, piv - 1)
  346.         Call QuickSort(arr(), piv + 1, HighLimit)
  347.     End If
  348.  
  349. Function Partition (arr() As LetterBin, LowLimit As Long, HighLimit As Long)
  350.     Dim As Long i, j
  351.     Dim As Double pivot, tmp
  352.     pivot = arr(HighLimit).Count
  353.     i = LowLimit - 1
  354.     For j = LowLimit To HighLimit - 1
  355.         tmp = arr(j).Count - pivot
  356.         If (tmp >= 0) Then
  357.             i = i + 1
  358.             Swap arr(i), arr(j)
  359.         End If
  360.     Next
  361.     Swap arr(i + 1), arr(HighLimit)
  362.     Partition = i + 1
  363.  
  364. Sub LoadTestData
  365.     Dim n As Integer
  366.     '''
  367.     n = 0
  368.     '''
  369.     ' Test: counting linearly
  370.     n = n + 1: TestData(n, 1) = "000001010011100101110111": TestData(n, 2) = "0" '0 to 7
  371.     n = n + 1: TestData(n, 1) = "0000000100100011010001010110011110001001101010111100110111101111": TestData(n, 2) = "0" '0 to 15
  372.     n = n + 1: TestData(n, 1) = "0000000001000100001100100001010011000111010000100101010010110110001101011100111110000100011001010011101001010110110101111100011001110101101111100111011111011111": TestData(n, 2) = "0" '0 to 31
  373.     '''
  374.     'n = 0
  375.     '''
  376.     ' Test: single-one patterns at stepping frequencies, all phases
  377.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0"
  378.     n = n + 1: TestData(n, 1) = "01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101": TestData(n, 2) = "0"
  379.     n = n + 1: TestData(n, 1) = "10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010": TestData(n, 2) = "1"
  380.     n = n + 1: TestData(n, 1) = "00100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100": TestData(n, 2) = "1"
  381.     n = n + 1: TestData(n, 1) = "01001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001": TestData(n, 2) = "0"
  382.     n = n + 1: TestData(n, 1) = "10010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010": TestData(n, 2) = "0"
  383.     n = n + 1: TestData(n, 1) = "00010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001": TestData(n, 2) = "0"
  384.     n = n + 1: TestData(n, 1) = "00100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010": TestData(n, 2) = "0"
  385.     n = n + 1: TestData(n, 1) = "01000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100": TestData(n, 2) = "0"
  386.     n = n + 1: TestData(n, 1) = "10001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000": TestData(n, 2) = "1"
  387.     n = n + 1: TestData(n, 1) = "00001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000": TestData(n, 2) = "0"
  388.     n = n + 1: TestData(n, 1) = "00010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000": TestData(n, 2) = "1"
  389.     n = n + 1: TestData(n, 1) = "00100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001": TestData(n, 2) = "0"
  390.     n = n + 1: TestData(n, 1) = "01000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010": TestData(n, 2) = "0"
  391.     n = n + 1: TestData(n, 1) = "10000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100": TestData(n, 2) = "0"
  392.     n = n + 1: TestData(n, 1) = "00000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100": TestData(n, 2) = "0"
  393.     n = n + 1: TestData(n, 1) = "00001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000": TestData(n, 2) = "0"
  394.     n = n + 1: TestData(n, 1) = "00010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000": TestData(n, 2) = "0"
  395.     n = n + 1: TestData(n, 1) = "00100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000": TestData(n, 2) = "1"
  396.     n = n + 1: TestData(n, 1) = "01000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001": TestData(n, 2) = "0"
  397.     n = n + 1: TestData(n, 1) = "10000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010": TestData(n, 2) = "0"
  398.     '''
  399.     'n = 0
  400.     '''
  401.     ' Test: single-one patterns, select phases
  402.     n = n + 1: TestData(n, 1) = "00000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100": TestData(n, 2) = "0"
  403.     n = n + 1: TestData(n, 1) = "00100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000": TestData(n, 2) = "1"
  404.     n = n + 1: TestData(n, 1) = "00000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001": TestData(n, 2) = "0"
  405.     n = n + 1: TestData(n, 1) = "10000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000": TestData(n, 2) = "1"
  406.     '''
  407.     'n = 0
  408.     '''
  409.     ' Test: double-one patterns
  410.     n = n + 1: TestData(n, 1) = "00110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011": TestData(n, 2) = "0"
  411.     n = n + 1: TestData(n, 1) = "01100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110": TestData(n, 2) = "0"
  412.     n = n + 1: TestData(n, 1) = "11001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100": TestData(n, 2) = "1"
  413.     n = n + 1: TestData(n, 1) = "10011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001": TestData(n, 2) = "1"
  414.     n = n + 1: TestData(n, 1) = "00011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100": TestData(n, 2) = "0"
  415.     n = n + 1: TestData(n, 1) = "00111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000": TestData(n, 2) = "1"
  416.     n = n + 1: TestData(n, 1) = "01110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001": TestData(n, 2) = "1"
  417.     n = n + 1: TestData(n, 1) = "11100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011": TestData(n, 2) = "1"
  418.     n = n + 1: TestData(n, 1) = "11000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111": TestData(n, 2) = "0"
  419.     n = n + 1: TestData(n, 1) = "10001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110": TestData(n, 2) = "0"
  420.     '''
  421.     'n = 0
  422.     '''
  423.     ' Test: repeated staggered pattern: 010011000111, all phases
  424.     n = n + 1: TestData(n, 1) = "010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111": TestData(n, 2) = "0"
  425.     n = n + 1: TestData(n, 1) = "100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110": TestData(n, 2) = "1"
  426.     n = n + 1: TestData(n, 1) = "001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101": TestData(n, 2) = "0"
  427.     n = n + 1: TestData(n, 1) = "011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010": TestData(n, 2) = "0"
  428.     n = n + 1: TestData(n, 1) = "110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100": TestData(n, 2) = "1"
  429.     n = n + 1: TestData(n, 1) = "100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001": TestData(n, 2) = "1"
  430.     n = n + 1: TestData(n, 1) = "000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011": TestData(n, 2) = "0"
  431.     n = n + 1: TestData(n, 1) = "001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110": TestData(n, 2) = "0"
  432.     n = n + 1: TestData(n, 1) = "011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100": TestData(n, 2) = "0"
  433.     n = n + 1: TestData(n, 1) = "111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000": TestData(n, 2) = "1"
  434.     n = n + 1: TestData(n, 1) = "110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001": TestData(n, 2) = "1"
  435.     n = n + 1: TestData(n, 1) = "101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011": TestData(n, 2) = "1"
  436.     '''
  437.     'n = 0
  438.     '''
  439.     ' Test: repeated staggered pattern: 0100101010101001010101000111, all phases
  440.     n = n + 1: TestData(n, 1) = "01001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111": TestData(n, 2) = "0"
  441.     n = n + 1: TestData(n, 1) = "10010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110": TestData(n, 2) = "1"
  442.     n = n + 1: TestData(n, 1) = "00101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101": TestData(n, 2) = "0"
  443.     n = n + 1: TestData(n, 1) = "01010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010": TestData(n, 2) = "0"
  444.     n = n + 1: TestData(n, 1) = "10101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100": TestData(n, 2) = "1"
  445.     n = n + 1: TestData(n, 1) = "01010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001": TestData(n, 2) = "0"
  446.     n = n + 1: TestData(n, 1) = "10101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010": TestData(n, 2) = "1"
  447.     n = n + 1: TestData(n, 1) = "01010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101": TestData(n, 2) = "0"
  448.     n = n + 1: TestData(n, 1) = "10101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010": TestData(n, 2) = "1"
  449.     n = n + 1: TestData(n, 1) = "01010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101": TestData(n, 2) = "0"
  450.     n = n + 1: TestData(n, 1) = "10100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010": TestData(n, 2) = "1"
  451.     n = n + 1: TestData(n, 1) = "01001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101": TestData(n, 2) = "0"
  452.     n = n + 1: TestData(n, 1) = "10010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010": TestData(n, 2) = "1"
  453.     n = n + 1: TestData(n, 1) = "00101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101": TestData(n, 2) = "0"
  454.     n = n + 1: TestData(n, 1) = "01010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010": TestData(n, 2) = "0"
  455.     n = n + 1: TestData(n, 1) = "10101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100": TestData(n, 2) = "1"
  456.     n = n + 1: TestData(n, 1) = "01010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001": TestData(n, 2) = "0"
  457.     n = n + 1: TestData(n, 1) = "10101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010": TestData(n, 2) = "1"
  458.     n = n + 1: TestData(n, 1) = "01010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101": TestData(n, 2) = "0"
  459.     n = n + 1: TestData(n, 1) = "10100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010": TestData(n, 2) = "1"
  460.     n = n + 1: TestData(n, 1) = "01000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101": TestData(n, 2) = "0"
  461.     n = n + 1: TestData(n, 1) = "10001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010": TestData(n, 2) = "1"
  462.     n = n + 1: TestData(n, 1) = "00011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101": TestData(n, 2) = "0"
  463.     n = n + 1: TestData(n, 1) = "00111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010": TestData(n, 2) = "0"
  464.     n = n + 1: TestData(n, 1) = "01110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100": TestData(n, 2) = "0"
  465.     n = n + 1: TestData(n, 1) = "11101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000": TestData(n, 2) = "1"
  466.     n = n + 1: TestData(n, 1) = "11010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001": TestData(n, 2) = "1"
  467.     n = n + 1: TestData(n, 1) = "10100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011": TestData(n, 2) = "1"
  468.     '''
  469.     'n = 0
  470.     '''
  471.     ' Test: r1's custom quiz 1
  472.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '1
  473.     n = n + 1: TestData(n, 1) = "00000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  474.     n = n + 1: TestData(n, 1) = "00000100000101110000001100010001100001001000000000000000001100000000000000000111001000000000000111100000000100111000000000000010000000001111000000000000000000000000000001010000000000000000010000000000000011000111100001000100000000000000000001101000000000000000001000110110000010000100000011001100001101001000000000000000000010000100001100011000101000000010000000000000000000000000000000000001000000000010000000000000001010000010000000000000000000000000000000000010000100000000000000001011010000000000": TestData(n, 2) = "0" '
  475.     n = n + 1: TestData(n, 1) = "00011101100000000001011100001011101000100111101100011000000011001010101000101000111111011000111000100000000000000110110000000001001001110110100001011011101100000011001010001111111110101100001101100001100011000111101100110000000101101101110000001110110111000011000110000000001101111000110000000011111100110001111000011101111101010011111111101111010011011001111101100010001100101101001011000010100111111101111010111111010110001100011000000100010001100111111001101101111000000010110111110000001011010011": TestData(n, 2) = "0" '
  476.     n = n + 1: TestData(n, 1) = "00000000100000000000110000000000000000010000000000000000010000000000000000001000000000000000000000000000000001000000010000000000000000000000000000000000000000000000000000011000000000000000001000000001000000000000000000000000000000000000000001001011001000000000000110000000000000000000000000000000000100010000000000000000000000000000000000001100000000000000000000000000000000100000000000000000001000000000000000000000000000000000000000000000100000000000000000100000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  477.     n = n + 1: TestData(n, 1) = "01111011010110000100001000011001101101000011000011000000000100110010001010000100010000001110111000001000000000101110101100000000100011100101101110000010110101111001011010100000111011100110100001100100111010111110000010000110010000000100111100110000000101010100111001000000101000100101111001001001000010000100110011011010011011101000110011000000101000000100010000101101000101000110000100010101010111100000000001100000110010000001000011100001001000100000011100000101000001010101000100011010000100010011": TestData(n, 2) = "0" '
  478.     n = n + 1: TestData(n, 1) = "11000110011000111000001101000010001000001110001001110010000110000111010001010001100010101100001111100000111100101100000011000111101101110010101101010000101010000001111100000111110101010000000011011100100110101100111101000000100100101000011010000000010110101010011001110011111000010001100110001111111001100010011100010101001100000101010101100000000001001010000011011100010011001000001001110111100110010010000010000111111101100011010101010101000111010110101000000010001001001011011011100101111110110010": TestData(n, 2) = "0" '
  479.     n = n + 1: TestData(n, 1) = "10101101010001010110010110011111011111111101110100010011101110000000100011010000100111111001110110100011011110011101110001110011110000111011011110111011101100000010100111100010000010100111110010100100010001010101111000111010011101010111001110110000101101110001110010011101010110101110001111000101011001001101001011111101110010110101001100110010111101010111010010000010110100010001101110110101101110000101101010001001101101011000111110100000011101110010101111011110111110100110101001111101110001010110": TestData(n, 2) = "1" '
  480.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  481.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000001000000000000000000000000000100000000000000000000000000000000000000000000000100000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000": TestData(n, 2) = "0" '10
  482.     n = n + 1: TestData(n, 1) = "00000110110101110000001100100101000001001111101111100000011000000000001001000100011000000000100011100000100000001001000001000010000000010111001101000001100000010101100011010011111000100111010000000000001010001011101110010100000000000010001011101000010000100000101100110100000011111000000001110000010101010000111111110000000110000100111110011000100000010001010100000000000110000000011000100000000111110011110010000100001010000010011100000000010001101010000000000110010000000110000000110011000000000000": TestData(n, 2) = "0" '
  483.     n = n + 1: TestData(n, 1) = "11011001010011000110101011011010000110001001010001001111100111001011110110111010001111010110010100100101011010110010010100111010111001101011100100001010011111111010011100101101000011011011000111011011010110111100110011100010100001101010110101110101110111010111010010011001110100011010011010101111101110100100100111101101001011100001001100100111010101100100101000111111111001001111100111010110111100001000000111101000111000001101011001001110001000010100110011111001001010101001110111010101111001100001": TestData(n, 2) = "0" '
  484.     n = n + 1: TestData(n, 1) = "00000000000000000000010000000001100000000000000000000001010000000000110010000000000000000000000000000000000000000000000000001100000000000111000101000000000000000000000000000100010001000000000000000000000000000000001100010010000000000000000001100000000000000000000000000001000000000000000000000000000000000010000011000000000000010000000000000001000000001000000000000000000000000000000000000100100000000000100000000000000000000000000000000000100000000000000000000000000000000000000000100000000000000000": TestData(n, 2) = "0" '
  485.     n = n + 1: TestData(n, 1) = "11101000011011010000101000100000010001001000000110011110001011010001001101101010001100111000000101001000011000001010010100010011100110101000101000000000010100111001010100010010101010100011000011000001011010000000010000000001011110110111000010000001011011100000000111001110100000110000000011000101100000001001000100110011000100100000100001001000000011010010100000000100100000101001100000110001001001110101010001000000011000000010101000110010000100001011000001101000101010011011001110010110000010000000": TestData(n, 2) = "0" '
  486.     n = n + 1: TestData(n, 1) = "00000010100110101001001000100000010100100100101101010010000001001100000000001011001110011011000010000111111001100010110011000010100110110000000000011010011010010100100011011011001100110001101001110000101001001100100010001101001000001011111100011011100000011001001010111000000000111101111001111001111111101000000000101100011001001011011010010000100001100010011110010000001011000001010111010010011111001001001110111100110010000110100111101000000101110100101010001111001111101100010101001001010101000101": TestData(n, 2) = "0" '
  487.     n = n + 1: TestData(n, 1) = "00111100000000000111001001100000111010010010010011100010001100001100000011011000100010000101110010110100110110011100010001111110011011000110010000001001101111111000011000010001101110011101111010100110100110000111011101001111110011011111100110111000001101101110001001001000011110100110000111110111010000001100100100100111110110100001001011100110111000100011110100100100110010011110011011100011101111010010000110000011101100000111001011000110000010001101111011111011001100000010000101000000000000101110": TestData(n, 2) = "0" '
  488.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  489.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000100000000000000000000000010000000000000001000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000": TestData(n, 2) = "0" '
  490.     n = n + 1: TestData(n, 1) = "00000000010111101100110000001011000001001011001100000001001100001001000001001100010000111111000011100001000000001111010010000100001000000010001101001011101011011010000101010011110110110001100001000010000010100011000000110001000000011101110001000000000000110000100000101100000001011010000101000000100100011000111111110010110101010100011110100110110000010001101000000000101001000010100110000100010100111000010010100100001000110000000100010100010000000010000100011100010010110100010000010010001001000010": TestData(n, 2) = "0" '
  491.     n = n + 1: TestData(n, 1) = "11111111011001010010001100000100110110101110100011010010111011110100101000100000000101100000000100110010111110111000110101101010111111011101101010011111100100110100010011011001100000001110111110000101000000001100110101011110011111101100001110011101111100111100011100010010110111100001010000010001101001001111000000000101001000100100000110011000101011100100000100111011010110100000010001011010101011010010100111011000100011001000001010001011101010000100001011001011100001001011101110100110110010111100": TestData(n, 2) = "1" '20
  492.     n = n + 1: TestData(n, 1) = "00000000000000000000000000010000000000000000000000000000000100000000100000000000000000000011100000000000000000000000000001000000000000000000000000000011001000000000000100000000000000000000000000010010000000000000000000000000000000000000000000000000000000000000000000000000000010001000000000000000000000000000000000000010000000000000000000000010000000000000000000000000000000000000000000000001001000000000011100000000000000001000000000000000000100000000100010000110100000000000000000000000000000000000": TestData(n, 2) = "0" '
  493.     n = n + 1: TestData(n, 1) = "01011000100010001000011010000010010010000100100101000100011001000010000010110110010110001100010001000010110110000011010100000100100010010011111101111100110010101100000001000000100111010000010000100000000111100110000101110001100100000001000001001100100100010000001001000110000000000100011100110110000101100011100010110100000011001001011000010001001000101010010010000001000000100101100101001110110010010000100010100010000000100111001100000000001000111111010100001000001010000010101010110101101000001100": TestData(n, 2) = "0" '
  494.     n = n + 1: TestData(n, 1) = "00000101000010010110000110001101111110010001110010000010101001111111010000011011100000110000010101101110101111110101001100000100000000100110001000000000000001110011101011011110000001000110101001000000000000010100010010110110000010001100100010011001010011111011001110110000110100010010000010010110011000010110110010101000111000000100000001101100100110010100110111001110110101010001101100000000110010100010000001000101011100000000000111101110101011001011001100100000001101110000001001101010000000111011": TestData(n, 2) = "0" '
  495.     n = n + 1: TestData(n, 1) = "10100010000111100111110001101101100001100111001010011110011001101110100111000111001010100111100010110010101010100100100000101010111100100000010111001000101110010010111000001100011011001011010100101101101110001001111100110000001011100000010110011010001000001101101111001000011101001000110010110111100011111011001100011110100110100111001110000101010001010001101001101001011001111010011001101010000001111010110011100001010100011100110100011011110011100101000001110010010111100111110011001110011111001010": TestData(n, 2) = "1" '
  496.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  497.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000100000000000001100000000000000000000000000000000000000000010000000000000000000000000000000001000000000000000000000000000000000001000000000000100000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  498.     n = n + 1: TestData(n, 1) = "00100000011101101100000000000000000000001010001010001010010000000011101000010100001000000110000110100000000010001000111100100100001010110000011000001010110100110011000010001000110101001001100001011000001000000000000010110000100000110000001001000000100000110100100100100001010011000000010101010010100101000000001011100010000000001100000110100010100010000001110000000100000001110010100100001110000001100110000100001000001000000000010000001000001000000001001100000000010011110100000000001010100001111111": TestData(n, 2) = "0" '
  499.     n = n + 1: TestData(n, 1) = "01010110100011101001111011101011111111101001100000010100001001111110010111100011101100011111110001101101111000110011010011010011110000101111110110010001000001010100100100110011010010010110101011100000111111111101111110110011111101010011110000111101000010010011010000011100001000011011000011001101100011011101000101010101111011000100001111010100111001011100011100011011011000000010011010010100110010011001111011010010110011111000101110010111111100100100111110111010101001101011010100000001011010010000": TestData(n, 2) = "1" '
  500.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000000000000000000000000001000000000000000000000000000000000000000010000000000000010010100000000000001000000000001000100000000000000000000001000000000000000000000000000000010000000010000000000000000000000001000000010000000000000000000000000000000000000000010000000110000000000000000000000001000000000010000100000000000000000100000001000000010000000000000000000000010000000000000000001000000000000000": TestData(n, 2) = "0" '
  501.     n = n + 1: TestData(n, 1) = "00000001100010111010101010001001000011001100000000000000010011000111001101001010110010010010010100101010000001001000111000000010110000010001001110100000000101101001110100010100000101000100000101000000010000110000010011010000100101001111000000011110001000001101101100000001000101000000011001011001110111100010010001000011110011110010010001000001110100100010101001110000010100000010010100000000101001000100101000011000000001001010111010110100000011001100101010000000100100100111111001110101000100000001": TestData(n, 2) = "0" '30
  502.     n = n + 1: TestData(n, 1) = "11010010010101000010000011010000101110111010011001101000101111011101001110000001011110100101101111000100000010110001010101000110100001100000111000111100011110110011101101101111101010100100011101000000010010101110000011011100010010101110101010000001110001001111110011011101000010110000101111000000101100011100101100001001100001111110000101110000010010000001001010000000011011000001000101000100000111101100110011000111010000001000010000000000100101010001100001011000001010001000111111110110101000011111": TestData(n, 2) = "0" '
  503.     n = n + 1: TestData(n, 1) = "11011111000111100000010011111111101111001100100010111010010000011000110100111010011000111101000111010000110110101010011010101011100110011101000001011011111110011100110100001001010000001000010010100101111011000101001000000011110011110001100100100011011001010000101101111110101011011100000111000111000011110101111011101000101010000111011110000111111101011101110110001000011000111011011011111100110000001011011010110101101111011001011000111100101100111010011100110111101100110110100110000010011111110101": TestData(n, 2) = "0" '
  504.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  505.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  506.     n = n + 1: TestData(n, 1) = "00100000000000000011000000000000000000000110000010011111100000000000000001000000001000000000000000010110000110000001100010000000000011110000000001100000000000110011000011000000010000001110000000011000001000010000110100000010000000111101000000000000000000100000000001100000100011000000000100000000000101000000000011010000001100010100000110110010100001010000110000001000000001100000110000001100000000011010000000000000101001100000000000000000100000011010100000000010010000100100010000000000000001111000": TestData(n, 2) = "0" '
  507.     n = n + 1: TestData(n, 1) = "00010100011101010101100000101000001100111001101101000000011001111001100110110111010111111011110001100000000001100000011001111000111001000110011010001110100110011001110111100000101000110001100110100111000111001000001001110101101110000000110000000000011001010101000110011101011001100011001001011001101100011110000101101001100011001010011000001100110000101000001111110110000000001100001100010010101111100101001101010000000110011011111100011111010000000101000000100101100111010110001101111010101010000110": TestData(n, 2) = "1" '
  508.     n = n + 1: TestData(n, 1) = "00000010000000000001100000000000000001000000000000000000000000000000000000000000000001001000000000000000000100000000000000000000010000000000000000100100000101000001000000100001100000000000000000000000000010110000000000000000100001000000000000001000000001100010000000010000010000000000000110000000001000000000001000010000000000010000000000000000000000000000000000000100001000000000000100001000000000000000000100000000000100000000000000000000000001001000000000000000000001000010000000000010000011000000": TestData(n, 2) = "0" '
  509.     n = n + 1: TestData(n, 1) = "11010000111110000000000011000001011000010011010100100000000000110011011101010010100100000000000000010001101001000001001010011000100101101000111011000001000010010000010000010100001000100110100001100100001001001001100011110010011000110111000011000000011000000000100110001000101101100000001000000000000100000000000001001110001110100000010100001011101010110100001001001000000010010100001010100111011111000100001010000011010001000011001101110001101110000011010101101001010100110100010001011100110100110111": TestData(n, 2) = "1" '
  510.     n = n + 1: TestData(n, 1) = "00000000110110001000000011001000100000001110011010100010101101111100101100101000001010000000101101010100101011010000010001001110001001100001110101011010111010000100001011001010010100011001011000010000100001000000000100001111001000101011111110100001110010011000100001101000101001101011110001011111000110111010010101000001001011101101110000001011110000011001100011111001010100010101110011000100110000101101010010110000000000010011001001101101000010000010001110000011111100111101100100110000001000110000": TestData(n, 2) = "0" '
  511.     n = n + 1: TestData(n, 1) = "00101101111001100011001000011101001000000001100000101001000010110101000011001101110010110011000010101100111010101111100101100111000010110111010100000000001010000111111011001000111011100100011111101010010101011111111010010110010001101010100101010110111010111000101111001101001101101111010101010010110001000110110110101000010100001000010011101010011110001000001111001100110001011010100011101011100000100000111001000111001010101111010010010100110111001000100011010110100011111011101001101010111101101010": TestData(n, 2) = "0" '40
  512.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  513.     n = n + 1: TestData(n, 1) = "10000000100000000000000001001001000000100011010001010100000100000000010101100110101000000000000100000101010000000101000000000101100000000000010000001000001011000110100110100010010100010111000100000100001010000000101010001000111001000000010000100100000000000000100000001001000000110001010001001010010000000010101001000111011000100100100000010010000100100000000000001000010010000110010110000110100000000000101001010100000110010001110000111000000110000000000000000000000100101100001010000100000101100010": TestData(n, 2) = "0" '
  514.     n = n + 1: TestData(n, 1) = "00001101011011101101111110010000011011010000101110101011001001111000101010010001010111100001110011011010100011011010101010111010001010100110101100000110110100101001011001010000001010100000111010111011100100110111010101010100000010000010101110001011010011001111011110110000110010001010001000110100101111101100000110111000000000000010001111101001011011010111110110000100101000111000101001110001010011110100010100100011110000001100001011000100100000011110111111100011000011000011100101111010111010010101": TestData(n, 2) = "1" '
  515.     n = n + 1: TestData(n, 1) = "01110011000100111110101110110110101110011100101000000011111010011111101010001000000000111110011010111010001110111000111111010010011101111101100111110001000000011000001000001101101001001000010001011000010001111100010001100111000100111111100011010001101101110110000001010110001111000100101110010001101101010001010110110000100111011001010100101101110000001111001111110111100101101001001001111001011111111011000010101001001001101010001111000011011001111111001011111101111001010010110000100001010000011000": TestData(n, 2) = "0" '
  516.     '''
  517.     n = 0
  518.     '''
  519.     ' Test: r1's custom quiz 2
  520.     n = n + 1: TestData(n, 1) = "10000001001000000000000011000000000011010100000100010100010111001001000011100000000000101000000000000000000100000011000011010001000000010000000001001000001000000000000100000100000101001000010000000000100011001101010000000010000100010000001001000000010000010000010000010001100000010010000000000110110110000100110010000000000100000001001111110010011001000011000001101010001111111010101000010111111110000000000101000000000010001010101011000001101001000010000000010110001001000010010100010101000000011101": TestData(n, 2) = "?"
  521.     n = n + 1: TestData(n, 1) = "10001000000000000000000100101000000000001100000000010000100000000000000011100000000010000100000000000101000100000000000011000000000000110000000000000100100000000000000100000011000000000000000000000000000000001001100000000100100100000000000000000100010000000000000000000000000000000000000000000001001000000000000000111000000000000000000000000010001011010010000000000000000100010101001000001000010010000100000001000001000100010000000001000000110000000000000011000000000000000000000100000000000000001000": TestData(n, 2) = "?"
  522.     n = n + 1: TestData(n, 1) = "00001000000000000100000000000000010001000000000000000000000001100011000000000010000000001000101000000101000000000100000110000000001000000000010100000000000000100001010100000000000000000000110000010010000100000101000000000100100000000100010000110000010101000000010000000001000000000100001000000111000100000000000000000100000001000001000000000000000000000000000000000000100010000100000000100000001000000100000000000000100000001010000000000000000101000000000010000100000001100000000000000001000000000001": TestData(n, 2) = "?"
  523.     n = n + 1: TestData(n, 1) = "00001000000000000000000000000000100000000000010010000000000000000000100000001000000001000000000000000000000001100000001100011001010000000000000000000000000100000001000000001001100010000000100000000100000001000000001001000001010000000000000000001000000000011000000000000000001100000000000001000000111000000010000000000000000000000101000000010000000000100000000000001000110100000000001000101000010000000000000000000000000000000000000000101000000000101010000010010000001000001000000000000000000100010000": TestData(n, 2) = "?"
  524.     n = n + 1: TestData(n, 1) = "00001001111110110001110000000100000110000100000001000000100000010000111000001000001101000001001000000000000000101000110000001011100000100000110000001000000000100001100000010010011100000011100001000110001001000011001011000100010110000110000100111110111011001100000000000000000010000000011100000010000000000000000000111001010001000100000000001010001010000000000000000010101000001000011110100010000100010000001100100001000100000000111000011000000000000000000000010101011010001111000101000000100100110000": TestData(n, 2) = "?"
  525.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "?"
  526.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "?"
  527.     n = n + 1: TestData(n, 1) = "00000001111000110110101000011001001111110101101100011010111100111010100101001010001001100100000100001011000100000100000110000110110000000100101001110001101001110010001000100010110000000110010010101010001000000110100000001001011100001000000100001011111010011011000000000110111100100000010000100001110000010000000000110001111110001100010111000100100001000011000010101110000001000000001101101001111000000010011000000110001000011100111011011000100100000000110000010010110011010110000110011010000010010110": TestData(n, 2) = "?"
  528.     n = n + 1: TestData(n, 1) = "10001110100010001000100001110001001101100010100100111001000000001001100000001000111000001000001100001110010000000001001111000011110101100111001001111011101010110100001001001100100100001101000111010001111110101010101101000101011011111001010110000001010000000000111100100111011001010110000010001110010000001000111110011101111100111000000001100101000000000101111111100011001100111100101011101010011110000010011110001011110011101100010101110000100000011001000011001001010101110110101100111000000010000100": TestData(n, 2) = "?"
  529.     n = n + 1: TestData(n, 1) = "00111001100110011100000000000000001000100100010100100010001101000111011100100010001111100000000110000001000001111001000100000101010011101000001000110100011111110001000110001101110000000010101100000111000001100110011111110000000000000100100000000110101001010110000000011100000010110100110000000110000000001010000101000001000000100000100010000000000100000011000000000010010100010001101100110010101010000010111100000111111100000001001010001001001000000000111000010011010011000000001101000000000010000011": TestData(n, 2) = "?"
  530.     n = n + 1: TestData(n, 1) = "10000101100000010101000111000110011000100100000101000011001110000010000100000111001001100000011100000101001000000000111100000100011000000010001100111000001001110100100000010000110011110011000000000010100100010111000000000000000010010000010001010010101100110010000000100101000001101001010010000000000010000001110010000011000000010010001010000010011000011111101100000010100000001110011110100000101001011111011001100110001000100000001110001000010000000001110001010010010011100000000100100100110011000010": TestData(n, 2) = "?"
  531.     n = n + 1: TestData(n, 1) = "01011100011100011000100100011010011000010011000011101100110010000000011000001100111001010010001001001101010101100100100011111110110111111111001011111011011001110011011000010001100100101100000111101001000100111110010110110101001000011011110101010010010001111011101111111100110000111110011001001111110111010000010110001001000101001100001101010010000000000110011110100001100000010000011001110110110010011000100000000110001001000001100000011001001100100100100011010001111100011001111101100000111100000000": TestData(n, 2) = "?"
  532.     n = n + 1: TestData(n, 1) = "00110000100010000000100000000101000100000000000000000010000000100000110000101000110000100010000000001000100100000101000010110101001101100010001000100100010000000000000000000000100100011001001010001010000010010000000100001001000010000001010110010000100011010000100011010110110100100100001000000010110100000001010010000001111110000000100100100000001101000110111100011101001110010010001010110000000011110001101000000001110000100010100000010001000010001000100000010000000000000000000010011001011000010100": TestData(n, 2) = "?"
  533.     n = n + 1: TestData(n, 1) = "10110010010010010000110011100101010001001001100011000001000010011000101001100000110110000000100011111000011000000111111000001000011011010111000000010001000101001110010001101101011001010001000110000010000110010100010000011001010000100000101100011100000110001001100111100110000110100010100000011000111100111010010100011000000000011000010111100000100001010100011110100000000000101101110010000000100110100001110000001110001000100000000000010010001100000000111100000001000000000000000000000000001001000000": TestData(n, 2) = "?"
  534.     n = n + 1: TestData(n, 1) = "11010000100101101011010111010110101110101000001101001011100000111001010001100000101100110000010111000100100101110100001101111001011011001100110101111100010010111100010010111111010001111110010011110000110011110011010011010101100001101010011110101001110001100011001110111110011111111101100001100000011000000101101100111100011010001011010101001010000101010011000010011011010110110111011110000001110010100010000000101111101011101111000101010001011111100100101000011001011001101111101100010111010100111001": TestData(n, 2) = "?"
  535.     n = n + 1: TestData(n, 1) = "00000000001110011101011110000001110100101110110111000101111000011010101110010001100110001000111101100010101110100010010110101110110110110001001001010010000011101111010010110010000110001000100001111110100001100000101011011000001100001011110001110100111010101110001011110000001111110101010101100101000001101010101001010010100001001000101000011000111101100111101001001010110010000100111010011010111010000100001011010101111111100100111101011001100111110010011110011100011110001110001001011000011010001101": TestData(n, 2) = "?"
  536.     n = n + 1: TestData(n, 1) = "10001001110000001000010001011011000100011010010101101011010100011001000011010101101100011011000111010111100010110011001001101011100111101101001000100100101111011100001100100100010000001100000010000010011101001010001011100011100001001000010000100010001001111000000010001101000001001110000110011110011100011011001110101000101001111111001010111000111011100110110011111011010111000011100001111110110101010111010110100000110110010110010100011000111110111101110011001111111000011111111001111001001101011111": TestData(n, 2) = "?"
  537.     n = n + 1: TestData(n, 1) = "10010011010111111001010001110000011011100100100110011110011111010011011111111101111001100001100110100100100110011111111100011011100010011011110010010100010100000000010010001111001001110010111100001001010111110010110111111100110001010011010100001111101011100110010111110111110000111100110101001010111001101011001001000101100001000110111100010111001001001001101011000110001011100011100010110000111101111101100100100011101100011011110011110000111100001100001100100011000111110000100000110101100011001011": TestData(n, 2) = "?"
  538.     n = n + 1: TestData(n, 1) = "01111000000111010111111100110100011010111011110101000111000101111000111111100011010010001111001010111100111101101010000101110101000010101100001111010101011110011001011011100001110101101011111001010111001101110001110011111111100011000110100011111101000010100101010001001100101000100001000100000010101100011111001110101101111001111001110100011001101011001100111001100000010111000111000011001000011001000010011101011101110101010010110010111110111111010101100001111110011110011000010011000010010000110000": TestData(n, 2) = "?"
  539.     n = n + 1: TestData(n, 1) = "11100101001100110010000000001111111011001011100100111101110111101000111000110110001100101000101110100101001000011011000111010110011101100010000100111010111010011010010010101110111011110010110110011001110101100111100010100010101000100001000100001000100101010101001111010111110101100101100111010110100100111000010101001101011100010110000000100110111100101111100001010011001100000100010101111111110110010111011011011001010111011100001001110010100100110110110101001101000001011001110111010110100000111010": TestData(n, 2) = "?"
  540.     n = n + 1: TestData(n, 1) = "00101011100010110100010101100110110111001111000100100110011111000001101011100001110110100001110011111101001000100100010111000111110110001101101000101100011111101001010010001000111111110111011001100011011011010110000101101100100100011011101001011010101001100011111101110101111111010001010001001100110100100000011100111101110010011000011001001000001110001001010010101010000110101001011010100100111011010011011110101110110100010001000100100011000011110111111011000011101101100111101111100011000011010111": TestData(n, 2) = "?"
  541.     n = n + 1: TestData(n, 1) = "00000100100101110000110100100011111110100110000101010001100010000000111111000111010011111111111110011000010011010111011010101101011011011010011000100100101100010110111011000111001110011110001111100000101101100001100011111010010100110100111010100101011100100001100111111010001100000001100010001000111110101000010000100100110010101111110011111111001111111101001000111100100100111100001111101000111110011111001111111001110100101001000011100010001010100110101011011001000001111010101100100110001011110111": TestData(n, 2) = "?"
  542.     n = n + 1: TestData(n, 1) = "00000111111000010000101100011100110000100010111111110111011110010011000011110000001110000110001101101011010111010001100011000101100011111100010000010101010111111111010100000110111010001001100110111100011111000100101111111100010100110110100000101110010101000000000010000111111101011111111101110110111110111111111001101110100100110111101110111001100000100011011111010000101110011010111100000110100010110010001101001010100010000000101111110000111000001000010001000100010110011011111011101110100001101010": TestData(n, 2) = "?"
  543.     n = n + 1: TestData(n, 1) = "10101101001001011100001000001110010001110011001011000111110010110110100011111111111001010000101010011110011110110010010001011010011111101000011001111100000011001011011001001110110000101001011000100111100011000111110011100000010011000000101001010011000111100000111000101110110111100001110000101011010001101010101101101110011011111100111001010100011000111011101111011111011101010000100100000100110101111100000101000000001001001110000111100100111011011100101101010110100101110101010111001010110010100011": TestData(n, 2) = "?"
  544.     n = n + 1: TestData(n, 1) = "00111100000001100110111100111110110100001000001111100110011111100111110001100001100100110110000000011111110010111000111000101000000010000101011001010000011010110001111000010010010010000111010100110011000001000011110110110010010010011111111111111001100100010111101010000001100110010000110011000101000100001000001111010010101100001000101010101101001100000000001001101001011110001100100000000001110011111000100110101010000001111111111010001001011000100010000000100001000100011000100000110100101011000010": TestData(n, 2) = "?"
  545.     n = n + 1: TestData(n, 1) = "00001100001100010100000100001111110011001111010000111001001111100010101101011000101100010010101010000011010111100100101100001110011001100000001011000111010000111000001100010000000100100111000100100000010101110100010000101010101110111011101001111000010110111110010000110110001010001111100101100011101010011010100110000101010110010100111101100100011000001011111110111001001101100000000001010011000010100000011001001011110000000000010100000000000100111110001000100101000100000000001000001001110000000000": TestData(n, 2) = "?"
  546.     n = n + 1: TestData(n, 1) = "00010011100000101100010001010000111100001100101110110011000111111001111001111000010001011110111010100110101111100100111110000000001111010001100011100001101110100011010000010001111111000001111111010111001111001111111001000010000101101101000100100000011111011000011100100011001100110010000001000111111110100011111010101011000101111110000011001010101100100001001111001001000011111111010011110000110010100101111100110100111111011000110010010111000000010010001010010000110101100111110100100010011100110010": TestData(n, 2) = "?"
  547.     n = n + 1: TestData(n, 1) = "10011100100001100111000000111010000100000000010000011011000010100001110000110000110100001000001000011001011110010000001001000111000100100001000000111001100000100011000000000000000011000000101011010100101000000010010100010000011000011100000111000010100110101010010111010000010000110000010000000110010001000001100100000001001000110100011010101001000010100100000001001000100010100010111010010100010111100011000001101100000011001110100010010001001100110001000010001010001000010111000010010000111001011000": TestData(n, 2) = "?"
  548.     n = n + 1: TestData(n, 1) = "01001001001000000100101111110000000010011000000110011101110111111001100011100001000000101000000000000110001111001011010010110011101110010000001001001000000000000000000101000000010001111000011000010000000011001100110000000011100100100011001111000100100010011100010010010111110100010010000111001110011110010000110010100000000001001011001111110010001001011110000000011011001111111100100000110111111110000000111001000000000010111010101011000011111001110010000010011010001001110001011100010110000001111101": TestData(n, 2) = "?"
  549.     n = n + 1: TestData(n, 1) = "10011000000000000100000010101001000000001100100000011001100011010001000011101000110010000100001000000000100100000000000011000000000000110000010100010100000000100000010110000011010000000000110000000000000000001001100000000100010000100000000100000100010000000000100010011110100100000000000000000001001001000100000000001000000000000000000000000000001011010010000000011000101000010101001000101000010110000100100101000001100000000000001011000000000010000000000011000111000000000010100100000100000001001000": TestData(n, 2) = "?"
  550.     n = n + 1: TestData(n, 1) = "00001000100000100000000000001100000001000011100111101000000001100011111000001010110000000100101000000000100001000100101110000000001000110000010100001000100000100001110100000000000100000000000001010010011101010101001000000100100000110000110000110000010001000000010000000001000000000100000010001111000111000000000000100100001001000101100000000010000001000000000001000000100010000100000000100000001100000111000000010001110010011010000000000000001101000010000010000100000011110000100000000001000000000001": TestData(n, 2) = "?"
  551.     n = n + 1: TestData(n, 1) = "00001000001011110101000000001000101000100000010110110000000001100000111000001000101001000000000000001100100001100000101100011001000001110000010001001000100100000011110011001000000100000000010001000110000001000101001001001001010000110100000100101110010000011000000000010000001100100000010000000000111000001010000000000100001000000110000100010100001001100000000000001000000100000000001000101000010000000100000001110010000100000000000000011000000001101010000010000000001010001000010010000000100100010000": TestData(n, 2) = "?"
  552.     n = n + 1: TestData(n, 1) = "00001010101000010001100100000100000110111110000001111100000001110000001000000010111101010011000000000010100001110000110010011111100000000000111000011100100000100001100001000010011000000111100001010010011001010011001110001000010000000111010100011001111111111100010000100010000100000000111001000011000000100110000000111000111110000100001000100110100010001001100100001000111000001000011110000111100100011100001000000001000100000110011000011000000001000010000000110011111010111110000101010001110100110000": TestData(n, 2) = "?"
  553.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "?"
  554.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "?"
  555.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000100100000000010100000000001000000000000010001010000100000000000100000010000000000100000000001101000001010000100000000000010000000000000000000000000000000000000011000000000000100000000000000000000000000000001000000000000000010000100000000000000000000000010000001000000100000000000000000000001000000000001000000000000000000000000100000000000000000000001010000000000000000100010001001000000100100000001100000000000000000000000001000000100000000000000000000100": TestData(n, 2) = "?"
  556.     n = n + 1: TestData(n, 1) = "10000101000000000001000000000010000000001000000000000110100000000010000111100000000000000000000000000000000100000000000000001000110100100000001000001000000000001000001000000000000000000110000010000000000000000000000000100000000000000011000000000000001000000000000000000000000001000000000011000000000100001000000000000000000001000000010000000000001001010000000000000000000000000100100000000000000000000100000000100010001000000000010001000001000000000000100000000000011110011000000000000000100000001000": TestData(n, 2) = "?"
  557.     n = n + 1: TestData(n, 1) = "00000000000000001000000100000000100000000000000000000000000000000000000000110001000110000000101000001000000010010000000000010000000010000000000000000000000000000001000010000000100000100000000000000000000100100000100001000000100000000010000000000000000001000100010010000010000100000000000000000010000000010000000001000000100001000000000000000000000000000000000100100000100010010000000100000000100000000100000000100000000000000100000000010000100001000000000100000000000000000000000000000110000000000000": TestData(n, 2) = "?"
  558.     n = n + 1: TestData(n, 1) = "00000000000000000000000000100000000000000000000000000000110000001000000001000000000000000000000010000000010000000001001000000001100000000000000000000000000100000001000000001000001000000000000000000000000001000000100000000000000000000000000001011000000000000010000000000100000000001001000000001000010110000000100000000000000000000000000000000000000000000000010000000100000010000000001000000100100000000000000000000000000000000000000001000000101000001000100000000010000000001000101000000100000001001000": TestData(n, 2) = "?"
  559.     n = n + 1: TestData(n, 1) = "00000000100000010000000000000000000000000000001011000000010000000001000000000001000100000000010010000000000010000000000001000000010000000010010000100000001010000100010000000001000000000000100000000000000001000000000010010000010000000010101000001000000000000000000000011000000000000000000000000000100000000000000000000000000000001000000101000000000000000000000000000000000000000000000000000000010000000010001000000000000000000000000000000010001010100000000001011000010001001010001010000000000000000000": TestData(n, 2) = "?"
  560.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "?"
  561.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "?"
  562.     n = n + 1: TestData(n, 1) = "11110101001000011101011111110011000011111100111111111110011111111111101011101000001110011111001111000011000100000111111111110011110010000001101011111010111001000000010111001111110101111000111001010000110011001111110000100111100100110011111111110011011010011100100111111111110100011110000111001111111111110110110010010000111101011111111111110010011111111111000101111110101111111111111000110111111110000111111111101011000101111001101011000011111111110010000011110110001101110010011100010111100110001101": TestData(n, 2) = "?"
  563.     n = n + 1: TestData(n, 1) = "01000110000100000101000001010000011010010000000000011000010110000001001010010110000000001000010000011010000100000011010010001001000010000010011001001110000000001010010001010000010110001011111111000100000010000000011000010000100100000100000000001000010001000010001010010000100100100001000000000000010100110101001000000111000001001000001000011001001001000010011000000010110110010000100001010110111011000000100000000000100100001100011000000101101001000010110100010010001101010000010011110000000000001100": TestData(n, 2) = "?"
  564.     n = n + 1: TestData(n, 1) = "00101001011000000000110000110100010000100000000011000110110000100000100000100011000101000100001000011000001110000101000100011010110000001110010100000110000011000000000010010011000000000000010000010110000010001000100110110101000000000000000010000000100000100001001001010000010100111000110100000001010000000000011101010001010000000001110000000000001010001001011100000001000100000100100001010001000010111100000000000101100001001000000100000000000000100000000000111000001000001000000001100000110100001001": TestData(n, 2) = "?"
  565.     n = n + 1: TestData(n, 1) = "00101101000010000110000001100000110000000100000000010010000000000100100001001001000000000000000001001000000100000010011000000000000000000001000101100000101100001010001100001000001000110100101001110001011000000000000000101000100111100100000000010001001110001001010010000000000000100011010000011100000001000000001010110100000101000000001000000000011000010011011100000010100100100000000000000000001001001110000001010000100000010000000000000100100110011100100010100010000110001001000101100001001010100010": TestData(n, 2) = "?"
  566.     n = n + 1: TestData(n, 1) = "00000100010110011000000000100100010000000100000001010000111000010100000010001100000010100000110100100100010000011001001001000000001101000000001010101001100001000100010100101001000001001000010000000000100000100100000001010000010101010000000110000101000000000010000001011100000111000100010100000110000011010000100000000001010010100100000010100000011000000010100100011000100000000000000000001000000000001110101101010010000000011000100000000101000010110110110000010001100010000001001100000010011000001000": TestData(n, 2) = "?"
  567.     n = n + 1: TestData(n, 1) = "01000000000000000100001001010000011110101010100001001000000000000100010100000010000100000100000011001000000001101010100001011100000100011100011000000110000100000010010000001000100100000001101001011010000000101000010000000000011010000001101000000010001000000000010110001100000010110001011000000001010100010000000010010100100100100010010000010011000001000000110000101100110010110000000011000000101010000000000011001010000001010110010001000000111010100110000010001001000100100000000001110001100000000000": TestData(n, 2) = "?"
  568.     n = n + 1: TestData(n, 1) = "10000000000100001110001001011001100101100000000100000010000011010001000110010010101011000001000000101001000100000000000000110000000000100000000001001010001010100001000001000100100110100011010000001001000010000000010000000000110101000000000010000000100000000100000100000000010100000000000000000000100011000110111000100000110000001010000100000100010001101101111010000001100000000000000000010001001101000101100000000010100000001001000000000000000000001001000110000000010001000000000111001000001001000100": TestData(n, 2) = "?"
  569.     n = n + 1: TestData(n, 1) = "00010001111000000010010000000001000000101000000100011000010001011001100010110011100000000011001000000100000010010100000001000110010010000000010010011101001001101000000010000001000010011001100101000001000110001010000010010010010100101001010000001000001101000101101100000100100010101010000001000000000000010001000000000000100010010100000000100100001001000001100000011111011100100001000000100000000010000000001001000010001000000010000010101010011110000000000001000001000011000000001000000000000001000001": TestData(n, 2) = "?"
  570.     n = n + 1: TestData(n, 1) = "00000111001100000000100100010000000100000111100100010000100001010110000000000000000000000000000110000100110100010010001000001000000010000001010001101110110100000001000001000001100100101010000001100001110000000000101100000000000000010000001000000000111000000010000010101010001000110000000000000010100110000000000000010010000101010000000000000010010000010101110000100100000000100010100000001101000001010010000000000000001001000101010001100001000001010000000001001000000010110010000010000000010100100010": TestData(n, 2) = "?"
  571.     n = n + 1: TestData(n, 1) = "00000000001100001001010000001000000101011100100101001011110010001001000001011010000010000000100100001010010001111001000100000000000010000000010000000010000000000001010000100000010010100100000001000101010100100000110011100000000010010010001100000000101010100000100000001001110000000100010000100101010101100100011000100100001001000000101110010000010000000000001000000000101010001001010011100000000100010000000000100000101000000100000000011001000100001000000000010000001110001000000000100010011010010110": TestData(n, 2) = "?"
  572.     n = n + 1: TestData(n, 1) = "00010001000000000101011010001010000001000001010100000000001011000010000000000000000001010000100001000101010101100100010011100100100000000000100000001000000000000100010100000000000110000010010000000110000100001100110101110000110001000100110000010000010000011000000010100000100001010100010110001000100000000001000000000000001000110000001001000111010000010100011000000010010000000101000000000011001001101100001000000010000000000000000000000011101000000110000000110010010000110000001000000000100010000001": TestData(n, 2) = "?"
  573.     n = n + 1: TestData(n, 1) = "00000000000110100000100011000000100000100100000000000000011011100000010101100001101010110000000000000000000000111101001001100110001000110001001101000101010000110010010001000000010001000000001000011000000000000000000010000000000001000100000001010010000001000001000101111110000100010010000010011010000000000000100100001001010100001000010100001001000100101000001000000001000000010101000100000010000001110000000000000000001011000011001000010000001110001001000101011110011010000101000000000000000110000000": TestData(n, 2) = "?"
  574.     n = n + 1: TestData(n, 1) = "00010000100010110000000010111001000111010001000000001000100010000100001010010000000001101010000010000001000000000011000010000000010100100100010000110100000100001001100011010010000000011110100010111010110001110000100000100100000100000000010000000000000000110001001010000000000000100100010001110001110000010101010000001010000011101101011010000000001000110000000110110001001100101010000100000001010110001011001100010010000010100011100100001001100000011110000000110001110001100100000100101000101000010000": TestData(n, 2) = "?"
  575.     n = n + 1: TestData(n, 1) = "00110000000000000000000000000010100000000001000000000000000001000000001000111000000100000000100000010001000000000010000010011110010100011110000010000000000000000000000000010010010000000001000000000000000000000000000000010011010000000000110000000001010001010110000000100000000000010010000000000111100000000000010000000000100000001010000000000001000010001110001001010100000000000000000100000000000000001000000010011000000000000000001000011010000000011100000001100000000100110000000100100101011100100100": TestData(n, 2) = "?"
  576.     n = n + 1: TestData(n, 1) = "01000000000000000100000101010000000010010000000110011000010100000001000010001000000000101000000000000010000100000011000010000000000010000000000001001010000000000000000000000000000000001000010000000000000011000000010000000000000100010000000000000000010000000000010010010100100100000000000000000000010100010100000000000000000000001100001000000000001001000010000000000010000110010000000000010000111010000000100000010000000110000010001000000000101000000010000000010010001101010000010000000001000000001100": TestData(n, 2) = "?"
  577.     n = n + 1: TestData(n, 1) = "00000001000000000000000000000010000000000000100000000100000000000010000000000100000100000001000000100000001110000000000000000010000000000000000100000100000000010000000010000101000000000010010000000000000000000000101000000000000000001000000010000000000000000000000000000000000000000001000000000000010000000000000000010001000000000010100000010000001010000000000000100000000100000000000101000000000000000100000000000000000000000000000000000000000000000000000000010000001000000000000000000000000000000101": TestData(n, 2) = "?"
  578.     n = n + 1: TestData(n, 1) = "11100110000000000000100000010010000010000000000000100100000010010000000000000000000000000000000110000000001011000000000000000001000000100000001100000000000000001001000000000100000000000000000000111000000000001000000000000000000000100100010000000000000000000000100100000110000000000000000000000000000000000000000111000001001000000000000000010000001000010000100000000000000000000000000000000000010000101010001000010100000000000000000000000001100100000000000000000000010000000100000100000000000000000000": TestData(n, 2) = "?"
  579.     n = n + 1: TestData(n, 1) = "00000000000000000000011000000000001000000000000000000000011100000100110000000000000000100000000000001000010000000000100000000000000000010000000000100000000000001000000000000001001100000100000010100000010001000000001001000000000000000010000000000000000000000001000000000000011000000010000000000001000000000000000000000000000000000000000000111000000100000001100011000000000000001000000000010000101000000000000101000000000100000100000000001000000000010000010000100000000000000100000000000000000000000010": TestData(n, 2) = "?"
  580.     n = n + 1: TestData(n, 1) = "00000000000010000000000000100000000000000000000000100000000011000000000000000010000000000000000000000001000000010000000000000000001000000000000001100000000000000000010000001001000000000000100000100000000110000000000000010000000000000001000010000000001100000010000000100000000000000010100100000001000000000010001000000010000000000000001000000000000000000000000000000000100000010000000000000000001000100000000000000000001000001000000001000000000000100001000100000000000000000000100000000000000000010000": TestData(n, 2) = "?"
  581.     n = n + 1: TestData(n, 1) = "00010000000000000000000000000000000100000000001000000000000000000000000000010000000000000000000010010000000100001001010010001001000000000000000010000001000000000000000100000000001000000001000000001000000000000000000000010000011010000000000000110001000000001000000000001000000000000100010000000010000000000100000000000100000100000010000100000000000000000000000000000000000100000000000000000000100110000010001010000111000000000000000000000000001000000010001000000000001001000000000000000000000010001000": TestData(n, 2) = "?"
  582.     n = n + 1: TestData(n, 1) = "00000000000100000000000000000000010000100001000001000000000001010000000001000000000000100000000000000000000000000000000000000110000000100000010000000001000000000100000000000000000000000100000001001000000000000000100000000000000000010000000000000000111000000000010000010000001000000000000000001010000000000000000000101001100000000000000100001000000000000000000000000000000000000101010001000100000000000000000100000000010000000000000010000000000000000000000000000100000000000000000000000100000100000000": TestData(n, 2) = "?"
  583.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "?"
  584.     n = n + 1: TestData(n, 1) = "00000000001000000000000000000010010101001001000000100000000011110001000011001100000100010001000000111001010000010100001001100000000100001000001100000010110000000100100011000000000000000010000101101000100000011000101001110000001000111000100011100010001000001010000000000010000001100000000000011000000000010111000000000100001000000000000000000001000001000001000100010000011100001000001100000001000110101000001010000000000000000000000011000000000000001000000011001000001010000001010101100010010000000100": TestData(n, 2) = "?"
  585.     n = n + 1: TestData(n, 1) = "10000001100110110010010000000000001000000000100011100010000010100101010001100000100010001001001111110010000010000101001100000110000100100000111100000111100101010000101000010000000010000111010000000011000000101100001010000100100000001010101001100001010110001000010100001100100000000110100101000110000101101110010101000011010010100110010000100010110111000010011000000000100111000010110110011110000010010001010011101101101110010011000011110010010011000001100000100000100000000010011011000110010000000000": TestData(n, 2) = "?"
  586.     n = n + 1: TestData(n, 1) = "01001100101100110101101011000000100000111001001011100101010010101101000111100010010110100100001100011111111100111111100001010100100000111110000001000101010110000110010000010100100110010001000001110110010111100101001011111011011000000100000000110001110000010010001010011000010001110001001010111111001100101011010101111100110010001001010100011001000000010010000111100011100100111001100000000000100001111111100000000111111000100010001101101100011100011110011010111101001010010100001011000010100100100011": TestData(n, 2) = "?"
  587.     n = n + 1: TestData(n, 1) = "00100100110010011100000010000100010011110000101011111000110110100000110111000100000100000011110100000011001000010010011110010000110011111010111001101111001001000011000011000000101101000011100000010101001011100000110010010010011000011100000010001000110011000011001111101100011101011010100001101100110000100001010110000001011111011100110000010100000001000010000000000010010000000000011000101011001001101000000010000000100000010001000001100110000101001111000000000011000000100100010010001111100010000100": TestData(n, 2) = "?"
  588.     n = n + 1: TestData(n, 1) = "00000100010010000111111000011000001000001000000010000110111000100100001000000000101010100010101001111011111100010001000000110000000011001100100001000000001000000000000000100000011010100101111000011001001011100011010110010000000000011111101000100000110101011011001100110111101000011010000100001010000000101110110110010100100111100100000000000100010001001000011000000000000010000000100000000000110000001000100000000011000110010000000001100010010000000001000101001111000011010111001001000100000110110110": TestData(n, 2) = "?"
  589.     n = n + 1: TestData(n, 1) = "00010011011010111001011100100100101100010110100111001001100011000011110101001110111001000010011000011001000000001000010100110101010000000111101000100110011111100000000010110000010001110001100101000011100001010011000010000111101110000111000100010110101001110001100010000000010001111000110001110001000001100000110111111110000101110100000101000011110011000101001101101100001000100100000000000001000000000100000101000001001000110110110001010010000001010100001101000010100000000001010001111000011010100101": TestData(n, 2) = "?"
  590.     n = n + 1: TestData(n, 1) = "00000000000000001001100001001000010101000000010001000000000001010000000000001000000000000000000010100001100000100010010000100000000011000001001111000000000101011100000101110001100000001100000100000100000101001000100010000100101110000000010000101101110101000111000010110011000000111010000110100101110001000000001001101000010000010001000010010000100110000011010000100001001000100011000010000000000000100000010000101100100000010000001100000100000000000000000000001000000110100010100110000010001000010000": TestData(n, 2) = "?"
  591.     n = n + 1: TestData(n, 1) = "00100000010001011000001000001010000100100001100111000000010001010001000001001011001011101000001010000001001010001010011100100001011000010100010011010100000000001000010011100000000100000100000110000101011001011100010111000000100011001010011100110111011010100100000000100000000000000001000100010000011001000000001001101000000110001000010011111000101000000000000010000100000000100000000000000000000000001100010000001111100110000101001000110000010000000101000001001000110000001000001100011000010011000000": TestData(n, 2) = "?"
  592.     n = n + 1: TestData(n, 1) = "00100000000000001000111000000010010001100011000011000100111000001100000111000100010000000001010011001000001000000011111000011100100000000000000100001100010010010100000010000011111101010010100101100000001110010010000100000000000001010000000000000001010010010001000000100000011111000011010001001100000000100011101000000001001010000000001101111101011000100000110011000000001001000000010000000000011010000001001001000100000000110110010000110011000000000010010110100000100001001010100000000001000100001000": TestData(n, 2) = "?"
  593.     n = n + 1: TestData(n, 1) = "00001100001100010100000100001111110011001111010000111001001111100010101101011000101100010010101010000011010111100100101100001110011001100000001011000111010000111000001100010000000100100111000100100000010101110100010000101010101110111011101001111000010110111110010000110110001010001111100101100011101010011010100110000101010110010100111101100100011000001011111110111001001101100000000001010011000010100000011001001011110000000000010100000000000100111110001000100101000100000000001000001001110000000000": TestData(n, 2) = "?"
  594.     n = n + 1: TestData(n, 1) = "00001010001000010000010100010010000011000010000110000010101110101011000011000000100101100000010000001100101010000100010000001101001000010001100110000110010000000000101000000000000001101000100000110110000010100110000111100110000000100000000010110000100000011000010000010001000100010001000001100001101000010010001000000110000010100000000010010110100010010011000100100110000111110001000010111000010101100010000001000010010001001001010000010000000010110110011000101001011000011011000100011100100000010010": TestData(n, 2) = "?"
  595.     n = n + 1: TestData(n, 1) = "00100000001000011000000000100010000000001010010000000100000100001000010100001100001000110000100010011101001000010000010000000100001010100100001000000100110000100111010000110000110010000010010000101001011101100010000100000100000000000100000000001011000000000000001100000100000000001010000011000100000110011000010001100000000000001000001000011000001000110011000000000100001010000000011010100000010001000100000100000010100000110100000011001010110000000000000011000000000000000000010100011010001100001101": TestData(n, 2) = "?"
  596.     n = n + 1: TestData(n, 1) = "00110011100000011100111100110011001100001100110110110011010111111001111100110000001001010100001001010111110101100100111110000111111111100111101011100011001111010100100000010001111111001101111111100111001111001111111001110010000101101111001100111000011110011001111100100111010100110010110111010111111110001111111100101011000101111110011011011111001110000001001111001111000011111000001011110000111110011111111101110100111111011001011111110010000010010010000010010000110011110101110101000011111100111110": TestData(n, 2) = "?"
  597.     n = n + 1: TestData(n, 1) = "00100101100100010000001001001010000001110100000101000000001011001000110101000111000110111001000000100001000100100110000000010001001010000010001000000000001000010001000100010100110110110000010100001010010100010100011100000010101110000101000101000000011000110101011100001000000000100011100111010010010000100111000010010000010000101010000001000000100000010000001010100000001000000000001010000000010001010000001101001111001110110010000001000000110100000010001000000000000010001000100100001110000100110010": TestData(n, 2) = "?"
  598.     n = n + 1: TestData(n, 1) = "01100010000100001101011110010000001010011110010010000110000100000001001011000011110000110001111000000000110100000001100000010100001000000001000001010010000000001000011100001010011010010011010001000000110011011001000001000011100001100000000100001110000011111110101000110100001000101000000111000100110110100000010000000011100000110100100010000000101001001100000000001010001010000001100100110000000100000111000001100010000000000000110010001000011001000101000000000000000000000000100000000001100000101000": TestData(n, 2) = "?"
  599.     n = n + 1: TestData(n, 1) = "00100000100001101010000001000100010000001011111101011101011111100010100000000000000010110100100001000000000000001010001000000100111001011010000000101000001001000000110011000101010010001110010000000000010001000100001010100000010010011011001000111010100000000000011000000101010010001100100011111110000110000000011100001100010101000001010101000010001010000000000000100000001011111110000000100000100000010100001010010011010111000011000010101101010010111000000000000001000001001011001010000100000010001010": TestData(n, 2) = "?"
  600.     n = n + 1: TestData(n, 1) = "11100000010000010110100000000110001000000001100000111000010000101001011110000100010000110100000101000011110000000000100100101010111011010000001110000010000110000001100010010000111010001100010001001000010110001000000110111001010001111110000010000100100100000000101110010000001100010110010011101001001001000000100000000000100010001001100110100011000001011100000100000010101000010001001010011000010011100010010100000010000001111000001001110000110011010001100000110001011000000000000101001011000101000000": TestData(n, 2) = "?"
  601.     n = n + 1: TestData(n, 1) = "00110000001110000010001000000100100000010101100000011000110000100100000001110011000001110101000001000000000110000000000001010000111001010000010000000000000000100110100110100000010011011100111000110000011000110000100010100010110000011010010100000000100000110100001000000000000001100100000111101000010000100000000001000000000000100001001100010010110000000011100000010000011100010000000000000101000000001000000001000010000001000000000000100000010010010000000001000011000000010100100000000000010000100000": TestData(n, 2) = "?"
  602.     n = n + 1: TestData(n, 1) = "10011001110100010000011010000011000010011011011001010111100001100010110101001010000001100011000000110000000000000000101101000011101110110000111111111110010000110100001110011001011000110101001100000010111110001010001000011011011001010000000100000110001010010000011110100010100011000101110110100100110000011000100001010100110011001110010000001001110010001100000010100110101111010110000101000111111010000100111000001110000000000000000000110001101000000011110001011110000100000000000100110010000100111000": TestData(n, 2) = "?"
  603.     n = n + 1: TestData(n, 1) = "01111000100000000100000001000001101000000000000101000000001011010001101010111000010011110010000000000000111011000010110011000000001000100110010000000110111000000000000000000100011010000000011001010100010010001100001000000001000011100001000000000100000000000000111000010000001001000000101011010010000000011000000000000000111000000000100011001100010001001100000000100111001000000001000001010001000000011010001000000011100110000110000100000010010001000001000000000010000000111100010000010101011000000111": TestData(n, 2) = "?"
  604.     n = n + 1: TestData(n, 1) = "11010000010110110011000011100001011111011000011110011101100000110000100000010000010001010000111110010110101001000000101110000110001000010001110100000010000001000011101101010000110010001100000100000011101100100001000000001100111001010100000100110001011100010000010111001110000100010010000010001111100000100100100001000110110001100110001101111011000001011001000000011100100101010011001100101011010001100010011010001001000001101101111011011111000011110010011000000000010010110010000000110001000100110111": TestData(n, 2) = "?"
  605.     n = n + 1: TestData(n, 1) = "00000100000010111110001000101100000010001010000000101101111001011001001011100000010101110001111001010110010000111100000010000111100100111101001000001110000110110001000000100011001101000011111101100101100011000100010101001000111111000011100000101010011000100011010000000000001100000001100111000000010111000000000100101000000110001000110000000000001000100001111000000010011001111000000010100000000001010110001101001000101000001100000100000010000011110010110111000011101011111100000110100011001100010000": TestData(n, 2) = "?"
  606.     n = n + 1: TestData(n, 1) = "10101110010100010000010000010000011111110110000001100001001110100001000011000000100100100000011001101101011010010100101000010000100111001010010001001100011000100010110010001111000000101000100001111011000001100000111111100110010011000000100011011000000110000000011100010011000100111111100001000001010001111100000100100100001101100100100000010010100111100101001000110011010111110010000111101000101001010001000101000010011001000111101011100010001000110010010111000011000010010100000000000010001000110010": TestData(n, 2) = "?"
  607.     n = n + 1: TestData(n, 1) = "00000111101011000100000110000011010111110011111001001111011000010000010010010101000001000001100100100000000010000000111110010110001100110000110011000110010001000100110011111000000001111100111111001000001001001110011010010000011001100001010000000011111111110100011111100100001011111111010000001100010100011010100000110010011100111010000011001110000000001101001010000001110011000010011100001000110010100011111100100001111110011100011111100100000110100100100001001001101100000000000110011000001000000010": TestData(n, 2) = "?"
  608.     n = n + 1: TestData(n, 1) = "11111110010011111111100001100100100001111111110110101011110000111101011111111111110011100111111001100111111111111111110010101010111111110011111111110011110010000001111111100111111110111000111111100001100010011001111111111011100010101101000100111111111010110011110011110011100111100001000101111100111001010111001010111111100001111011000100000111111001000111100100111111111000000001000000110110111001111000001010011001111111011011111000000100111110101100000011111111001111100001101100011010001111111100": TestData(n, 2) = "?"
  609.     n = n + 1: TestData(n, 1) = "00111010110000001111101100000000010100000110001000000001010110100100011011110111100001001110000000000000000100001000010101011010001011101000111011010010000000000001101101101001101001100001110000100100100111000110000101101010100000010010001000001100110000001011010000000000100000011010101100001001001101100100010010100001100001001100101000000000000000110010101010000000111001010111100100110001000011001100111111011001101110000010000111101000001100000000000000100010111110100010101000001011100001111001": TestData(n, 2) = "?"
  610.     n = n + 1: TestData(n, 1) = "00000001000011100110011001101000000000001110000001011000100011000001000101111001101110011101101111101110111100100010010110110011001000100000100000000101110010000010100111011110000111101001011001111100000110000110011001010001000000011100001111111101111100101101111011000000000100000000001111011000000001001011100100010001000001001100010000010011001110011000110011101001010110100110001110010000101111111011101101101100000010000100001100001100100011101011110110000110000010100110100010000110100110100100": TestData(n, 2) = "?"
  611.     n = n + 1: TestData(n, 1) = "10111000101111101010011001001100001111110011000111011010000001110001010110100110011010110000011100110011100010100101010010001100010010000111001010111011000110110100000000110010100011001010001100111111111010001111001101000111010111111100100010000011110010011010100100100110001000010010011101010000000000100011001000011111001110010011101100011111110010000111100001001001001000100001000101111001001000111000110011001010101010010101100000010101000011100011001000001000100110000000000000111000001110010001": TestData(n, 2) = "?"
  612.     n = n + 1: TestData(n, 1) = "11111001000101111111100011111101110101111110110001111101010100010000111111111111111110011111001110101111001101011111100010111111110100011100111110101110011001110011111111100101011000000101011100110110111100000101110000100100111110011110000111111111011011111100001100100110011001001101000001000101111001111101011101010110111100011100010011001000010000111110010001011110011111111111111001010111111101011111001110000000101001111010100111111101011000100101000011111001011001010011001101000110000100111111": TestData(n, 2) = "?"
  613.     n = n + 1: TestData(n, 1) = "11001000011100110101111111001111010111100011011111101101101011011101101010011111111010111001110011110011111001000011111111111110001011111100111000011111111111111011000110011100110011001111010000010010011011011111101010011100111111111001111111001100111111101001101111010111110101100111111110011111110101101110010010001101000000011111110000001111111111111100000101000000111100011011001111111110011101110010101011111111000110111010001100100111111111111111111100001110011000011100001100011010001100000111": TestData(n, 2) = "?"
  614.     n = n + 1: TestData(n, 1) = "01110000001111111111110011101001011000011111111111001111111100111111111111010110100011111110101110101001110000111000011111111001000000111100111100111100111101010011100111111110011111111100100111010001111111001100111001111111110011111111111101011111111000011111110100010101111110110111000010011110000100111010110010011111111100100111111111111111101101111100101010011110110110011110000110000001101101111101101111110011111111001111111101101101000100111101011101011111111001001111111111100110011111110010": TestData(n, 2) = "?"
  615.     n = n + 1: TestData(n, 1) = "00100110010011111110100011001111110011100111111111111111111111111100010111101000111111010111111010111010010111111001000011100111111111001111001111111111111100111111111111110101001010111101010010011100101011111000001010110111001100110000111111110011001101010011101010011111111100100110011111110101001111111100100001110011100111111111111111110011111111001110000010111001111001101100010000111111001101001011111111111010110001011111110011111111111001000011100001100110000111111100110010011100101011001111": TestData(n, 2) = "?"
  616.     n = n + 1: TestData(n, 1) = "01111001111110000010111001111101011111111000000101011111111100100111100001111111001101011110011110000111100111111110100101110000100001000010111101110101110000010001001110101111100100111111010010001100111111111111100111111111111111111110011111111110010011111100100001000011001001110011111111111111111111100001111111001000010011111111100111111100100001000011111111111111000000111111111001010110011111100110011001110011100111110011100111110011111010111100111111100000011111111110011110011001001101011100": TestData(n, 2) = "?"
  617.     n = n + 1: TestData(n, 1) = "11111111111101101111111100111001111110010011111000011010111111111110011110011111110010011111111111111100111111111111100111110011111111111001111111110110111111111111000101000011111111111001000011110100010010011111001111110010111010000111110010011111111001001110011111111101010011100000011100111111010100001110011111111111111111110110111100101110111111111010111100111111111111111100001110000110011111111111100100111111111111010111100111111001100111111111100001111111111111101010110111111001111111100001": TestData(n, 2) = "?"
  618.     n = n + 1: TestData(n, 1) = "10111001000011101011111011000110000100101000111000011110110001111100111101101000000001110010100001000111001001111010101011010110011110100110010101101001100001001000000100110000001011011111010000101010001011001011111101001011010110011010100100110101010101011000000111010110101000100111000000010000100111000111000001000101111101011100000011100111000001001011000000000011001011110010110000110001111111010101110110111110101010000001011011101111011100010101001110000111101001010001011001100100110011101111": TestData(n, 2) = "?"
  619.     n = n + 1: TestData(n, 1) = "00011000111110101110110100111010001110101001010110011110000101101100100000101000111000111100001111101110110011110111010010011111011100101001010110000110011110011001111000000100110101010010111100001111101010011101110110000111111100000101111100101011110000010001000111111010111100101010111110010011111100111100111100100000011111100100111101111011010111000110011101110000110011001010110101110001000100000100001001010101010111110001011110000011011111100110011001111110011111011000100110011001100000110100": TestData(n, 2) = "?"
  620.     n = n + 1: TestData(n, 1) = "11111000010101110101001110011110000111001101100000010000110100111100111110101000011100001000001011101001100110100101001100110101101100001111001000101101100010010011110100010000101011010110011011011001100001100111111001011001100101010111000111000010111111101011101011010100001101011010000001010101101011001100111010110011101010010010000100001101010101011101111000010010100110111101101110011101001001011111101000111101011000010001110000110010001100101010101111010111100101100001000000111101101011000010": TestData(n, 2) = "?"
  621.     n = n + 1: TestData(n, 1) = "10000000000101100111000000010100011011010001111000101010111110011101101100011101001101111001000100100100000101111001110010011110010100011010100111111111101000100011000101010011111000011001111000011000000100010001000011100110111000001010111101001101001000100010001011100111111001111010011010010010111011111011001110111000001000110000101011010010010000010001100011100101010101101011111000111011101010101111111010001011000111110011111100010001010011011000100110011010101010110011100011010011111000111011": TestData(n, 2) = "?"
  622.     n = n + 1: TestData(n, 1) = "11010000010011101000010111000000011000011010011110010011001110001001010110110011100111000000101011100110101001110011110000000001110100001010111111111111001011011110000001100111111010100111110101001100010110000010101100110001000010011010100001001100110011101101111100100110110110111010100100010011000110111001101001110111101010010000011011001001110011111111010000011111011100111010111110110101011011110010011010000100101000010001001011100111100110101010101011001011011001100110101001111001010000100010": TestData(n, 2) = "?"
  623.     n = n + 1: TestData(n, 1) = "11010110011010111111001111010011110111100111001110010011101000111010010011001100011110011010000101010110111101011101101011010001111011001111010000011010110000100100011111000001110100110000100110010000111111010010100111000100101110110100110000001010111100010000101000100010100111000111000010000010010110101111001000010010011100111010000111010111011011011000010101100111100110010101001101101101100101100111100110110001101001001001011111001110100010101101110000010101111101010011111000111100000111010110": TestData(n, 2) = "?"
  624.     n = n + 1: TestData(n, 1) = "00000100110111011101011011011101001011000100011001010111110100001100000011011001110010110011101111001111111000100111010101100111001111001101100001001110111110010110110101001001001010001100001100001010101011001100000100011000001010101001100100100100001111010110011101101110100101111100101001101001001010110010001011111111110010111001100000011101111101001101100101100101110101101100111000111010001110000111100100000100011000010110111110011000000101000111111001110011011111000110111101010111100001001101": TestData(n, 2) = "?"
  625.     n = n + 1: TestData(n, 1) = "01111111101101010001101000100100111100001101111000111100011111000111111101101001100100110001101111001100110100010110111100010010111111100001100011010010101111111111001111010010000000100001101101111010011101000110111110101110011111111101001000000000000011100001110101110100010011000111001011111100011110001110001001011001001101010100000101101100100001110110111111111111000100000100111011000111100111111000101110010110101010011010011011110100001011100001110011110111110010010000010100010110101011111010": TestData(n, 2) = "?"
  626.     n = n + 1: TestData(n, 1) = "01010010100000101100110000111011100101010111001101011001101011110001001011001111100011011101011110001100000001111100111010010010101101111101100100000110100010010101111110011111110011001101001001100011101000100010110001011000001111011001100101110001110111101110000011011010101111000001111000011010101101110101001011011111110101100100101100110011000010011101101001110111000011010111001100101100001101001001100101011100111010000010110100000101111111010001110000110101110101000110011001011011011101000110": TestData(n, 2) = "?"
  627.     n = n + 1: TestData(n, 1) = "11001000101011011111101000010000110111111111000011010000010101000000100110111110010000000111110110111111100110101010111110011010001110010110100101000010111111000000111100111000011100100111001100111111110100010110000010010011000111001110001110110100111110101111011010100010000101001001101111111101010101111010111111001001001111111100101011011011101001100000100010111110101010100001110000110011001110101100101000101000111100100101110110011111001101011001100011100101001001100010101010011001010001111101": TestData(n, 2) = "?"
  628.     n = n + 1: TestData(n, 1) = "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111": TestData(n, 2) = "?"
  629.     n = n + 1: TestData(n, 1) = "00100000000010000000000100000011000110110001001110101010010011010001100000101001000000000000010001110100001001101000001000000000010001101001011000010000000000010000000010011010011001001000000100000100000000001000000001000101001000001110001001000100000000000100000111000011010000000000010001000000110010000000011000000000100100001000001000010001001001110000000010000000100000000000000010000100000010000000101110011000001000100000011010100001010000001000010100000000001000001100000100010010000101100000": TestData(n, 2) = "?"
  630.     n = n + 1: TestData(n, 1) = "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111": TestData(n, 2) = "?"
  631.     n = n + 1: TestData(n, 1) = "00001101110100101100011001010001001010010110000110000000100001000100100110000000010010100011000100110000110000100010000011001000000000100000001000100100100001100110100000101000101000010001110001111001000101000000100100001000000001110110100010001001000100100000011011000001000000000101000010000100010000110101001010010010001000110010110000000110010000110000001000101010001001101111001000010000101100011000000110001011110000001111001000000000000011110011100000000101010000000101110001000100000000100000": TestData(n, 2) = "?"

p.s.

I dont think I understood

Quote
If the string value repeated, ie, the same value (0) or (1) carried over from the previous
event then the value is (1), if not then (0).
« Last Edit: December 13, 2021, 09:07:27 pm by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline random1

  • Newbie
  • Posts: 86
Re: Looking for old program or help recreating it
« Reply #55 on: December 13, 2021, 11:28:01 pm »
The new strings are built using the originals and based on rather the string value repeats
or changes.

Truth table
0 to 0 =(0) 
1 to 1 =(1)
0 to 1 =(0)
1 to 0 =(0)

It's just a reformatting of the string which can have a smoothing effect on the data which
seems to be somewhat easier to predict.  You don't need to do anything different, as were
still looking at predicting a zero or a one.  My software has a ascending / descending order
for all string option.  Some options require the data be fed in a certain order.

My math skills are lacking when it comes to higher level stuff so most of my tools are based
on statistics and pattern matching, maybe that's why most of them fail.  What I am working
on now is based on the logic used in the video that was posted.  The guy was able to come to
a high confidence level by the end of 20 games, the $100.00 bet.  The difference is that my
data may be too close to random to ever achieve this.  I am continuing to work on solutions
on my own but also using what you post at the same time.  If my post seem to fall outside
what your working on, then they can be safely ignored.

Anyway, thanks for your efforts and I will continue to follow your post as long as it takes
or your willing to address it.   There may not be the solution I'm looking for.  It's not just
a matter of finding the best, if the best falls short of my needs which is a possibility.


R1


   
« Last Edit: December 13, 2021, 11:39:55 pm by random1 »

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
Re: Looking for old program or help recreating it
« Reply #56 on: December 14, 2021, 09:45:59 am »
Hey R1, another day, another update, another summary, really.

So you're doing well by checking out and studying the video Steve linked. It implies a few lessons about n-grams, combinatorics, and other light-duty discrete math stuff. It's not a bad way to start thinking about this problem. Let me do you one better though. Luke clued me in to this website:

Quote
https://www.expunctis.com/2019/03/07/Not-so-random.html

...which does the "short game" version of what we're doing. You try to give the program a random sequence, and it will predict your next action pretty well. Zoom to this morning. I actually read the bottom of the website. Turns out the guy just uses 5-grams, and I thought "dude, this is just a special case of what I'm doing". So I commented a few lines and was able to copy the behavior from the website just about exactly:

  [ You are not allowed to view this attachment ]  

It's not terribly hard to "act randomly" for a while, but you're eventually caught. I've since modified my code a little since the screenshot, but below I kept the code in "game mode" with a few more experimental switches turned on. Try this out:

Code: QB64: [Select]
  1.  
  2. Screen _NewImage(120, 60)
  3.  
  4. ' Version: 8
  5.  
  6. Type LetterBin
  7.     Signature As String
  8.     Count As Integer
  9.  
  10. Dim Shared TestData(1000, 2) As String
  11. Call LoadTestData
  12.  
  13. Dim Shared Alphabet1(2) As LetterBin ' 0 1
  14. Dim Shared Alphabet2(4) As LetterBin ' 00 01 10 11
  15. Dim Shared Alphabet3(8) As LetterBin ' 000 001 010 011 100 101 110 111
  16. Dim Shared Alphabet4(16) As LetterBin ' etc.
  17. Dim Shared Alphabet5(32) As LetterBin
  18. Dim Shared Alphabet6(64) As LetterBin
  19. Dim Shared Alphabet7(128) As LetterBin
  20. Dim Shared Alphabet8(256) As LetterBin
  21. Dim Shared Alphabet9(512) As LetterBin
  22. Dim Shared Alphabet10(1024) As LetterBin
  23. Dim Shared Alphabet11(2048) As LetterBin
  24. Dim Shared Alphabet12(4096) As LetterBin
  25. Dim Shared Alphabet13(8192) As LetterBin
  26.  
  27. Alphabet1(1).Signature = "0"
  28. Alphabet1(2).Signature = "1"
  29. Call NewAlphabet(Alphabet1(), Alphabet2())
  30. Call NewAlphabet(Alphabet2(), Alphabet3())
  31. Call NewAlphabet(Alphabet3(), Alphabet4())
  32. Call NewAlphabet(Alphabet4(), Alphabet5())
  33. Call NewAlphabet(Alphabet5(), Alphabet6())
  34. Call NewAlphabet(Alphabet6(), Alphabet7())
  35. Call NewAlphabet(Alphabet7(), Alphabet8())
  36. Call NewAlphabet(Alphabet8(), Alphabet9())
  37. Call NewAlphabet(Alphabet9(), Alphabet10())
  38. Call NewAlphabet(Alphabet10(), Alphabet11())
  39. Call NewAlphabet(Alphabet11(), Alphabet12())
  40. Call NewAlphabet(Alphabet12(), Alphabet13())
  41.  
  42. Dim thestring As String
  43. Dim actual As String
  44. Dim prediction As Integer
  45.  
  46. Dim Shared predictedGuess As Double
  47. Dim Shared correctGuesses As Double
  48. Dim Shared totalGuesses As Double
  49.  
  50. predictedGuess = Rnd
  51. correctGuesses = 0
  52. totalGuesses = 0
  53.  
  54. m = -1
  55. thestring = ""
  56.  
  57.     ' If analyzing pre-cooked data, load a test string.
  58.     If (m > 0) Then
  59.         thestring = TestData(m, 1)
  60.         actual = TestData(m, 2)
  61.     Else
  62.         actual = "?"
  63.     End If
  64.  
  65.     Cls
  66.     For k = 1 To _Width
  67.         Print "-";
  68.     Next
  69.  
  70.     If (m > 0) Then
  71.         Print
  72.         Print "Case:"; m
  73.         Print
  74.     Else
  75.         Print
  76.         Print "Press 0 or 1 as randomly as you can. I've already guessed your next input."
  77.         Print
  78.         Print ">"; thestring
  79.         Print
  80.         Print "My previous guess was: "; _Trim$(Str$(predictedGuess))
  81.         Print "I have been correct at a rate of "; _Trim$(Str$(Int(100 * correctGuesses / totalGuesses))); "%"
  82.     End If
  83.  
  84.     prediction = Analyze(thestring, actual, 0)
  85.     predictedGuess = prediction
  86.  
  87.  
  88.     If (m > 0) Then
  89.         'm = UserInput1(k, m)
  90.         _Delay 1
  91.         m = m + 1
  92.     Else
  93.         thestring = UserInput2$(k, thestring)
  94.     End If
  95.  
  96.     _KeyClear
  97.     _Limit 30
  98.  
  99.  
  100. Function Analyze (TheStringIn As String, ActualIn As String, pswitch As Integer)
  101.     Dim TheReturn As Integer
  102.     Dim As Integer n
  103.     Dim As Double r, j, k, h
  104.     Dim Fingerprint(16) As String
  105.     Dim p(2 To 10, 2) As Double
  106.  
  107.     ' Create shifted versions of string, i.e. ABCD -> BCDA, CDAB, DABC, ABCD, BCDA, etc.
  108.     Fingerprint(1) = TheStringIn
  109.     For n = 2 To UBound(Fingerprint)
  110.         Fingerprint(n) = Right$(Fingerprint(n - 1), Len(Fingerprint(n - 1)) - 1) + Left$(Fingerprint(n - 1), 1)
  111.     Next
  112.  
  113.     ' Initialize partial results.
  114.     For n = LBound(p) To UBound(p)
  115.         p(n, 1) = -999
  116.     Next
  117.  
  118.     Call CreateHisto(Fingerprint(), Alphabet2(), 2, 0) ' Set the last number =1 to print steps.
  119.     Call CreateHisto(Fingerprint(), Alphabet3(), 3, 0)
  120.     Call CreateHisto(Fingerprint(), Alphabet4(), 4, 0)
  121.     Call CreateHisto(Fingerprint(), Alphabet5(), 5, 0)
  122.     Call CreateHisto(Fingerprint(), Alphabet6(), 6, 0)
  123.     Call CreateHisto(Fingerprint(), Alphabet7(), 7, 0)
  124.     Call CreateHisto(Fingerprint(), Alphabet8(), 8, 0)
  125.     Call CreateHisto(Fingerprint(), Alphabet9(), 9, 0)
  126.     Call CreateHisto(Fingerprint(), Alphabet10(), 10, 0)
  127.     'Call CreateHisto(Fingerprint(), Alphabet11(), 11, 0)
  128.     'Call CreateHisto(Fingerprint(), Alphabet12(), 12, 0)
  129.     'Call CreateHisto(Fingerprint(), Alphabet13(), 13, 0)
  130.  
  131.     If (pswitch = 1) Then
  132.         If (Len(TheStringIn) >= 2) Then Call PrintHisto(Alphabet2(), 3) ' Set the last number >=1 to print stats for that histogram.
  133.         If (Len(TheStringIn) >= 3) Then Call PrintHisto(Alphabet3(), 3)
  134.         If (Len(TheStringIn) >= 4) Then Call PrintHisto(Alphabet4(), 3)
  135.         If (Len(TheStringIn) >= 5) Then Call PrintHisto(Alphabet5(), 3)
  136.         If (Len(TheStringIn) >= 6) Then Call PrintHisto(Alphabet6(), 0)
  137.         If (Len(TheStringIn) >= 7) Then Call PrintHisto(Alphabet7(), 0)
  138.         If (Len(TheStringIn) >= 8) Then Call PrintHisto(Alphabet8(), 0)
  139.         If (Len(TheStringIn) >= 9) Then Call PrintHisto(Alphabet9(), 0)
  140.         If (Len(TheStringIn) >= 10) Then Call PrintHisto(Alphabet10(), 0)
  141.         'If (Len(TheStringIn) >= 11) Then Call PrintHisto(Alphabet11(), 0)
  142.         'If (Len(TheStringIn) >= 12) Then Call PrintHisto(Alphabet12(), 0)
  143.         'If (Len(TheStringIn) >= 13) Then Call PrintHisto(Alphabet13(), 0)
  144.         Print
  145.     End If
  146.  
  147.     If (Len(TheStringIn) >= 2) Then Call MakeGuess(TheStringIn, Alphabet2(), 2, p(), pswitch) ' Set the last number =1 to print guess for that histogram.
  148.     If (Len(TheStringIn) >= 3) Then Call MakeGuess(TheStringIn, Alphabet3(), 3, p(), pswitch)
  149.     If (Len(TheStringIn) >= 4) Then Call MakeGuess(TheStringIn, Alphabet4(), 4, p(), pswitch)
  150.     If (Len(TheStringIn) >= 5) Then Call MakeGuess(TheStringIn, Alphabet5(), 5, p(), pswitch)
  151.     If (Len(TheStringIn) >= 6) Then Call MakeGuess(TheStringIn, Alphabet6(), 6, p(), pswitch)
  152.     If (Len(TheStringIn) >= 7) Then Call MakeGuess(TheStringIn, Alphabet7(), 7, p(), pswitch)
  153.     If (Len(TheStringIn) >= 8) Then Call MakeGuess(TheStringIn, Alphabet8(), 8, p(), pswitch)
  154.     If (Len(TheStringIn) >= 9) Then Call MakeGuess(TheStringIn, Alphabet9(), 9, p(), pswitch)
  155.     If (Len(TheStringIn) >= 10) Then Call MakeGuess(TheStringIn, Alphabet10(), 10, p(), pswitch)
  156.     'If (Len(TheStringIn) >= 11) Then Call MakeGuess(TheStringIn, Alphabet11(), 11, p(), pswitch)
  157.     'If (Len(TheStringIn) >= 12) Then Call MakeGuess(TheStringIn, Alphabet12(), 12, p(), pswitch)
  158.     'If (Len(TheStringIn) >= 13) Then Call MakeGuess(TheStringIn, Alphabet13(), 13, p(), pswitch)
  159.     If (pswitch = 1) Then Print
  160.  
  161.     If (pswitch = 1) Then
  162.         Print "Analyzing:"
  163.         Print TheStringIn
  164.  
  165.         Print
  166.         Print "Thinking:";
  167.         For k = LBound(p) To UBound(p)
  168.             If (p(k, 1) <> -999) Then
  169.                 Print p(k, 1);
  170.             Else
  171.                 Print "_ ";
  172.             End If
  173.         Next
  174.         Print: Print
  175.     End If
  176.  
  177.     j = 0
  178.     r = 0
  179.  
  180.     For k = UBound(p) To LBound(p) Step -1
  181.         If (p(k, 1) <> -999) Then
  182.  
  183.             ' This is the made-up part of the model:
  184.             ' The variable r contributes to weighted average.
  185.             ' The variable j is used for normalization.
  186.             ' Scaling factor h influences weighted average calculaton.
  187.             ' The factors multiplying h are totally arbitrary. Notes:
  188.             '   setting o(h^2) means the later alphabets count for more.
  189.             '   p(k, 1) euqals the calculated guess at frequency k.
  190.             '   p(k, 2) euqals the peak count of the unscaled histogram.
  191.             '   ...while p(k, 2) is here, it does not seem to help calculations.
  192.  
  193.             h = 1 + k - LBound(p)
  194.  
  195.             h = h ^ 2
  196.  
  197.             ' Standard weighted average:
  198.             r = r + h * p(k, 1)
  199.             j = j + h
  200.  
  201.         End If
  202.     Next
  203.     If (j <> 0) Then
  204.         r = r / j
  205.     End If
  206.  
  207.     If (pswitch = 1) Then Print "Predicting:  "; _Trim$(Str$(r))
  208.  
  209.     If (r > .5) Then
  210.         r = 1
  211.     Else
  212.         r = 0
  213.     End If
  214.  
  215.     If (pswitch = 1) Then
  216.         Print "Rounding to: "; _Trim$(Str$(r))
  217.  
  218.         ' Just for show, do the most naive thing possible by counting 1's.
  219.         n = Len(TheStringIn)
  220.         h = 0
  221.         For k = 1 To n
  222.             If Val(Mid$(TheStringIn, k, 1)) = 1 Then h = h + 1
  223.         Next
  224.         h = h / n
  225.         Print
  226.         Print "Naive (dec): "; _Trim$(Str$(h))
  227.         If (h > .5) Then
  228.             h = 1
  229.         Else
  230.             h = 0
  231.         End If
  232.         Print "Naive (int): "; _Trim$(Str$(h))
  233.  
  234.         ' Compare result to actual/known data if it was specified.
  235.         If (ActualIn <> "?") Then
  236.             Print
  237.             Print "Actual:      "; ActualIn
  238.             If (_Trim$(Str$(r)) <> ActualIn) Then
  239.                 Beep
  240.                 Print
  241.                 Print "*** MISMATCH ***"
  242.             End If
  243.         End If
  244.  
  245.     End If
  246.  
  247.     TheReturn = r
  248.     Analyze = TheReturn
  249.  
  250. Sub MakeGuess (OrigString As String, arralpha() As LetterBin, wid As Integer, arrbeta() As Double, pswitch As Integer)
  251.     Dim TheReturn As Double
  252.     Dim As Integer j, k, n
  253.     TheReturn = 0
  254.     j = 1 '0
  255.     k = 0
  256.     For n = 1 To UBound(arralpha)
  257.         If (Left$(arralpha(n).Signature, wid - 1) = Right$(OrigString, wid - 1)) Then
  258.             If (arralpha(n).Count >= j) Then
  259.                 If (pswitch = 1) Then Print "Order-"; Right$("0" + _Trim$(Str$(wid)), 2); " guess: "; arralpha(n).Signature; " . "; _Trim$(Str$(arralpha(n).Count))
  260.                 TheReturn = TheReturn + Val(Right$(arralpha(n).Signature, 1))
  261.                 k = k + 1
  262.                 j = arralpha(n).Count
  263.             End If
  264.         End If
  265.     Next
  266.     If (k <> 0) Then
  267.         TheReturn = TheReturn / k
  268.         arrbeta(wid, 1) = TheReturn
  269.         arrbeta(wid, 2) = j
  270.     Else
  271.         TheReturn = .5
  272.         arrbeta(wid, 1) = TheReturn
  273.         arrbeta(wid, 2) = j
  274.     End If
  275.  
  276. Sub CreateHisto (arrfinger() As String, arralpha() As LetterBin, w As Integer, pswitch As Integer)
  277.     Dim As Integer j, k, n
  278.     For n = 1 To UBound(arralpha)
  279.         arralpha(n).Count = 0
  280.     Next
  281.     For j = 1 To w '1 'w
  282.         For k = 1 To Len(arrfinger(j)) - (Len(arrfinger(j)) Mod w) Step w '- 0 Step 1 'w 'make the 0 a -w? might not matter at all
  283.             If (pswitch = 1) Then Print j; " "; arrfinger(j)
  284.             For n = 1 To UBound(arralpha)
  285.                 If (pswitch = 1) Then Print "@@@"; n; " "; Mid$(arrfinger(j), k, w); " "; arralpha(n).Signature;
  286.                 If (Mid$(arrfinger(j), k, w) = arralpha(n).Signature) Then
  287.                     arralpha(n).Count = arralpha(n).Count + 1
  288.                     If (pswitch = 1) Then Print "***";
  289.                 End If
  290.                 If (pswitch = 1) Then Print
  291.             Next
  292.         Next
  293.     Next
  294.     Call QuickSort(arralpha(), 1, UBound(arralpha))
  295.  
  296. Sub PrintHisto (arr() As LetterBin, w As Integer)
  297.     Dim As Integer j, n
  298.     If (w > 0) Then
  299.         If (w > UBound(arr)) Then
  300.             j = UBound(arr)
  301.         Else
  302.             j = w
  303.         End If
  304.         Print "Histogram: "; _Trim$(Str$(UBound(arr))); "-letter regroup, showing top "; _Trim$(Str$(w))
  305.         For n = 1 To j
  306.             Print arr(n).Signature; arr(n).Count
  307.         Next
  308.     End If
  309.  
  310. Function UserInput1 (TheKeyIn As Integer, PresentIndexIn As Integer)
  311.     Dim TheReturn As Integer
  312.     Dim As Integer j, k
  313.     k = TheKeyIn
  314.     j = -1
  315.     Select Case k ' Arrows
  316.         Case 19712
  317.             j = PresentIndexIn + 1
  318.         Case 19200
  319.             j = PresentIndexIn - 1
  320.     End Select
  321.     TheReturn = j
  322.     UserInput1 = TheReturn
  323.  
  324. Function UserInput2$ (TheKeyIn As Integer, TheStringIn As String)
  325.     Dim TheReturn As String
  326.     Dim As Integer k
  327.     Dim As String t
  328.     k = TheKeyIn
  329.     t = TheStringIn
  330.     Select Case k ' 0, 1
  331.         Case 48
  332.             t = t + "0"
  333.             If predictedGuess = 0 Then correctGuesses = correctGuesses + 1
  334.             totalGuesses = totalGuesses + 1
  335.         Case 49
  336.             t = t + "1"
  337.             If predictedGuess = 1 Then correctGuesses = correctGuesses + 1
  338.             totalGuesses = totalGuesses + 1
  339.     End Select
  340.     TheReturn = t
  341.     UserInput2$ = TheReturn
  342.  
  343. Sub NewAlphabet (arrold() As LetterBin, arrnew() As LetterBin)
  344.     Dim As Integer j, k, n
  345.     n = 0
  346.     For k = 1 To 2
  347.         For j = 1 To UBound(arrold)
  348.             n = n + 1
  349.             arrnew(n).Signature = arrold(j).Signature
  350.         Next
  351.     Next
  352.     For j = 1 To UBound(arrnew)
  353.         If (j <= UBound(arrnew) / 2) Then
  354.             arrnew(j).Signature = "0" + arrnew(j).Signature
  355.         Else
  356.             arrnew(j).Signature = "1" + arrnew(j).Signature
  357.         End If
  358.     Next
  359.  
  360. Sub QuickSort (arr() As LetterBin, LowLimit As Long, HighLimit As Long)
  361.     Dim As Long piv
  362.     If (LowLimit < HighLimit) Then
  363.         piv = Partition(arr(), LowLimit, HighLimit)
  364.         Call QuickSort(arr(), LowLimit, piv - 1)
  365.         Call QuickSort(arr(), piv + 1, HighLimit)
  366.     End If
  367.  
  368. Function Partition (arr() As LetterBin, LowLimit As Long, HighLimit As Long)
  369.     Dim As Long i, j
  370.     Dim As Double pivot, tmp
  371.     pivot = arr(HighLimit).Count
  372.     i = LowLimit - 1
  373.     For j = LowLimit To HighLimit - 1
  374.         tmp = arr(j).Count - pivot
  375.         If (tmp >= 0) Then
  376.             i = i + 1
  377.             Swap arr(i), arr(j)
  378.         End If
  379.     Next
  380.     Swap arr(i + 1), arr(HighLimit)
  381.     Partition = i + 1
  382.  
  383. Sub LoadTestData
  384.     Dim n As Integer
  385.     '''
  386.     n = 0
  387.     '''
  388.     ' Test: counting linearly
  389.     n = n + 1: TestData(n, 1) = "000001010011100101110111": TestData(n, 2) = "0" '0 to 7
  390.     n = n + 1: TestData(n, 1) = "0000000100100011010001010110011110001001101010111100110111101111": TestData(n, 2) = "0" '0 to 15
  391.     n = n + 1: TestData(n, 1) = "0000000001000100001100100001010011000111010000100101010010110110001101011100111110000100011001010011101001010110110101111100011001110101101111100111011111011111": TestData(n, 2) = "0" '0 to 31
  392.     '''
  393.     'n = 0
  394.     '''
  395.     ' Test: single-one patterns at stepping frequencies, all phases
  396.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0"
  397.     n = n + 1: TestData(n, 1) = "01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101": TestData(n, 2) = "0"
  398.     n = n + 1: TestData(n, 1) = "10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010": TestData(n, 2) = "1"
  399.     n = n + 1: TestData(n, 1) = "00100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100": TestData(n, 2) = "1"
  400.     n = n + 1: TestData(n, 1) = "01001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001": TestData(n, 2) = "0"
  401.     n = n + 1: TestData(n, 1) = "10010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010": TestData(n, 2) = "0"
  402.     n = n + 1: TestData(n, 1) = "00010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001": TestData(n, 2) = "0"
  403.     n = n + 1: TestData(n, 1) = "00100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010": TestData(n, 2) = "0"
  404.     n = n + 1: TestData(n, 1) = "01000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100": TestData(n, 2) = "0"
  405.     n = n + 1: TestData(n, 1) = "10001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000": TestData(n, 2) = "1"
  406.     n = n + 1: TestData(n, 1) = "00001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000": TestData(n, 2) = "0"
  407.     n = n + 1: TestData(n, 1) = "00010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000": TestData(n, 2) = "1"
  408.     n = n + 1: TestData(n, 1) = "00100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001": TestData(n, 2) = "0"
  409.     n = n + 1: TestData(n, 1) = "01000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010": TestData(n, 2) = "0"
  410.     n = n + 1: TestData(n, 1) = "10000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100": TestData(n, 2) = "0"
  411.     n = n + 1: TestData(n, 1) = "00000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100": TestData(n, 2) = "0"
  412.     n = n + 1: TestData(n, 1) = "00001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000": TestData(n, 2) = "0"
  413.     n = n + 1: TestData(n, 1) = "00010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000": TestData(n, 2) = "0"
  414.     n = n + 1: TestData(n, 1) = "00100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000": TestData(n, 2) = "1"
  415.     n = n + 1: TestData(n, 1) = "01000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001": TestData(n, 2) = "0"
  416.     n = n + 1: TestData(n, 1) = "10000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010": TestData(n, 2) = "0"
  417.     ' Test: inverted version of the above
  418.     n = n + 1: TestData(n, 1) = "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111": TestData(n, 2) = "1"
  419.     n = n + 1: TestData(n, 1) = "10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010": TestData(n, 2) = "1"
  420.     n = n + 1: TestData(n, 1) = "01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101": TestData(n, 2) = "0"
  421.     n = n + 1: TestData(n, 1) = "11011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011": TestData(n, 2) = "0"
  422.     n = n + 1: TestData(n, 1) = "10110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110": TestData(n, 2) = "1"
  423.     n = n + 1: TestData(n, 1) = "01101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101": TestData(n, 2) = "1"
  424.     n = n + 1: TestData(n, 1) = "11101110111011101110111011101110111011101110111011101110111011101110111011101110111011101110111011101110111011101110111011101110": TestData(n, 2) = "1"
  425.     n = n + 1: TestData(n, 1) = "11011101110111011101110111011101110111011101110111011101110111011101110111011101110111011101110111011101110111011101110111011101": TestData(n, 2) = "1"
  426.     n = n + 1: TestData(n, 1) = "10111011101110111011101110111011101110111011101110111011101110111011101110111011101110111011101110111011101110111011101110111011": TestData(n, 2) = "1"
  427.     n = n + 1: TestData(n, 1) = "01110111011101110111011101110111011101110111011101110111011101110111011101110111011101110111011101110111011101110111011101110111": TestData(n, 2) = "0"
  428.     n = n + 1: TestData(n, 1) = "11110111101111011110111101111011110111101111011110111101111011110111101111011110111101111011110111101111011110111101111011110111": TestData(n, 2) = "1"
  429.     n = n + 1: TestData(n, 1) = "11101111011110111101111011110111101111011110111101111011110111101111011110111101111011110111101111011110111101111011110111101111": TestData(n, 2) = "0"
  430.     n = n + 1: TestData(n, 1) = "11011110111101111011110111101111011110111101111011110111101111011110111101111011110111101111011110111101111011110111101111011110": TestData(n, 2) = "1"
  431.     n = n + 1: TestData(n, 1) = "10111101111011110111101111011110111101111011110111101111011110111101111011110111101111011110111101111011110111101111011110111101": TestData(n, 2) = "1"
  432.     n = n + 1: TestData(n, 1) = "01111011110111101111011110111101111011110111101111011110111101111011110111101111011110111101111011110111101111011110111101111011": TestData(n, 2) = "1"
  433.     n = n + 1: TestData(n, 1) = "11111011111011111011111011111011111011111011111011111011111011111011111011111011111011111011111011111011111011111011111011111011": TestData(n, 2) = "1"
  434.     n = n + 1: TestData(n, 1) = "11110111110111110111110111110111110111110111110111110111110111110111110111110111110111110111110111110111110111110111110111110111": TestData(n, 2) = "1"
  435.     n = n + 1: TestData(n, 1) = "11101111101111101111101111101111101111101111101111101111101111101111101111101111101111101111101111101111101111101111101111101111": TestData(n, 2) = "1"
  436.     n = n + 1: TestData(n, 1) = "11011111011111011111011111011111011111011111011111011111011111011111011111011111011111011111011111011111011111011111011111011111": TestData(n, 2) = "0"
  437.     n = n + 1: TestData(n, 1) = "10111110111110111110111110111110111110111110111110111110111110111110111110111110111110111110111110111110111110111110111110111110": TestData(n, 2) = "1"
  438.     n = n + 1: TestData(n, 1) = "01111101111101111101111101111101111101111101111101111101111101111101111101111101111101111101111101111101111101111101111101111101": TestData(n, 2) = "1"
  439.     '''
  440.     'n = 0
  441.     '''
  442.     ' Test: single-one patterns, select phases
  443.     n = n + 1: TestData(n, 1) = "00000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100": TestData(n, 2) = "0"
  444.     n = n + 1: TestData(n, 1) = "00100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000": TestData(n, 2) = "1"
  445.     n = n + 1: TestData(n, 1) = "00000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001": TestData(n, 2) = "0"
  446.     n = n + 1: TestData(n, 1) = "10000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000": TestData(n, 2) = "1"
  447.     ' Test: inverted version of the above
  448.     n = n + 1: TestData(n, 1) = "11111101111110111111011111101111110111111011111101111110111111011111101111110111111011111101111110111111011111101111110111111011": TestData(n, 2) = "1"
  449.     n = n + 1: TestData(n, 1) = "11011111101111110111111011111101111110111111011111101111110111111011111101111110111111011111101111110111111011111101111110111111": TestData(n, 2) = "0"
  450.     n = n + 1: TestData(n, 1) = "11111110111111101111111011111110111111101111111011111110111111101111111011111110111111101111111011111110111111101111111011111110": TestData(n, 2) = "1"
  451.     n = n + 1: TestData(n, 1) = "01111111011111110111111101111111011111110111111101111111011111110111111101111111011111110111111101111111011111110111111101111111": TestData(n, 2) = "0"
  452.     '''
  453.     'n = 0
  454.     '''
  455.     ' Test: double-one patterns
  456.     n = n + 1: TestData(n, 1) = "00110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011": TestData(n, 2) = "0"
  457.     n = n + 1: TestData(n, 1) = "01100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110": TestData(n, 2) = "0"
  458.     n = n + 1: TestData(n, 1) = "11001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100": TestData(n, 2) = "1"
  459.     n = n + 1: TestData(n, 1) = "10011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001": TestData(n, 2) = "1"
  460.     n = n + 1: TestData(n, 1) = "00011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100": TestData(n, 2) = "0"
  461.     n = n + 1: TestData(n, 1) = "00111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000": TestData(n, 2) = "1"
  462.     n = n + 1: TestData(n, 1) = "01110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001": TestData(n, 2) = "1"
  463.     n = n + 1: TestData(n, 1) = "11100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011": TestData(n, 2) = "1"
  464.     n = n + 1: TestData(n, 1) = "11000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111": TestData(n, 2) = "0"
  465.     n = n + 1: TestData(n, 1) = "10001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110": TestData(n, 2) = "0"
  466.     ' Test: inverted version of the above
  467.     n = n + 1: TestData(n, 1) = "11001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100": TestData(n, 2) = "1"
  468.     n = n + 1: TestData(n, 1) = "10011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001": TestData(n, 2) = "1"
  469.     n = n + 1: TestData(n, 1) = "00110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011": TestData(n, 2) = "0"
  470.     n = n + 1: TestData(n, 1) = "01100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110": TestData(n, 2) = "0"
  471.     n = n + 1: TestData(n, 1) = "11100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011": TestData(n, 2) = "1"
  472.     n = n + 1: TestData(n, 1) = "11000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111": TestData(n, 2) = "0"
  473.     n = n + 1: TestData(n, 1) = "10001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110": TestData(n, 2) = "0"
  474.     n = n + 1: TestData(n, 1) = "00011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100": TestData(n, 2) = "0"
  475.     n = n + 1: TestData(n, 1) = "00111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000": TestData(n, 2) = "1"
  476.     n = n + 1: TestData(n, 1) = "01110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001": TestData(n, 2) = "1"
  477.     '''
  478.     'n = 0
  479.     '''
  480.     ' Test: repeated staggered pattern: 010011000111, all phases
  481.     n = n + 1: TestData(n, 1) = "010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111": TestData(n, 2) = "0"
  482.     n = n + 1: TestData(n, 1) = "100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110": TestData(n, 2) = "1"
  483.     n = n + 1: TestData(n, 1) = "001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101": TestData(n, 2) = "0"
  484.     n = n + 1: TestData(n, 1) = "011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010": TestData(n, 2) = "0"
  485.     n = n + 1: TestData(n, 1) = "110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100": TestData(n, 2) = "1"
  486.     n = n + 1: TestData(n, 1) = "100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001": TestData(n, 2) = "1"
  487.     n = n + 1: TestData(n, 1) = "000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011": TestData(n, 2) = "0"
  488.     n = n + 1: TestData(n, 1) = "001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110": TestData(n, 2) = "0"
  489.     n = n + 1: TestData(n, 1) = "011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100": TestData(n, 2) = "0"
  490.     n = n + 1: TestData(n, 1) = "111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000": TestData(n, 2) = "1"
  491.     n = n + 1: TestData(n, 1) = "110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001": TestData(n, 2) = "1"
  492.     n = n + 1: TestData(n, 1) = "101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011": TestData(n, 2) = "1"
  493.     ' Test: inverted version of the above
  494.     n = n + 1: TestData(n, 1) = "101100111000101100111000101100111000101100111000101100111000101100111000101100111000101100111000101100111000101100111000101100111000": TestData(n, 2) = "1"
  495.     n = n + 1: TestData(n, 1) = "011001110001011001110001011001110001011001110001011001110001011001110001011001110001011001110001011001110001011001110001011001110001": TestData(n, 2) = "0"
  496.     n = n + 1: TestData(n, 1) = "110011100010110011100010110011100010110011100010110011100010110011100010110011100010110011100010110011100010110011100010110011100010": TestData(n, 2) = "1"
  497.     n = n + 1: TestData(n, 1) = "100111000101100111000101100111000101100111000101100111000101100111000101100111000101100111000101100111000101100111000101100111000101": TestData(n, 2) = "1"
  498.     n = n + 1: TestData(n, 1) = "001110001011001110001011001110001011001110001011001110001011001110001011001110001011001110001011001110001011001110001011001110001011": TestData(n, 2) = "0"
  499.     n = n + 1: TestData(n, 1) = "011100010110011100010110011100010110011100010110011100010110011100010110011100010110011100010110011100010110011100010110011100010110": TestData(n, 2) = "0"
  500.     n = n + 1: TestData(n, 1) = "111000101100111000101100111000101100111000101100111000101100111000101100111000101100111000101100111000101100111000101100111000101100": TestData(n, 2) = "1"
  501.     n = n + 1: TestData(n, 1) = "110001011001110001011001110001011001110001011001110001011001110001011001110001011001110001011001110001011001110001011001110001011001": TestData(n, 2) = "1"
  502.     n = n + 1: TestData(n, 1) = "100010110011100010110011100010110011100010110011100010110011100010110011100010110011100010110011100010110011100010110011100010110011": TestData(n, 2) = "1"
  503.     n = n + 1: TestData(n, 1) = "000101100111000101100111000101100111000101100111000101100111000101100111000101100111000101100111000101100111000101100111000101100111": TestData(n, 2) = "0"
  504.     n = n + 1: TestData(n, 1) = "001011001110001011001110001011001110001011001110001011001110001011001110001011001110001011001110001011001110001011001110001011001110": TestData(n, 2) = "0"
  505.     n = n + 1: TestData(n, 1) = "010110011100010110011100010110011100010110011100010110011100010110011100010110011100010110011100010110011100010110011100010110011100": TestData(n, 2) = "0"
  506.     '''
  507.     'n = 0
  508.     '''
  509.     ' Test: repeated staggered pattern: 0100101010101001010101000111, all phases
  510.     n = n + 1: TestData(n, 1) = "01001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111": TestData(n, 2) = "0"
  511.     n = n + 1: TestData(n, 1) = "10010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110": TestData(n, 2) = "1"
  512.     n = n + 1: TestData(n, 1) = "00101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101": TestData(n, 2) = "0"
  513.     n = n + 1: TestData(n, 1) = "01010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010": TestData(n, 2) = "0"
  514.     n = n + 1: TestData(n, 1) = "10101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100": TestData(n, 2) = "1"
  515.     n = n + 1: TestData(n, 1) = "01010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001": TestData(n, 2) = "0"
  516.     n = n + 1: TestData(n, 1) = "10101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010": TestData(n, 2) = "1"
  517.     n = n + 1: TestData(n, 1) = "01010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101": TestData(n, 2) = "0"
  518.     n = n + 1: TestData(n, 1) = "10101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010": TestData(n, 2) = "1"
  519.     n = n + 1: TestData(n, 1) = "01010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101": TestData(n, 2) = "0"
  520.     n = n + 1: TestData(n, 1) = "10100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010": TestData(n, 2) = "1"
  521.     n = n + 1: TestData(n, 1) = "01001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101": TestData(n, 2) = "0"
  522.     n = n + 1: TestData(n, 1) = "10010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010": TestData(n, 2) = "1"
  523.     n = n + 1: TestData(n, 1) = "00101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101": TestData(n, 2) = "0"
  524.     n = n + 1: TestData(n, 1) = "01010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010": TestData(n, 2) = "0"
  525.     n = n + 1: TestData(n, 1) = "10101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100": TestData(n, 2) = "1"
  526.     n = n + 1: TestData(n, 1) = "01010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001": TestData(n, 2) = "0"
  527.     n = n + 1: TestData(n, 1) = "10101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010": TestData(n, 2) = "1"
  528.     n = n + 1: TestData(n, 1) = "01010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101": TestData(n, 2) = "0"
  529.     n = n + 1: TestData(n, 1) = "10100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010": TestData(n, 2) = "1"
  530.     n = n + 1: TestData(n, 1) = "01000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101": TestData(n, 2) = "0"
  531.     n = n + 1: TestData(n, 1) = "10001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010": TestData(n, 2) = "1"
  532.     n = n + 1: TestData(n, 1) = "00011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101": TestData(n, 2) = "0"
  533.     n = n + 1: TestData(n, 1) = "00111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010": TestData(n, 2) = "0"
  534.     n = n + 1: TestData(n, 1) = "01110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100": TestData(n, 2) = "0"
  535.     n = n + 1: TestData(n, 1) = "11101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000": TestData(n, 2) = "1"
  536.     n = n + 1: TestData(n, 1) = "11010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001": TestData(n, 2) = "1"
  537.     n = n + 1: TestData(n, 1) = "10100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011": TestData(n, 2) = "1"
  538.     ' Test: inverted version of the above
  539.     n = n + 1: TestData(n, 1) = "10110101010101101010101110001011010101010110101010111000101101010101011010101011100010110101010101101010101110001011010101010110101010111000": TestData(n, 2) = "1"
  540.     n = n + 1: TestData(n, 1) = "01101010101011010101011100010110101010101101010101110001011010101010110101010111000101101010101011010101011100010110101010101101010101110001": TestData(n, 2) = "0"
  541.     n = n + 1: TestData(n, 1) = "11010101010110101010111000101101010101011010101011100010110101010101101010101110001011010101010110101010111000101101010101011010101011100010": TestData(n, 2) = "1"
  542.     n = n + 1: TestData(n, 1) = "10101010101101010101110001011010101010110101010111000101101010101011010101011100010110101010101101010101110001011010101010110101010111000101": TestData(n, 2) = "1"
  543.     n = n + 1: TestData(n, 1) = "01010101011010101011100010110101010101101010101110001011010101010110101010111000101101010101011010101011100010110101010101101010101110001011": TestData(n, 2) = "0"
  544.     n = n + 1: TestData(n, 1) = "10101010110101010111000101101010101011010101011100010110101010101101010101110001011010101010110101010111000101101010101011010101011100010110": TestData(n, 2) = "1"
  545.     n = n + 1: TestData(n, 1) = "01010101101010101110001011010101010110101010111000101101010101011010101011100010110101010101101010101110001011010101010110101010111000101101": TestData(n, 2) = "0"
  546.     n = n + 1: TestData(n, 1) = "10101011010101011100010110101010101101010101110001011010101010110101010111000101101010101011010101011100010110101010101101010101110001011010": TestData(n, 2) = "1"
  547.     n = n + 1: TestData(n, 1) = "01010110101010111000101101010101011010101011100010110101010101101010101110001011010101010110101010111000101101010101011010101011100010110101": TestData(n, 2) = "0"
  548.     n = n + 1: TestData(n, 1) = "10101101010101110001011010101010110101010111000101101010101011010101011100010110101010101101010101110001011010101010110101010111000101101010": TestData(n, 2) = "1"
  549.     n = n + 1: TestData(n, 1) = "01011010101011100010110101010101101010101110001011010101010110101010111000101101010101011010101011100010110101010101101010101110001011010101": TestData(n, 2) = "0"
  550.     n = n + 1: TestData(n, 1) = "10110101010111000101101010101011010101011100010110101010101101010101110001011010101010110101010111000101101010101011010101011100010110101010": TestData(n, 2) = "1"
  551.     n = n + 1: TestData(n, 1) = "01101010101110001011010101010110101010111000101101010101011010101011100010110101010101101010101110001011010101010110101010111000101101010101": TestData(n, 2) = "0"
  552.     n = n + 1: TestData(n, 1) = "11010101011100010110101010101101010101110001011010101010110101010111000101101010101011010101011100010110101010101101010101110001011010101010": TestData(n, 2) = "1"
  553.     n = n + 1: TestData(n, 1) = "10101010111000101101010101011010101011100010110101010101101010101110001011010101010110101010111000101101010101011010101011100010110101010101": TestData(n, 2) = "1"
  554.     n = n + 1: TestData(n, 1) = "01010101110001011010101010110101010111000101101010101011010101011100010110101010101101010101110001011010101010110101010111000101101010101011": TestData(n, 2) = "0"
  555.     n = n + 1: TestData(n, 1) = "10101011100010110101010101101010101110001011010101010110101010111000101101010101011010101011100010110101010101101010101110001011010101010110": TestData(n, 2) = "1"
  556.     n = n + 1: TestData(n, 1) = "01010111000101101010101011010101011100010110101010101101010101110001011010101010110101010111000101101010101011010101011100010110101010101101": TestData(n, 2) = "0"
  557.     n = n + 1: TestData(n, 1) = "10101110001011010101010110101010111000101101010101011010101011100010110101010101101010101110001011010101010110101010111000101101010101011010": TestData(n, 2) = "1"
  558.     n = n + 1: TestData(n, 1) = "01011100010110101010101101010101110001011010101010110101010111000101101010101011010101011100010110101010101101010101110001011010101010110101": TestData(n, 2) = "0"
  559.     n = n + 1: TestData(n, 1) = "10111000101101010101011010101011100010110101010101101010101110001011010101010110101010111000101101010101011010101011100010110101010101101010": TestData(n, 2) = "1"
  560.     n = n + 1: TestData(n, 1) = "01110001011010101010110101010111000101101010101011010101011100010110101010101101010101110001011010101010110101010111000101101010101011010101": TestData(n, 2) = "0"
  561.     n = n + 1: TestData(n, 1) = "11100010110101010101101010101110001011010101010110101010111000101101010101011010101011100010110101010101101010101110001011010101010110101010": TestData(n, 2) = "1"
  562.     n = n + 1: TestData(n, 1) = "11000101101010101011010101011100010110101010101101010101110001011010101010110101010111000101101010101011010101011100010110101010101101010101": TestData(n, 2) = "1"
  563.     n = n + 1: TestData(n, 1) = "10001011010101010110101010111000101101010101011010101011100010110101010101101010101110001011010101010110101010111000101101010101011010101011": TestData(n, 2) = "1"
  564.     n = n + 1: TestData(n, 1) = "00010110101010101101010101110001011010101010110101010111000101101010101011010101011100010110101010101101010101110001011010101010110101010111": TestData(n, 2) = "0"
  565.     n = n + 1: TestData(n, 1) = "00101101010101011010101011100010110101010101101010101110001011010101010110101010111000101101010101011010101011100010110101010101101010101110": TestData(n, 2) = "0"
  566.     n = n + 1: TestData(n, 1) = "01011010101010110101010111000101101010101011010101011100010110101010101101010101110001011010101010110101010111000101101010101011010101011100": TestData(n, 2) = "0"
  567.     '''
  568.     'n = 0
  569.     '''
  570.     ' Test: r1's custom quiz 1
  571.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '1
  572.     n = n + 1: TestData(n, 1) = "00000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  573.     n = n + 1: TestData(n, 1) = "00000100000101110000001100010001100001001000000000000000001100000000000000000111001000000000000111100000000100111000000000000010000000001111000000000000000000000000000001010000000000000000010000000000000011000111100001000100000000000000000001101000000000000000001000110110000010000100000011001100001101001000000000000000000010000100001100011000101000000010000000000000000000000000000000000001000000000010000000000000001010000010000000000000000000000000000000000010000100000000000000001011010000000000": TestData(n, 2) = "0" '
  574.     n = n + 1: TestData(n, 1) = "00011101100000000001011100001011101000100111101100011000000011001010101000101000111111011000111000100000000000000110110000000001001001110110100001011011101100000011001010001111111110101100001101100001100011000111101100110000000101101101110000001110110111000011000110000000001101111000110000000011111100110001111000011101111101010011111111101111010011011001111101100010001100101101001011000010100111111101111010111111010110001100011000000100010001100111111001101101111000000010110111110000001011010011": TestData(n, 2) = "0" '
  575.     n = n + 1: TestData(n, 1) = "00000000100000000000110000000000000000010000000000000000010000000000000000001000000000000000000000000000000001000000010000000000000000000000000000000000000000000000000000011000000000000000001000000001000000000000000000000000000000000000000001001011001000000000000110000000000000000000000000000000000100010000000000000000000000000000000000001100000000000000000000000000000000100000000000000000001000000000000000000000000000000000000000000000100000000000000000100000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  576.     n = n + 1: TestData(n, 1) = "01111011010110000100001000011001101101000011000011000000000100110010001010000100010000001110111000001000000000101110101100000000100011100101101110000010110101111001011010100000111011100110100001100100111010111110000010000110010000000100111100110000000101010100111001000000101000100101111001001001000010000100110011011010011011101000110011000000101000000100010000101101000101000110000100010101010111100000000001100000110010000001000011100001001000100000011100000101000001010101000100011010000100010011": TestData(n, 2) = "0" '
  577.     n = n + 1: TestData(n, 1) = "11000110011000111000001101000010001000001110001001110010000110000111010001010001100010101100001111100000111100101100000011000111101101110010101101010000101010000001111100000111110101010000000011011100100110101100111101000000100100101000011010000000010110101010011001110011111000010001100110001111111001100010011100010101001100000101010101100000000001001010000011011100010011001000001001110111100110010010000010000111111101100011010101010101000111010110101000000010001001001011011011100101111110110010": TestData(n, 2) = "0" '
  578.     n = n + 1: TestData(n, 1) = "10101101010001010110010110011111011111111101110100010011101110000000100011010000100111111001110110100011011110011101110001110011110000111011011110111011101100000010100111100010000010100111110010100100010001010101111000111010011101010111001110110000101101110001110010011101010110101110001111000101011001001101001011111101110010110101001100110010111101010111010010000010110100010001101110110101101110000101101010001001101101011000111110100000011101110010101111011110111110100110101001111101110001010110": TestData(n, 2) = "1" '
  579.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  580.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000001000000000000000000000000000100000000000000000000000000000000000000000000000100000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000": TestData(n, 2) = "0" '10
  581.     n = n + 1: TestData(n, 1) = "00000110110101110000001100100101000001001111101111100000011000000000001001000100011000000000100011100000100000001001000001000010000000010111001101000001100000010101100011010011111000100111010000000000001010001011101110010100000000000010001011101000010000100000101100110100000011111000000001110000010101010000111111110000000110000100111110011000100000010001010100000000000110000000011000100000000111110011110010000100001010000010011100000000010001101010000000000110010000000110000000110011000000000000": TestData(n, 2) = "0" '
  582.     n = n + 1: TestData(n, 1) = "11011001010011000110101011011010000110001001010001001111100111001011110110111010001111010110010100100101011010110010010100111010111001101011100100001010011111111010011100101101000011011011000111011011010110111100110011100010100001101010110101110101110111010111010010011001110100011010011010101111101110100100100111101101001011100001001100100111010101100100101000111111111001001111100111010110111100001000000111101000111000001101011001001110001000010100110011111001001010101001110111010101111001100001": TestData(n, 2) = "0" '
  583.     n = n + 1: TestData(n, 1) = "00000000000000000000010000000001100000000000000000000001010000000000110010000000000000000000000000000000000000000000000000001100000000000111000101000000000000000000000000000100010001000000000000000000000000000000001100010010000000000000000001100000000000000000000000000001000000000000000000000000000000000010000011000000000000010000000000000001000000001000000000000000000000000000000000000100100000000000100000000000000000000000000000000000100000000000000000000000000000000000000000100000000000000000": TestData(n, 2) = "0" '
  584.     n = n + 1: TestData(n, 1) = "11101000011011010000101000100000010001001000000110011110001011010001001101101010001100111000000101001000011000001010010100010011100110101000101000000000010100111001010100010010101010100011000011000001011010000000010000000001011110110111000010000001011011100000000111001110100000110000000011000101100000001001000100110011000100100000100001001000000011010010100000000100100000101001100000110001001001110101010001000000011000000010101000110010000100001011000001101000101010011011001110010110000010000000": TestData(n, 2) = "0" '
  585.     n = n + 1: TestData(n, 1) = "00000010100110101001001000100000010100100100101101010010000001001100000000001011001110011011000010000111111001100010110011000010100110110000000000011010011010010100100011011011001100110001101001110000101001001100100010001101001000001011111100011011100000011001001010111000000000111101111001111001111111101000000000101100011001001011011010010000100001100010011110010000001011000001010111010010011111001001001110111100110010000110100111101000000101110100101010001111001111101100010101001001010101000101": TestData(n, 2) = "0" '
  586.     n = n + 1: TestData(n, 1) = "00111100000000000111001001100000111010010010010011100010001100001100000011011000100010000101110010110100110110011100010001111110011011000110010000001001101111111000011000010001101110011101111010100110100110000111011101001111110011011111100110111000001101101110001001001000011110100110000111110111010000001100100100100111110110100001001011100110111000100011110100100100110010011110011011100011101111010010000110000011101100000111001011000110000010001101111011111011001100000010000101000000000000101110": TestData(n, 2) = "0" '
  587.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  588.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000100000000000000000000000010000000000000001000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000": TestData(n, 2) = "0" '
  589.     n = n + 1: TestData(n, 1) = "00000000010111101100110000001011000001001011001100000001001100001001000001001100010000111111000011100001000000001111010010000100001000000010001101001011101011011010000101010011110110110001100001000010000010100011000000110001000000011101110001000000000000110000100000101100000001011010000101000000100100011000111111110010110101010100011110100110110000010001101000000000101001000010100110000100010100111000010010100100001000110000000100010100010000000010000100011100010010110100010000010010001001000010": TestData(n, 2) = "0" '
  590.     n = n + 1: TestData(n, 1) = "11111111011001010010001100000100110110101110100011010010111011110100101000100000000101100000000100110010111110111000110101101010111111011101101010011111100100110100010011011001100000001110111110000101000000001100110101011110011111101100001110011101111100111100011100010010110111100001010000010001101001001111000000000101001000100100000110011000101011100100000100111011010110100000010001011010101011010010100111011000100011001000001010001011101010000100001011001011100001001011101110100110110010111100": TestData(n, 2) = "1" '20
  591.     n = n + 1: TestData(n, 1) = "00000000000000000000000000010000000000000000000000000000000100000000100000000000000000000011100000000000000000000000000001000000000000000000000000000011001000000000000100000000000000000000000000010010000000000000000000000000000000000000000000000000000000000000000000000000000010001000000000000000000000000000000000000010000000000000000000000010000000000000000000000000000000000000000000000001001000000000011100000000000000001000000000000000000100000000100010000110100000000000000000000000000000000000": TestData(n, 2) = "0" '
  592.     n = n + 1: TestData(n, 1) = "01011000100010001000011010000010010010000100100101000100011001000010000010110110010110001100010001000010110110000011010100000100100010010011111101111100110010101100000001000000100111010000010000100000000111100110000101110001100100000001000001001100100100010000001001000110000000000100011100110110000101100011100010110100000011001001011000010001001000101010010010000001000000100101100101001110110010010000100010100010000000100111001100000000001000111111010100001000001010000010101010110101101000001100": TestData(n, 2) = "0" '
  593.     n = n + 1: TestData(n, 1) = "00000101000010010110000110001101111110010001110010000010101001111111010000011011100000110000010101101110101111110101001100000100000000100110001000000000000001110011101011011110000001000110101001000000000000010100010010110110000010001100100010011001010011111011001110110000110100010010000010010110011000010110110010101000111000000100000001101100100110010100110111001110110101010001101100000000110010100010000001000101011100000000000111101110101011001011001100100000001101110000001001101010000000111011": TestData(n, 2) = "0" '
  594.     n = n + 1: TestData(n, 1) = "10100010000111100111110001101101100001100111001010011110011001101110100111000111001010100111100010110010101010100100100000101010111100100000010111001000101110010010111000001100011011001011010100101101101110001001111100110000001011100000010110011010001000001101101111001000011101001000110010110111100011111011001100011110100110100111001110000101010001010001101001101001011001111010011001101010000001111010110011100001010100011100110100011011110011100101000001110010010111100111110011001110011111001010": TestData(n, 2) = "1" '
  595.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  596.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000100000000000001100000000000000000000000000000000000000000010000000000000000000000000000000001000000000000000000000000000000000001000000000000100000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  597.     n = n + 1: TestData(n, 1) = "00100000011101101100000000000000000000001010001010001010010000000011101000010100001000000110000110100000000010001000111100100100001010110000011000001010110100110011000010001000110101001001100001011000001000000000000010110000100000110000001001000000100000110100100100100001010011000000010101010010100101000000001011100010000000001100000110100010100010000001110000000100000001110010100100001110000001100110000100001000001000000000010000001000001000000001001100000000010011110100000000001010100001111111": TestData(n, 2) = "0" '
  598.     n = n + 1: TestData(n, 1) = "01010110100011101001111011101011111111101001100000010100001001111110010111100011101100011111110001101101111000110011010011010011110000101111110110010001000001010100100100110011010010010110101011100000111111111101111110110011111101010011110000111101000010010011010000011100001000011011000011001101100011011101000101010101111011000100001111010100111001011100011100011011011000000010011010010100110010011001111011010010110011111000101110010111111100100100111110111010101001101011010100000001011010010000": TestData(n, 2) = "1" '
  599.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000000000000000000000000001000000000000000000000000000000000000000010000000000000010010100000000000001000000000001000100000000000000000000001000000000000000000000000000000010000000010000000000000000000000001000000010000000000000000000000000000000000000000010000000110000000000000000000000001000000000010000100000000000000000100000001000000010000000000000000000000010000000000000000001000000000000000": TestData(n, 2) = "0" '
  600.     n = n + 1: TestData(n, 1) = "00000001100010111010101010001001000011001100000000000000010011000111001101001010110010010010010100101010000001001000111000000010110000010001001110100000000101101001110100010100000101000100000101000000010000110000010011010000100101001111000000011110001000001101101100000001000101000000011001011001110111100010010001000011110011110010010001000001110100100010101001110000010100000010010100000000101001000100101000011000000001001010111010110100000011001100101010000000100100100111111001110101000100000001": TestData(n, 2) = "0" '30
  601.     n = n + 1: TestData(n, 1) = "11010010010101000010000011010000101110111010011001101000101111011101001110000001011110100101101111000100000010110001010101000110100001100000111000111100011110110011101101101111101010100100011101000000010010101110000011011100010010101110101010000001110001001111110011011101000010110000101111000000101100011100101100001001100001111110000101110000010010000001001010000000011011000001000101000100000111101100110011000111010000001000010000000000100101010001100001011000001010001000111111110110101000011111": TestData(n, 2) = "0" '
  602.     n = n + 1: TestData(n, 1) = "11011111000111100000010011111111101111001100100010111010010000011000110100111010011000111101000111010000110110101010011010101011100110011101000001011011111110011100110100001001010000001000010010100101111011000101001000000011110011110001100100100011011001010000101101111110101011011100000111000111000011110101111011101000101010000111011110000111111101011101110110001000011000111011011011111100110000001011011010110101101111011001011000111100101100111010011100110111101100110110100110000010011111110101": TestData(n, 2) = "0" '
  603.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  604.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  605.     n = n + 1: TestData(n, 1) = "00100000000000000011000000000000000000000110000010011111100000000000000001000000001000000000000000010110000110000001100010000000000011110000000001100000000000110011000011000000010000001110000000011000001000010000110100000010000000111101000000000000000000100000000001100000100011000000000100000000000101000000000011010000001100010100000110110010100001010000110000001000000001100000110000001100000000011010000000000000101001100000000000000000100000011010100000000010010000100100010000000000000001111000": TestData(n, 2) = "0" '
  606.     n = n + 1: TestData(n, 1) = "00010100011101010101100000101000001100111001101101000000011001111001100110110111010111111011110001100000000001100000011001111000111001000110011010001110100110011001110111100000101000110001100110100111000111001000001001110101101110000000110000000000011001010101000110011101011001100011001001011001101100011110000101101001100011001010011000001100110000101000001111110110000000001100001100010010101111100101001101010000000110011011111100011111010000000101000000100101100111010110001101111010101010000110": TestData(n, 2) = "1" '
  607.     n = n + 1: TestData(n, 1) = "00000010000000000001100000000000000001000000000000000000000000000000000000000000000001001000000000000000000100000000000000000000010000000000000000100100000101000001000000100001100000000000000000000000000010110000000000000000100001000000000000001000000001100010000000010000010000000000000110000000001000000000001000010000000000010000000000000000000000000000000000000100001000000000000100001000000000000000000100000000000100000000000000000000000001001000000000000000000001000010000000000010000011000000": TestData(n, 2) = "0" '
  608.     n = n + 1: TestData(n, 1) = "11010000111110000000000011000001011000010011010100100000000000110011011101010010100100000000000000010001101001000001001010011000100101101000111011000001000010010000010000010100001000100110100001100100001001001001100011110010011000110111000011000000011000000000100110001000101101100000001000000000000100000000000001001110001110100000010100001011101010110100001001001000000010010100001010100111011111000100001010000011010001000011001101110001101110000011010101101001010100110100010001011100110100110111": TestData(n, 2) = "1" '
  609.     n = n + 1: TestData(n, 1) = "00000000110110001000000011001000100000001110011010100010101101111100101100101000001010000000101101010100101011010000010001001110001001100001110101011010111010000100001011001010010100011001011000010000100001000000000100001111001000101011111110100001110010011000100001101000101001101011110001011111000110111010010101000001001011101101110000001011110000011001100011111001010100010101110011000100110000101101010010110000000000010011001001101101000010000010001110000011111100111101100100110000001000110000": TestData(n, 2) = "0" '
  610.     n = n + 1: TestData(n, 1) = "00101101111001100011001000011101001000000001100000101001000010110101000011001101110010110011000010101100111010101111100101100111000010110111010100000000001010000111111011001000111011100100011111101010010101011111111010010110010001101010100101010110111010111000101111001101001101101111010101010010110001000110110110101000010100001000010011101010011110001000001111001100110001011010100011101011100000100000111001000111001010101111010010010100110111001000100011010110100011111011101001101010111101101010": TestData(n, 2) = "0" '40
  611.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "0" '
  612.     n = n + 1: TestData(n, 1) = "10000000100000000000000001001001000000100011010001010100000100000000010101100110101000000000000100000101010000000101000000000101100000000000010000001000001011000110100110100010010100010111000100000100001010000000101010001000111001000000010000100100000000000000100000001001000000110001010001001010010000000010101001000111011000100100100000010010000100100000000000001000010010000110010110000110100000000000101001010100000110010001110000111000000110000000000000000000000100101100001010000100000101100010": TestData(n, 2) = "0" '
  613.     n = n + 1: TestData(n, 1) = "00001101011011101101111110010000011011010000101110101011001001111000101010010001010111100001110011011010100011011010101010111010001010100110101100000110110100101001011001010000001010100000111010111011100100110111010101010100000010000010101110001011010011001111011110110000110010001010001000110100101111101100000110111000000000000010001111101001011011010111110110000100101000111000101001110001010011110100010100100011110000001100001011000100100000011110111111100011000011000011100101111010111010010101": TestData(n, 2) = "1" '
  614.     n = n + 1: TestData(n, 1) = "01110011000100111110101110110110101110011100101000000011111010011111101010001000000000111110011010111010001110111000111111010010011101111101100111110001000000011000001000001101101001001000010001011000010001111100010001100111000100111111100011010001101101110110000001010110001111000100101110010001101101010001010110110000100111011001010100101101110000001111001111110111100101101001001001111001011111111011000010101001001001101010001111000011011001111111001011111101111001010010110000100001010000011000": TestData(n, 2) = "0" '
  615.     '''
  616.     'n = 0
  617.     '''
  618.     ' Test: r1's custom quiz 2
  619.     n = n + 1: TestData(n, 1) = "10000001001000000000000011000000000011010100000100010100010111001001000011100000000000101000000000000000000100000011000011010001000000010000000001001000001000000000000100000100000101001000010000000000100011001101010000000010000100010000001001000000010000010000010000010001100000010010000000000110110110000100110010000000000100000001001111110010011001000011000001101010001111111010101000010111111110000000000101000000000010001010101011000001101001000010000000010110001001000010010100010101000000011101": TestData(n, 2) = "?"
  620.     n = n + 1: TestData(n, 1) = "10001000000000000000000100101000000000001100000000010000100000000000000011100000000010000100000000000101000100000000000011000000000000110000000000000100100000000000000100000011000000000000000000000000000000001001100000000100100100000000000000000100010000000000000000000000000000000000000000000001001000000000000000111000000000000000000000000010001011010010000000000000000100010101001000001000010010000100000001000001000100010000000001000000110000000000000011000000000000000000000100000000000000001000": TestData(n, 2) = "?"
  621.     n = n + 1: TestData(n, 1) = "00001000000000000100000000000000010001000000000000000000000001100011000000000010000000001000101000000101000000000100000110000000001000000000010100000000000000100001010100000000000000000000110000010010000100000101000000000100100000000100010000110000010101000000010000000001000000000100001000000111000100000000000000000100000001000001000000000000000000000000000000000000100010000100000000100000001000000100000000000000100000001010000000000000000101000000000010000100000001100000000000000001000000000001": TestData(n, 2) = "?"
  622.     n = n + 1: TestData(n, 1) = "00001000000000000000000000000000100000000000010010000000000000000000100000001000000001000000000000000000000001100000001100011001010000000000000000000000000100000001000000001001100010000000100000000100000001000000001001000001010000000000000000001000000000011000000000000000001100000000000001000000111000000010000000000000000000000101000000010000000000100000000000001000110100000000001000101000010000000000000000000000000000000000000000101000000000101010000010010000001000001000000000000000000100010000": TestData(n, 2) = "?"
  623.     n = n + 1: TestData(n, 1) = "00001001111110110001110000000100000110000100000001000000100000010000111000001000001101000001001000000000000000101000110000001011100000100000110000001000000000100001100000010010011100000011100001000110001001000011001011000100010110000110000100111110111011001100000000000000000010000000011100000010000000000000000000111001010001000100000000001010001010000000000000000010101000001000011110100010000100010000001100100001000100000000111000011000000000000000000000010101011010001111000101000000100100110000": TestData(n, 2) = "?"
  624.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "?"
  625.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "?"
  626.     n = n + 1: TestData(n, 1) = "00000001111000110110101000011001001111110101101100011010111100111010100101001010001001100100000100001011000100000100000110000110110000000100101001110001101001110010001000100010110000000110010010101010001000000110100000001001011100001000000100001011111010011011000000000110111100100000010000100001110000010000000000110001111110001100010111000100100001000011000010101110000001000000001101101001111000000010011000000110001000011100111011011000100100000000110000010010110011010110000110011010000010010110": TestData(n, 2) = "?"
  627.     n = n + 1: TestData(n, 1) = "10001110100010001000100001110001001101100010100100111001000000001001100000001000111000001000001100001110010000000001001111000011110101100111001001111011101010110100001001001100100100001101000111010001111110101010101101000101011011111001010110000001010000000000111100100111011001010110000010001110010000001000111110011101111100111000000001100101000000000101111111100011001100111100101011101010011110000010011110001011110011101100010101110000100000011001000011001001010101110110101100111000000010000100": TestData(n, 2) = "?"
  628.     n = n + 1: TestData(n, 1) = "00111001100110011100000000000000001000100100010100100010001101000111011100100010001111100000000110000001000001111001000100000101010011101000001000110100011111110001000110001101110000000010101100000111000001100110011111110000000000000100100000000110101001010110000000011100000010110100110000000110000000001010000101000001000000100000100010000000000100000011000000000010010100010001101100110010101010000010111100000111111100000001001010001001001000000000111000010011010011000000001101000000000010000011": TestData(n, 2) = "?"
  629.     n = n + 1: TestData(n, 1) = "10000101100000010101000111000110011000100100000101000011001110000010000100000111001001100000011100000101001000000000111100000100011000000010001100111000001001110100100000010000110011110011000000000010100100010111000000000000000010010000010001010010101100110010000000100101000001101001010010000000000010000001110010000011000000010010001010000010011000011111101100000010100000001110011110100000101001011111011001100110001000100000001110001000010000000001110001010010010011100000000100100100110011000010": TestData(n, 2) = "?"
  630.     n = n + 1: TestData(n, 1) = "01011100011100011000100100011010011000010011000011101100110010000000011000001100111001010010001001001101010101100100100011111110110111111111001011111011011001110011011000010001100100101100000111101001000100111110010110110101001000011011110101010010010001111011101111111100110000111110011001001111110111010000010110001001000101001100001101010010000000000110011110100001100000010000011001110110110010011000100000000110001001000001100000011001001100100100100011010001111100011001111101100000111100000000": TestData(n, 2) = "?"
  631.     n = n + 1: TestData(n, 1) = "00110000100010000000100000000101000100000000000000000010000000100000110000101000110000100010000000001000100100000101000010110101001101100010001000100100010000000000000000000000100100011001001010001010000010010000000100001001000010000001010110010000100011010000100011010110110100100100001000000010110100000001010010000001111110000000100100100000001101000110111100011101001110010010001010110000000011110001101000000001110000100010100000010001000010001000100000010000000000000000000010011001011000010100": TestData(n, 2) = "?"
  632.     n = n + 1: TestData(n, 1) = "10110010010010010000110011100101010001001001100011000001000010011000101001100000110110000000100011111000011000000111111000001000011011010111000000010001000101001110010001101101011001010001000110000010000110010100010000011001010000100000101100011100000110001001100111100110000110100010100000011000111100111010010100011000000000011000010111100000100001010100011110100000000000101101110010000000100110100001110000001110001000100000000000010010001100000000111100000001000000000000000000000000001001000000": TestData(n, 2) = "?"
  633.     n = n + 1: TestData(n, 1) = "11010000100101101011010111010110101110101000001101001011100000111001010001100000101100110000010111000100100101110100001101111001011011001100110101111100010010111100010010111111010001111110010011110000110011110011010011010101100001101010011110101001110001100011001110111110011111111101100001100000011000000101101100111100011010001011010101001010000101010011000010011011010110110111011110000001110010100010000000101111101011101111000101010001011111100100101000011001011001101111101100010111010100111001": TestData(n, 2) = "?"
  634.     n = n + 1: TestData(n, 1) = "00000000001110011101011110000001110100101110110111000101111000011010101110010001100110001000111101100010101110100010010110101110110110110001001001010010000011101111010010110010000110001000100001111110100001100000101011011000001100001011110001110100111010101110001011110000001111110101010101100101000001101010101001010010100001001000101000011000111101100111101001001010110010000100111010011010111010000100001011010101111111100100111101011001100111110010011110011100011110001110001001011000011010001101": TestData(n, 2) = "?"
  635.     n = n + 1: TestData(n, 1) = "10001001110000001000010001011011000100011010010101101011010100011001000011010101101100011011000111010111100010110011001001101011100111101101001000100100101111011100001100100100010000001100000010000010011101001010001011100011100001001000010000100010001001111000000010001101000001001110000110011110011100011011001110101000101001111111001010111000111011100110110011111011010111000011100001111110110101010111010110100000110110010110010100011000111110111101110011001111111000011111111001111001001101011111": TestData(n, 2) = "?"
  636.     n = n + 1: TestData(n, 1) = "10010011010111111001010001110000011011100100100110011110011111010011011111111101111001100001100110100100100110011111111100011011100010011011110010010100010100000000010010001111001001110010111100001001010111110010110111111100110001010011010100001111101011100110010111110111110000111100110101001010111001101011001001000101100001000110111100010111001001001001101011000110001011100011100010110000111101111101100100100011101100011011110011110000111100001100001100100011000111110000100000110101100011001011": TestData(n, 2) = "?"
  637.     n = n + 1: TestData(n, 1) = "01111000000111010111111100110100011010111011110101000111000101111000111111100011010010001111001010111100111101101010000101110101000010101100001111010101011110011001011011100001110101101011111001010111001101110001110011111111100011000110100011111101000010100101010001001100101000100001000100000010101100011111001110101101111001111001110100011001101011001100111001100000010111000111000011001000011001000010011101011101110101010010110010111110111111010101100001111110011110011000010011000010010000110000": TestData(n, 2) = "?"
  638.     n = n + 1: TestData(n, 1) = "11100101001100110010000000001111111011001011100100111101110111101000111000110110001100101000101110100101001000011011000111010110011101100010000100111010111010011010010010101110111011110010110110011001110101100111100010100010101000100001000100001000100101010101001111010111110101100101100111010110100100111000010101001101011100010110000000100110111100101111100001010011001100000100010101111111110110010111011011011001010111011100001001110010100100110110110101001101000001011001110111010110100000111010": TestData(n, 2) = "?"
  639.     n = n + 1: TestData(n, 1) = "00101011100010110100010101100110110111001111000100100110011111000001101011100001110110100001110011111101001000100100010111000111110110001101101000101100011111101001010010001000111111110111011001100011011011010110000101101100100100011011101001011010101001100011111101110101111111010001010001001100110100100000011100111101110010011000011001001000001110001001010010101010000110101001011010100100111011010011011110101110110100010001000100100011000011110111111011000011101101100111101111100011000011010111": TestData(n, 2) = "?"
  640.     n = n + 1: TestData(n, 1) = "00000100100101110000110100100011111110100110000101010001100010000000111111000111010011111111111110011000010011010111011010101101011011011010011000100100101100010110111011000111001110011110001111100000101101100001100011111010010100110100111010100101011100100001100111111010001100000001100010001000111110101000010000100100110010101111110011111111001111111101001000111100100100111100001111101000111110011111001111111001110100101001000011100010001010100110101011011001000001111010101100100110001011110111": TestData(n, 2) = "?"
  641.     n = n + 1: TestData(n, 1) = "00000111111000010000101100011100110000100010111111110111011110010011000011110000001110000110001101101011010111010001100011000101100011111100010000010101010111111111010100000110111010001001100110111100011111000100101111111100010100110110100000101110010101000000000010000111111101011111111101110110111110111111111001101110100100110111101110111001100000100011011111010000101110011010111100000110100010110010001101001010100010000000101111110000111000001000010001000100010110011011111011101110100001101010": TestData(n, 2) = "?"
  642.     n = n + 1: TestData(n, 1) = "10101101001001011100001000001110010001110011001011000111110010110110100011111111111001010000101010011110011110110010010001011010011111101000011001111100000011001011011001001110110000101001011000100111100011000111110011100000010011000000101001010011000111100000111000101110110111100001110000101011010001101010101101101110011011111100111001010100011000111011101111011111011101010000100100000100110101111100000101000000001001001110000111100100111011011100101101010110100101110101010111001010110010100011": TestData(n, 2) = "?"
  643.     n = n + 1: TestData(n, 1) = "00111100000001100110111100111110110100001000001111100110011111100111110001100001100100110110000000011111110010111000111000101000000010000101011001010000011010110001111000010010010010000111010100110011000001000011110110110010010010011111111111111001100100010111101010000001100110010000110011000101000100001000001111010010101100001000101010101101001100000000001001101001011110001100100000000001110011111000100110101010000001111111111010001001011000100010000000100001000100011000100000110100101011000010": TestData(n, 2) = "?"
  644.     n = n + 1: TestData(n, 1) = "00001100001100010100000100001111110011001111010000111001001111100010101101011000101100010010101010000011010111100100101100001110011001100000001011000111010000111000001100010000000100100111000100100000010101110100010000101010101110111011101001111000010110111110010000110110001010001111100101100011101010011010100110000101010110010100111101100100011000001011111110111001001101100000000001010011000010100000011001001011110000000000010100000000000100111110001000100101000100000000001000001001110000000000": TestData(n, 2) = "?"
  645.     n = n + 1: TestData(n, 1) = "00010011100000101100010001010000111100001100101110110011000111111001111001111000010001011110111010100110101111100100111110000000001111010001100011100001101110100011010000010001111111000001111111010111001111001111111001000010000101101101000100100000011111011000011100100011001100110010000001000111111110100011111010101011000101111110000011001010101100100001001111001001000011111111010011110000110010100101111100110100111111011000110010010111000000010010001010010000110101100111110100100010011100110010": TestData(n, 2) = "?"
  646.     n = n + 1: TestData(n, 1) = "10011100100001100111000000111010000100000000010000011011000010100001110000110000110100001000001000011001011110010000001001000111000100100001000000111001100000100011000000000000000011000000101011010100101000000010010100010000011000011100000111000010100110101010010111010000010000110000010000000110010001000001100100000001001000110100011010101001000010100100000001001000100010100010111010010100010111100011000001101100000011001110100010010001001100110001000010001010001000010111000010010000111001011000": TestData(n, 2) = "?"
  647.     n = n + 1: TestData(n, 1) = "01001001001000000100101111110000000010011000000110011101110111111001100011100001000000101000000000000110001111001011010010110011101110010000001001001000000000000000000101000000010001111000011000010000000011001100110000000011100100100011001111000100100010011100010010010111110100010010000111001110011110010000110010100000000001001011001111110010001001011110000000011011001111111100100000110111111110000000111001000000000010111010101011000011111001110010000010011010001001110001011100010110000001111101": TestData(n, 2) = "?"
  648.     n = n + 1: TestData(n, 1) = "10011000000000000100000010101001000000001100100000011001100011010001000011101000110010000100001000000000100100000000000011000000000000110000010100010100000000100000010110000011010000000000110000000000000000001001100000000100010000100000000100000100010000000000100010011110100100000000000000000001001001000100000000001000000000000000000000000000001011010010000000011000101000010101001000101000010110000100100101000001100000000000001011000000000010000000000011000111000000000010100100000100000001001000": TestData(n, 2) = "?"
  649.     n = n + 1: TestData(n, 1) = "00001000100000100000000000001100000001000011100111101000000001100011111000001010110000000100101000000000100001000100101110000000001000110000010100001000100000100001110100000000000100000000000001010010011101010101001000000100100000110000110000110000010001000000010000000001000000000100000010001111000111000000000000100100001001000101100000000010000001000000000001000000100010000100000000100000001100000111000000010001110010011010000000000000001101000010000010000100000011110000100000000001000000000001": TestData(n, 2) = "?"
  650.     n = n + 1: TestData(n, 1) = "00001000001011110101000000001000101000100000010110110000000001100000111000001000101001000000000000001100100001100000101100011001000001110000010001001000100100000011110011001000000100000000010001000110000001000101001001001001010000110100000100101110010000011000000000010000001100100000010000000000111000001010000000000100001000000110000100010100001001100000000000001000000100000000001000101000010000000100000001110010000100000000000000011000000001101010000010000000001010001000010010000000100100010000": TestData(n, 2) = "?"
  651.     n = n + 1: TestData(n, 1) = "00001010101000010001100100000100000110111110000001111100000001110000001000000010111101010011000000000010100001110000110010011111100000000000111000011100100000100001100001000010011000000111100001010010011001010011001110001000010000000111010100011001111111111100010000100010000100000000111001000011000000100110000000111000111110000100001000100110100010001001100100001000111000001000011110000111100100011100001000000001000100000110011000011000000001000010000000110011111010111110000101010001110100110000": TestData(n, 2) = "?"
  652.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "?"
  653.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "?"
  654.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000100100000000010100000000001000000000000010001010000100000000000100000010000000000100000000001101000001010000100000000000010000000000000000000000000000000000000011000000000000100000000000000000000000000000001000000000000000010000100000000000000000000000010000001000000100000000000000000000001000000000001000000000000000000000000100000000000000000000001010000000000000000100010001001000000100100000001100000000000000000000000001000000100000000000000000000100": TestData(n, 2) = "?"
  655.     n = n + 1: TestData(n, 1) = "10000101000000000001000000000010000000001000000000000110100000000010000111100000000000000000000000000000000100000000000000001000110100100000001000001000000000001000001000000000000000000110000010000000000000000000000000100000000000000011000000000000001000000000000000000000000001000000000011000000000100001000000000000000000001000000010000000000001001010000000000000000000000000100100000000000000000000100000000100010001000000000010001000001000000000000100000000000011110011000000000000000100000001000": TestData(n, 2) = "?"
  656.     n = n + 1: TestData(n, 1) = "00000000000000001000000100000000100000000000000000000000000000000000000000110001000110000000101000001000000010010000000000010000000010000000000000000000000000000001000010000000100000100000000000000000000100100000100001000000100000000010000000000000000001000100010010000010000100000000000000000010000000010000000001000000100001000000000000000000000000000000000100100000100010010000000100000000100000000100000000100000000000000100000000010000100001000000000100000000000000000000000000000110000000000000": TestData(n, 2) = "?"
  657.     n = n + 1: TestData(n, 1) = "00000000000000000000000000100000000000000000000000000000110000001000000001000000000000000000000010000000010000000001001000000001100000000000000000000000000100000001000000001000001000000000000000000000000001000000100000000000000000000000000001011000000000000010000000000100000000001001000000001000010110000000100000000000000000000000000000000000000000000000010000000100000010000000001000000100100000000000000000000000000000000000000001000000101000001000100000000010000000001000101000000100000001001000": TestData(n, 2) = "?"
  658.     n = n + 1: TestData(n, 1) = "00000000100000010000000000000000000000000000001011000000010000000001000000000001000100000000010010000000000010000000000001000000010000000010010000100000001010000100010000000001000000000000100000000000000001000000000010010000010000000010101000001000000000000000000000011000000000000000000000000000100000000000000000000000000000001000000101000000000000000000000000000000000000000000000000000000010000000010001000000000000000000000000000000010001010100000000001011000010001001010001010000000000000000000": TestData(n, 2) = "?"
  659.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "?"
  660.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "?"
  661.     n = n + 1: TestData(n, 1) = "11110101001000011101011111110011000011111100111111111110011111111111101011101000001110011111001111000011000100000111111111110011110010000001101011111010111001000000010111001111110101111000111001010000110011001111110000100111100100110011111111110011011010011100100111111111110100011110000111001111111111110110110010010000111101011111111111110010011111111111000101111110101111111111111000110111111110000111111111101011000101111001101011000011111111110010000011110110001101110010011100010111100110001101": TestData(n, 2) = "?"
  662.     n = n + 1: TestData(n, 1) = "01000110000100000101000001010000011010010000000000011000010110000001001010010110000000001000010000011010000100000011010010001001000010000010011001001110000000001010010001010000010110001011111111000100000010000000011000010000100100000100000000001000010001000010001010010000100100100001000000000000010100110101001000000111000001001000001000011001001001000010011000000010110110010000100001010110111011000000100000000000100100001100011000000101101001000010110100010010001101010000010011110000000000001100": TestData(n, 2) = "?"
  663.     n = n + 1: TestData(n, 1) = "00101001011000000000110000110100010000100000000011000110110000100000100000100011000101000100001000011000001110000101000100011010110000001110010100000110000011000000000010010011000000000000010000010110000010001000100110110101000000000000000010000000100000100001001001010000010100111000110100000001010000000000011101010001010000000001110000000000001010001001011100000001000100000100100001010001000010111100000000000101100001001000000100000000000000100000000000111000001000001000000001100000110100001001": TestData(n, 2) = "?"
  664.     n = n + 1: TestData(n, 1) = "00101101000010000110000001100000110000000100000000010010000000000100100001001001000000000000000001001000000100000010011000000000000000000001000101100000101100001010001100001000001000110100101001110001011000000000000000101000100111100100000000010001001110001001010010000000000000100011010000011100000001000000001010110100000101000000001000000000011000010011011100000010100100100000000000000000001001001110000001010000100000010000000000000100100110011100100010100010000110001001000101100001001010100010": TestData(n, 2) = "?"
  665.     n = n + 1: TestData(n, 1) = "00000100010110011000000000100100010000000100000001010000111000010100000010001100000010100000110100100100010000011001001001000000001101000000001010101001100001000100010100101001000001001000010000000000100000100100000001010000010101010000000110000101000000000010000001011100000111000100010100000110000011010000100000000001010010100100000010100000011000000010100100011000100000000000000000001000000000001110101101010010000000011000100000000101000010110110110000010001100010000001001100000010011000001000": TestData(n, 2) = "?"
  666.     n = n + 1: TestData(n, 1) = "01000000000000000100001001010000011110101010100001001000000000000100010100000010000100000100000011001000000001101010100001011100000100011100011000000110000100000010010000001000100100000001101001011010000000101000010000000000011010000001101000000010001000000000010110001100000010110001011000000001010100010000000010010100100100100010010000010011000001000000110000101100110010110000000011000000101010000000000011001010000001010110010001000000111010100110000010001001000100100000000001110001100000000000": TestData(n, 2) = "?"
  667.     n = n + 1: TestData(n, 1) = "10000000000100001110001001011001100101100000000100000010000011010001000110010010101011000001000000101001000100000000000000110000000000100000000001001010001010100001000001000100100110100011010000001001000010000000010000000000110101000000000010000000100000000100000100000000010100000000000000000000100011000110111000100000110000001010000100000100010001101101111010000001100000000000000000010001001101000101100000000010100000001001000000000000000000001001000110000000010001000000000111001000001001000100": TestData(n, 2) = "?"
  668.     n = n + 1: TestData(n, 1) = "00010001111000000010010000000001000000101000000100011000010001011001100010110011100000000011001000000100000010010100000001000110010010000000010010011101001001101000000010000001000010011001100101000001000110001010000010010010010100101001010000001000001101000101101100000100100010101010000001000000000000010001000000000000100010010100000000100100001001000001100000011111011100100001000000100000000010000000001001000010001000000010000010101010011110000000000001000001000011000000001000000000000001000001": TestData(n, 2) = "?"
  669.     n = n + 1: TestData(n, 1) = "00000111001100000000100100010000000100000111100100010000100001010110000000000000000000000000000110000100110100010010001000001000000010000001010001101110110100000001000001000001100100101010000001100001110000000000101100000000000000010000001000000000111000000010000010101010001000110000000000000010100110000000000000010010000101010000000000000010010000010101110000100100000000100010100000001101000001010010000000000000001001000101010001100001000001010000000001001000000010110010000010000000010100100010": TestData(n, 2) = "?"
  670.     n = n + 1: TestData(n, 1) = "00000000001100001001010000001000000101011100100101001011110010001001000001011010000010000000100100001010010001111001000100000000000010000000010000000010000000000001010000100000010010100100000001000101010100100000110011100000000010010010001100000000101010100000100000001001110000000100010000100101010101100100011000100100001001000000101110010000010000000000001000000000101010001001010011100000000100010000000000100000101000000100000000011001000100001000000000010000001110001000000000100010011010010110": TestData(n, 2) = "?"
  671.     n = n + 1: TestData(n, 1) = "00010001000000000101011010001010000001000001010100000000001011000010000000000000000001010000100001000101010101100100010011100100100000000000100000001000000000000100010100000000000110000010010000000110000100001100110101110000110001000100110000010000010000011000000010100000100001010100010110001000100000000001000000000000001000110000001001000111010000010100011000000010010000000101000000000011001001101100001000000010000000000000000000000011101000000110000000110010010000110000001000000000100010000001": TestData(n, 2) = "?"
  672.     n = n + 1: TestData(n, 1) = "00000000000110100000100011000000100000100100000000000000011011100000010101100001101010110000000000000000000000111101001001100110001000110001001101000101010000110010010001000000010001000000001000011000000000000000000010000000000001000100000001010010000001000001000101111110000100010010000010011010000000000000100100001001010100001000010100001001000100101000001000000001000000010101000100000010000001110000000000000000001011000011001000010000001110001001000101011110011010000101000000000000000110000000": TestData(n, 2) = "?"
  673.     n = n + 1: TestData(n, 1) = "00010000100010110000000010111001000111010001000000001000100010000100001010010000000001101010000010000001000000000011000010000000010100100100010000110100000100001001100011010010000000011110100010111010110001110000100000100100000100000000010000000000000000110001001010000000000000100100010001110001110000010101010000001010000011101101011010000000001000110000000110110001001100101010000100000001010110001011001100010010000010100011100100001001100000011110000000110001110001100100000100101000101000010000": TestData(n, 2) = "?"
  674.     n = n + 1: TestData(n, 1) = "00110000000000000000000000000010100000000001000000000000000001000000001000111000000100000000100000010001000000000010000010011110010100011110000010000000000000000000000000010010010000000001000000000000000000000000000000010011010000000000110000000001010001010110000000100000000000010010000000000111100000000000010000000000100000001010000000000001000010001110001001010100000000000000000100000000000000001000000010011000000000000000001000011010000000011100000001100000000100110000000100100101011100100100": TestData(n, 2) = "?"
  675.     n = n + 1: TestData(n, 1) = "01000000000000000100000101010000000010010000000110011000010100000001000010001000000000101000000000000010000100000011000010000000000010000000000001001010000000000000000000000000000000001000010000000000000011000000010000000000000100010000000000000000010000000000010010010100100100000000000000000000010100010100000000000000000000001100001000000000001001000010000000000010000110010000000000010000111010000000100000010000000110000010001000000000101000000010000000010010001101010000010000000001000000001100": TestData(n, 2) = "?"
  676.     n = n + 1: TestData(n, 1) = "00000001000000000000000000000010000000000000100000000100000000000010000000000100000100000001000000100000001110000000000000000010000000000000000100000100000000010000000010000101000000000010010000000000000000000000101000000000000000001000000010000000000000000000000000000000000000000001000000000000010000000000000000010001000000000010100000010000001010000000000000100000000100000000000101000000000000000100000000000000000000000000000000000000000000000000000000010000001000000000000000000000000000000101": TestData(n, 2) = "?"
  677.     n = n + 1: TestData(n, 1) = "11100110000000000000100000010010000010000000000000100100000010010000000000000000000000000000000110000000001011000000000000000001000000100000001100000000000000001001000000000100000000000000000000111000000000001000000000000000000000100100010000000000000000000000100100000110000000000000000000000000000000000000000111000001001000000000000000010000001000010000100000000000000000000000000000000000010000101010001000010100000000000000000000000001100100000000000000000000010000000100000100000000000000000000": TestData(n, 2) = "?"
  678.     n = n + 1: TestData(n, 1) = "00000000000000000000011000000000001000000000000000000000011100000100110000000000000000100000000000001000010000000000100000000000000000010000000000100000000000001000000000000001001100000100000010100000010001000000001001000000000000000010000000000000000000000001000000000000011000000010000000000001000000000000000000000000000000000000000000111000000100000001100011000000000000001000000000010000101000000000000101000000000100000100000000001000000000010000010000100000000000000100000000000000000000000010": TestData(n, 2) = "?"
  679.     n = n + 1: TestData(n, 1) = "00000000000010000000000000100000000000000000000000100000000011000000000000000010000000000000000000000001000000010000000000000000001000000000000001100000000000000000010000001001000000000000100000100000000110000000000000010000000000000001000010000000001100000010000000100000000000000010100100000001000000000010001000000010000000000000001000000000000000000000000000000000100000010000000000000000001000100000000000000000001000001000000001000000000000100001000100000000000000000000100000000000000000010000": TestData(n, 2) = "?"
  680.     n = n + 1: TestData(n, 1) = "00010000000000000000000000000000000100000000001000000000000000000000000000010000000000000000000010010000000100001001010010001001000000000000000010000001000000000000000100000000001000000001000000001000000000000000000000010000011010000000000000110001000000001000000000001000000000000100010000000010000000000100000000000100000100000010000100000000000000000000000000000000000100000000000000000000100110000010001010000111000000000000000000000000001000000010001000000000001001000000000000000000000010001000": TestData(n, 2) = "?"
  681.     n = n + 1: TestData(n, 1) = "00000000000100000000000000000000010000100001000001000000000001010000000001000000000000100000000000000000000000000000000000000110000000100000010000000001000000000100000000000000000000000100000001001000000000000000100000000000000000010000000000000000111000000000010000010000001000000000000000001010000000000000000000101001100000000000000100001000000000000000000000000000000000000101010001000100000000000000000100000000010000000000000010000000000000000000000000000100000000000000000000000100000100000000": TestData(n, 2) = "?"
  682.     n = n + 1: TestData(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TestData(n, 2) = "?"
  683.     n = n + 1: TestData(n, 1) = "00000000001000000000000000000010010101001001000000100000000011110001000011001100000100010001000000111001010000010100001001100000000100001000001100000010110000000100100011000000000000000010000101101000100000011000101001110000001000111000100011100010001000001010000000000010000001100000000000011000000000010111000000000100001000000000000000000001000001000001000100010000011100001000001100000001000110101000001010000000000000000000000011000000000000001000000011001000001010000001010101100010010000000100": TestData(n, 2) = "?"
  684.     n = n + 1: TestData(n, 1) = "10000001100110110010010000000000001000000000100011100010000010100101010001100000100010001001001111110010000010000101001100000110000100100000111100000111100101010000101000010000000010000111010000000011000000101100001010000100100000001010101001100001010110001000010100001100100000000110100101000110000101101110010101000011010010100110010000100010110111000010011000000000100111000010110110011110000010010001010011101101101110010011000011110010010011000001100000100000100000000010011011000110010000000000": TestData(n, 2) = "?"
  685.     n = n + 1: TestData(n, 1) = "01001100101100110101101011000000100000111001001011100101010010101101000111100010010110100100001100011111111100111111100001010100100000111110000001000101010110000110010000010100100110010001000001110110010111100101001011111011011000000100000000110001110000010010001010011000010001110001001010111111001100101011010101111100110010001001010100011001000000010010000111100011100100111001100000000000100001111111100000000111111000100010001101101100011100011110011010111101001010010100001011000010100100100011": TestData(n, 2) = "?"
  686.     n = n + 1: TestData(n, 1) = "00100100110010011100000010000100010011110000101011111000110110100000110111000100000100000011110100000011001000010010011110010000110011111010111001101111001001000011000011000000101101000011100000010101001011100000110010010010011000011100000010001000110011000011001111101100011101011010100001101100110000100001010110000001011111011100110000010100000001000010000000000010010000000000011000101011001001101000000010000000100000010001000001100110000101001111000000000011000000100100010010001111100010000100": TestData(n, 2) = "?"
  687.     n = n + 1: TestData(n, 1) = "00000100010010000111111000011000001000001000000010000110111000100100001000000000101010100010101001111011111100010001000000110000000011001100100001000000001000000000000000100000011010100101111000011001001011100011010110010000000000011111101000100000110101011011001100110111101000011010000100001010000000101110110110010100100111100100000000000100010001001000011000000000000010000000100000000000110000001000100000000011000110010000000001100010010000000001000101001111000011010111001001000100000110110110": TestData(n, 2) = "?"
  688.     n = n + 1: TestData(n, 1) = "00010011011010111001011100100100101100010110100111001001100011000011110101001110111001000010011000011001000000001000010100110101010000000111101000100110011111100000000010110000010001110001100101000011100001010011000010000111101110000111000100010110101001110001100010000000010001111000110001110001000001100000110111111110000101110100000101000011110011000101001101101100001000100100000000000001000000000100000101000001001000110110110001010010000001010100001101000010100000000001010001111000011010100101": TestData(n, 2) = "?"
  689.     n = n + 1: TestData(n, 1) = "00000000000000001001100001001000010101000000010001000000000001010000000000001000000000000000000010100001100000100010010000100000000011000001001111000000000101011100000101110001100000001100000100000100000101001000100010000100101110000000010000101101110101000111000010110011000000111010000110100101110001000000001001101000010000010001000010010000100110000011010000100001001000100011000010000000000000100000010000101100100000010000001100000100000000000000000000001000000110100010100110000010001000010000": TestData(n, 2) = "?"
  690.     n = n + 1: TestData(n, 1) = "00100000010001011000001000001010000100100001100111000000010001010001000001001011001011101000001010000001001010001010011100100001011000010100010011010100000000001000010011100000000100000100000110000101011001011100010111000000100011001010011100110111011010100100000000100000000000000001000100010000011001000000001001101000000110001000010011111000101000000000000010000100000000100000000000000000000000001100010000001111100110000101001000110000010000000101000001001000110000001000001100011000010011000000": TestData(n, 2) = "?"
  691.     n = n + 1: TestData(n, 1) = "00100000000000001000111000000010010001100011000011000100111000001100000111000100010000000001010011001000001000000011111000011100100000000000000100001100010010010100000010000011111101010010100101100000001110010010000100000000000001010000000000000001010010010001000000100000011111000011010001001100000000100011101000000001001010000000001101111101011000100000110011000000001001000000010000000000011010000001001001000100000000110110010000110011000000000010010110100000100001001010100000000001000100001000": TestData(n, 2) = "?"
  692.     n = n + 1: TestData(n, 1) = "00001100001100010100000100001111110011001111010000111001001111100010101101011000101100010010101010000011010111100100101100001110011001100000001011000111010000111000001100010000000100100111000100100000010101110100010000101010101110111011101001111000010110111110010000110110001010001111100101100011101010011010100110000101010110010100111101100100011000001011111110111001001101100000000001010011000010100000011001001011110000000000010100000000000100111110001000100101000100000000001000001001110000000000": TestData(n, 2) = "?"
  693.     n = n + 1: TestData(n, 1) = "00001010001000010000010100010010000011000010000110000010101110101011000011000000100101100000010000001100101010000100010000001101001000010001100110000110010000000000101000000000000001101000100000110110000010100110000111100110000000100000000010110000100000011000010000010001000100010001000001100001101000010010001000000110000010100000000010010110100010010011000100100110000111110001000010111000010101100010000001000010010001001001010000010000000010110110011000101001011000011011000100011100100000010010": TestData(n, 2) = "?"
  694.     n = n + 1: TestData(n, 1) = "00100000001000011000000000100010000000001010010000000100000100001000010100001100001000110000100010011101001000010000010000000100001010100100001000000100110000100111010000110000110010000010010000101001011101100010000100000100000000000100000000001011000000000000001100000100000000001010000011000100000110011000010001100000000000001000001000011000001000110011000000000100001010000000011010100000010001000100000100000010100000110100000011001010110000000000000011000000000000000000010100011010001100001101": TestData(n, 2) = "?"
  695.     n = n + 1: TestData(n, 1) = "00110011100000011100111100110011001100001100110110110011010111111001111100110000001001010100001001010111110101100100111110000111111111100111101011100011001111010100100000010001111111001101111111100111001111001111111001110010000101101111001100111000011110011001111100100111010100110010110111010111111110001111111100101011000101111110011011011111001110000001001111001111000011111000001011110000111110011111111101110100111111011001011111110010000010010010000010010000110011110101110101000011111100111110": TestData(n, 2) = "?"
  696.     n = n + 1: TestData(n, 1) = "00100101100100010000001001001010000001110100000101000000001011001000110101000111000110111001000000100001000100100110000000010001001010000010001000000000001000010001000100010100110110110000010100001010010100010100011100000010101110000101000101000000011000110101011100001000000000100011100111010010010000100111000010010000010000101010000001000000100000010000001010100000001000000000001010000000010001010000001101001111001110110010000001000000110100000010001000000000000010001000100100001110000100110010": TestData(n, 2) = "?"
  697.     n = n + 1: TestData(n, 1) = "01100010000100001101011110010000001010011110010010000110000100000001001011000011110000110001111000000000110100000001100000010100001000000001000001010010000000001000011100001010011010010011010001000000110011011001000001000011100001100000000100001110000011111110101000110100001000101000000111000100110110100000010000000011100000110100100010000000101001001100000000001010001010000001100100110000000100000111000001100010000000000000110010001000011001000101000000000000000000000000100000000001100000101000": TestData(n, 2) = "?"
  698.     n = n + 1: TestData(n, 1) = "00100000100001101010000001000100010000001011111101011101011111100010100000000000000010110100100001000000000000001010001000000100111001011010000000101000001001000000110011000101010010001110010000000000010001000100001010100000010010011011001000111010100000000000011000000101010010001100100011111110000110000000011100001100010101000001010101000010001010000000000000100000001011111110000000100000100000010100001010010011010111000011000010101101010010111000000000000001000001001011001010000100000010001010": TestData(n, 2) = "?"
  699.     n = n + 1: TestData(n, 1) = "11100000010000010110100000000110001000000001100000111000010000101001011110000100010000110100000101000011110000000000100100101010111011010000001110000010000110000001100010010000111010001100010001001000010110001000000110111001010001111110000010000100100100000000101110010000001100010110010011101001001001000000100000000000100010001001100110100011000001011100000100000010101000010001001010011000010011100010010100000010000001111000001001110000110011010001100000110001011000000000000101001011000101000000": TestData(n, 2) = "?"
  700.     n = n + 1: TestData(n, 1) = "00110000001110000010001000000100100000010101100000011000110000100100000001110011000001110101000001000000000110000000000001010000111001010000010000000000000000100110100110100000010011011100111000110000011000110000100010100010110000011010010100000000100000110100001000000000000001100100000111101000010000100000000001000000000000100001001100010010110000000011100000010000011100010000000000000101000000001000000001000010000001000000000000100000010010010000000001000011000000010100100000000000010000100000": TestData(n, 2) = "?"
  701.     n = n + 1: TestData(n, 1) = "10011001110100010000011010000011000010011011011001010111100001100010110101001010000001100011000000110000000000000000101101000011101110110000111111111110010000110100001110011001011000110101001100000010111110001010001000011011011001010000000100000110001010010000011110100010100011000101110110100100110000011000100001010100110011001110010000001001110010001100000010100110101111010110000101000111111010000100111000001110000000000000000000110001101000000011110001011110000100000000000100110010000100111000": TestData(n, 2) = "?"
  702.     n = n + 1: TestData(n, 1) = "01111000100000000100000001000001101000000000000101000000001011010001101010111000010011110010000000000000111011000010110011000000001000100110010000000110111000000000000000000100011010000000011001010100010010001100001000000001000011100001000000000100000000000000111000010000001001000000101011010010000000011000000000000000111000000000100011001100010001001100000000100111001000000001000001010001000000011010001000000011100110000110000100000010010001000001000000000010000000111100010000010101011000000111": TestData(n, 2) = "?"
  703.     n = n + 1: TestData(n, 1) = "11010000010110110011000011100001011111011000011110011101100000110000100000010000010001010000111110010110101001000000101110000110001000010001110100000010000001000011101101010000110010001100000100000011101100100001000000001100111001010100000100110001011100010000010111001110000100010010000010001111100000100100100001000110110001100110001101111011000001011001000000011100100101010011001100101011010001100010011010001001000001101101111011011111000011110010011000000000010010110010000000110001000100110111": TestData(n, 2) = "?"
  704.     n = n + 1: TestData(n, 1) = "00000100000010111110001000101100000010001010000000101101111001011001001011100000010101110001111001010110010000111100000010000111100100111101001000001110000110110001000000100011001101000011111101100101100011000100010101001000111111000011100000101010011000100011010000000000001100000001100111000000010111000000000100101000000110001000110000000000001000100001111000000010011001111000000010100000000001010110001101001000101000001100000100000010000011110010110111000011101011111100000110100011001100010000": TestData(n, 2) = "?"
  705.     n = n + 1: TestData(n, 1) = "10101110010100010000010000010000011111110110000001100001001110100001000011000000100100100000011001101101011010010100101000010000100111001010010001001100011000100010110010001111000000101000100001111011000001100000111111100110010011000000100011011000000110000000011100010011000100111111100001000001010001111100000100100100001101100100100000010010100111100101001000110011010111110010000111101000101001010001000101000010011001000111101011100010001000110010010111000011000010010100000000000010001000110010": TestData(n, 2) = "?"
  706.     n = n + 1: TestData(n, 1) = "00000111101011000100000110000011010111110011111001001111011000010000010010010101000001000001100100100000000010000000111110010110001100110000110011000110010001000100110011111000000001111100111111001000001001001110011010010000011001100001010000000011111111110100011111100100001011111111010000001100010100011010100000110010011100111010000011001110000000001101001010000001110011000010011100001000110010100011111100100001111110011100011111100100000110100100100001001001101100000000000110011000001000000010": TestData(n, 2) = "?"
  707.     n = n + 1: TestData(n, 1) = "11111110010011111111100001100100100001111111110110101011110000111101011111111111110011100111111001100111111111111111110010101010111111110011111111110011110010000001111111100111111110111000111111100001100010011001111111111011100010101101000100111111111010110011110011110011100111100001000101111100111001010111001010111111100001111011000100000111111001000111100100111111111000000001000000110110111001111000001010011001111111011011111000000100111110101100000011111111001111100001101100011010001111111100": TestData(n, 2) = "?"
  708.     n = n + 1: TestData(n, 1) = "00111010110000001111101100000000010100000110001000000001010110100100011011110111100001001110000000000000000100001000010101011010001011101000111011010010000000000001101101101001101001100001110000100100100111000110000101101010100000010010001000001100110000001011010000000000100000011010101100001001001101100100010010100001100001001100101000000000000000110010101010000000111001010111100100110001000011001100111111011001101110000010000111101000001100000000000000100010111110100010101000001011100001111001": TestData(n, 2) = "?"
  709.     n = n + 1: TestData(n, 1) = "00000001000011100110011001101000000000001110000001011000100011000001000101111001101110011101101111101110111100100010010110110011001000100000100000000101110010000010100111011110000111101001011001111100000110000110011001010001000000011100001111111101111100101101111011000000000100000000001111011000000001001011100100010001000001001100010000010011001110011000110011101001010110100110001110010000101111111011101101101100000010000100001100001100100011101011110110000110000010100110100010000110100110100100": TestData(n, 2) = "?"
  710.     n = n + 1: TestData(n, 1) = "10111000101111101010011001001100001111110011000111011010000001110001010110100110011010110000011100110011100010100101010010001100010010000111001010111011000110110100000000110010100011001010001100111111111010001111001101000111010111111100100010000011110010011010100100100110001000010010011101010000000000100011001000011111001110010011101100011111110010000111100001001001001000100001000101111001001000111000110011001010101010010101100000010101000011100011001000001000100110000000000000111000001110010001": TestData(n, 2) = "?"
  711.     n = n + 1: TestData(n, 1) = "11111001000101111111100011111101110101111110110001111101010100010000111111111111111110011111001110101111001101011111100010111111110100011100111110101110011001110011111111100101011000000101011100110110111100000101110000100100111110011110000111111111011011111100001100100110011001001101000001000101111001111101011101010110111100011100010011001000010000111110010001011110011111111111111001010111111101011111001110000000101001111010100111111101011000100101000011111001011001010011001101000110000100111111": TestData(n, 2) = "?"
  712.     n = n + 1: TestData(n, 1) = "11001000011100110101111111001111010111100011011111101101101011011101101010011111111010111001110011110011111001000011111111111110001011111100111000011111111111111011000110011100110011001111010000010010011011011111101010011100111111111001111111001100111111101001101111010111110101100111111110011111110101101110010010001101000000011111110000001111111111111100000101000000111100011011001111111110011101110010101011111111000110111010001100100111111111111111111100001110011000011100001100011010001100000111": TestData(n, 2) = "?"
  713.     n = n + 1: TestData(n, 1) = "01110000001111111111110011101001011000011111111111001111111100111111111111010110100011111110101110101001110000111000011111111001000000111100111100111100111101010011100111111110011111111100100111010001111111001100111001111111110011111111111101011111111000011111110100010101111110110111000010011110000100111010110010011111111100100111111111111111101101111100101010011110110110011110000110000001101101111101101111110011111111001111111101101101000100111101011101011111111001001111111111100110011111110010": TestData(n, 2) = "?"
  714.     n = n + 1: TestData(n, 1) = "00100110010011111110100011001111110011100111111111111111111111111100010111101000111111010111111010111010010111111001000011100111111111001111001111111111111100111111111111110101001010111101010010011100101011111000001010110111001100110000111111110011001101010011101010011111111100100110011111110101001111111100100001110011100111111111111111110011111111001110000010111001111001101100010000111111001101001011111111111010110001011111110011111111111001000011100001100110000111111100110010011100101011001111": TestData(n, 2) = "?"
  715.     n = n + 1: TestData(n, 1) = "01111001111110000010111001111101011111111000000101011111111100100111100001111111001101011110011110000111100111111110100101110000100001000010111101110101110000010001001110101111100100111111010010001100111111111111100111111111111111111110011111111110010011111100100001000011001001110011111111111111111111100001111111001000010011111111100111111100100001000011111111111111000000111111111001010110011111100110011001110011100111110011100111110011111010111100111111100000011111111110011110011001001101011100": TestData(n, 2) = "?"
  716.     n = n + 1: TestData(n, 1) = "11111111111101101111111100111001111110010011111000011010111111111110011110011111110010011111111111111100111111111111100111110011111111111001111111110110111111111111000101000011111111111001000011110100010010011111001111110010111010000111110010011111111001001110011111111101010011100000011100111111010100001110011111111111111111110110111100101110111111111010111100111111111111111100001110000110011111111111100100111111111111010111100111111001100111111111100001111111111111101010110111111001111111100001": TestData(n, 2) = "?"
  717.     n = n + 1: TestData(n, 1) = "10111001000011101011111011000110000100101000111000011110110001111100111101101000000001110010100001000111001001111010101011010110011110100110010101101001100001001000000100110000001011011111010000101010001011001011111101001011010110011010100100110101010101011000000111010110101000100111000000010000100111000111000001000101111101011100000011100111000001001011000000000011001011110010110000110001111111010101110110111110101010000001011011101111011100010101001110000111101001010001011001100100110011101111": TestData(n, 2) = "?"
  718.     n = n + 1: TestData(n, 1) = "00011000111110101110110100111010001110101001010110011110000101101100100000101000111000111100001111101110110011110111010010011111011100101001010110000110011110011001111000000100110101010010111100001111101010011101110110000111111100000101111100101011110000010001000111111010111100101010111110010011111100111100111100100000011111100100111101111011010111000110011101110000110011001010110101110001000100000100001001010101010111110001011110000011011111100110011001111110011111011000100110011001100000110100": TestData(n, 2) = "?"
  719.     n = n + 1: TestData(n, 1) = "11111000010101110101001110011110000111001101100000010000110100111100111110101000011100001000001011101001100110100101001100110101101100001111001000101101100010010011110100010000101011010110011011011001100001100111111001011001100101010111000111000010111111101011101011010100001101011010000001010101101011001100111010110011101010010010000100001101010101011101111000010010100110111101101110011101001001011111101000111101011000010001110000110010001100101010101111010111100101100001000000111101101011000010": TestData(n, 2) = "?"
  720.     n = n + 1: TestData(n, 1) = "10000000000101100111000000010100011011010001111000101010111110011101101100011101001101111001000100100100000101111001110010011110010100011010100111111111101000100011000101010011111000011001111000011000000100010001000011100110111000001010111101001101001000100010001011100111111001111010011010010010111011111011001110111000001000110000101011010010010000010001100011100101010101101011111000111011101010101111111010001011000111110011111100010001010011011000100110011010101010110011100011010011111000111011": TestData(n, 2) = "?"
  721.     n = n + 1: TestData(n, 1) = "11010000010011101000010111000000011000011010011110010011001110001001010110110011100111000000101011100110101001110011110000000001110100001010111111111111001011011110000001100111111010100111110101001100010110000010101100110001000010011010100001001100110011101101111100100110110110111010100100010011000110111001101001110111101010010000011011001001110011111111010000011111011100111010111110110101011011110010011010000100101000010001001011100111100110101010101011001011011001100110101001111001010000100010": TestData(n, 2) = "?"
  722.     n = n + 1: TestData(n, 1) = "11010110011010111111001111010011110111100111001110010011101000111010010011001100011110011010000101010110111101011101101011010001111011001111010000011010110000100100011111000001110100110000100110010000111111010010100111000100101110110100110000001010111100010000101000100010100111000111000010000010010110101111001000010010011100111010000111010111011011011000010101100111100110010101001101101101100101100111100110110001101001001001011111001110100010101101110000010101111101010011111000111100000111010110": TestData(n, 2) = "?"
  723.     n = n + 1: TestData(n, 1) = "00000100110111011101011011011101001011000100011001010111110100001100000011011001110010110011101111001111111000100111010101100111001111001101100001001110111110010110110101001001001010001100001100001010101011001100000100011000001010101001100100100100001111010110011101101110100101111100101001101001001010110010001011111111110010111001100000011101111101001101100101100101110101101100111000111010001110000111100100000100011000010110111110011000000101000111111001110011011111000110111101010111100001001101": TestData(n, 2) = "?"
  724.     n = n + 1: TestData(n, 1) = "01111111101101010001101000100100111100001101111000111100011111000111111101101001100100110001101111001100110100010110111100010010111111100001100011010010101111111111001111010010000000100001101101111010011101000110111110101110011111111101001000000000000011100001110101110100010011000111001011111100011110001110001001011001001101010100000101101100100001110110111111111111000100000100111011000111100111111000101110010110101010011010011011110100001011100001110011110111110010010000010100010110101011111010": TestData(n, 2) = "?"
  725.     n = n + 1: TestData(n, 1) = "01010010100000101100110000111011100101010111001101011001101011110001001011001111100011011101011110001100000001111100111010010010101101111101100100000110100010010101111110011111110011001101001001100011101000100010110001011000001111011001100101110001110111101110000011011010101111000001111000011010101101110101001011011111110101100100101100110011000010011101101001110111000011010111001100101100001101001001100101011100111010000010110100000101111111010001110000110101110101000110011001011011011101000110": TestData(n, 2) = "?"
  726.     n = n + 1: TestData(n, 1) = "11001000101011011111101000010000110111111111000011010000010101000000100110111110010000000111110110111111100110101010111110011010001110010110100101000010111111000000111100111000011100100111001100111111110100010110000010010011000111001110001110110100111110101111011010100010000101001001101111111101010101111010111111001001001111111100101011011011101001100000100010111110101010100001110000110011001110101100101000101000111100100101110110011111001101011001100011100101001001100010101010011001010001111101": TestData(n, 2) = "?"
  727.     n = n + 1: TestData(n, 1) = "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111": TestData(n, 2) = "?"
  728.     n = n + 1: TestData(n, 1) = "00100000000010000000000100000011000110110001001110101010010011010001100000101001000000000000010001110100001001101000001000000000010001101001011000010000000000010000000010011010011001001000000100000100000000001000000001000101001000001110001001000100000000000100000111000011010000000000010001000000110010000000011000000000100100001000001000010001001001110000000010000000100000000000000010000100000010000000101110011000001000100000011010100001010000001000010100000000001000001100000100010010000101100000": TestData(n, 2) = "?"
  729.     n = n + 1: TestData(n, 1) = "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111": TestData(n, 2) = "?"
  730.     n = n + 1: TestData(n, 1) = "00001101110100101100011001010001001010010110000110000000100001000100100110000000010010100011000100110000110000100010000011001000000000100000001000100100100001100110100000101000101000010001110001111001000101000000100100001000000001110110100010001001000100100000011011000001000000000101000010000100010000110101001010010010001000110010110000000110010000110000001000101010001001101111001000010000101100011000000110001011110000001111001000000000000011110011100000000101010000000101110001000100000000100000": TestData(n, 2) = "?"


« Last Edit: December 14, 2021, 10:02:42 am by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline random1

  • Newbie
  • Posts: 86
Re: Looking for old program or help recreating it
« Reply #57 on: December 14, 2021, 11:42:53 pm »
STxAxTIC

I added your latest code to my main program and everything seems to be working as expected.
I'm not getting quite the results I had hoped for but I have not had time to run enough test to
really tell one way or the other.   

One question I do have has to do with my process bar.  Where would be the best place to put
a counter so that it closely approximates the overall number of iterations each prediction takes?
Nothing big, just thought you might have good idea where to place it.     

R1

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
Re: Looking for old program or help recreating it
« Reply #58 on: December 15, 2021, 02:30:16 am »
Hey R1,

Good question. I'll think about where precisely to inject some kind of percentage counter that gives a sense of how long an iteration takes.

So as usual, I updated the code again, and it's now a factor of about 100 times more productive than it ever was. (Almost literally 100 more answers per second compared to the old versions.) It occurred to me that its silly to do *one* test per entire string all the way at the end. So instead, we still feed it big random strings, but instead the program gives a new prediction every for every character in the string. I commented out the order 11,12,13 alphabets, so the thing is so fast now it needs a delay to watch. If i ever feel it lacks accuracy we can just bring the bigger alphabets back.

Even better too: it's been tested with real data generated by different humans and different RNGs. The results are nothing but pleasing. I'll resume this tomorrow, but I wanted you to have the latest:

Code: QB64: [Select]
  1.  
  2. Screen _NewImage(100, 30)
  3.  
  4. ' Version: 11
  5.  
  6. Type LetterBin
  7.     Signature As String
  8.     Count As Integer
  9.  
  10. Dim Shared Alphabet1(2) As LetterBin ' 0 1
  11. Dim Shared Alphabet2(4) As LetterBin ' 00 01 10 11
  12. Dim Shared Alphabet3(8) As LetterBin ' 000 001 010 011 100 101 110 111
  13. Dim Shared Alphabet4(16) As LetterBin ' etc.
  14. Dim Shared Alphabet5(32) As LetterBin
  15. Dim Shared Alphabet6(64) As LetterBin
  16. Dim Shared Alphabet7(128) As LetterBin
  17. Dim Shared Alphabet8(256) As LetterBin
  18. Dim Shared Alphabet9(512) As LetterBin
  19. Dim Shared Alphabet10(1024) As LetterBin
  20. Dim Shared Alphabet11(2048) As LetterBin
  21. Dim Shared Alphabet12(4096) As LetterBin
  22. Dim Shared Alphabet13(8192) As LetterBin
  23.  
  24. Alphabet1(1).Signature = "0"
  25. Alphabet1(2).Signature = "1"
  26. Call NewAlphabet(Alphabet1(), Alphabet2())
  27. Call NewAlphabet(Alphabet2(), Alphabet3())
  28. Call NewAlphabet(Alphabet3(), Alphabet4())
  29. Call NewAlphabet(Alphabet4(), Alphabet5())
  30. Call NewAlphabet(Alphabet5(), Alphabet6())
  31. Call NewAlphabet(Alphabet6(), Alphabet7())
  32. Call NewAlphabet(Alphabet7(), Alphabet8())
  33. Call NewAlphabet(Alphabet8(), Alphabet9())
  34. Call NewAlphabet(Alphabet9(), Alphabet10())
  35. Call NewAlphabet(Alphabet10(), Alphabet11())
  36. Call NewAlphabet(Alphabet11(), Alphabet12())
  37. Call NewAlphabet(Alphabet12(), Alphabet13())
  38.  
  39. '''
  40.  
  41. Dim TheString As String
  42. Dim predictedGuess As Integer
  43. Dim correctGuesses As Double
  44. Dim totalGuesses As Double
  45. Dim progressReport(1 To _Width) As Double
  46.  
  47. 'TheString = "110111001100010110010011101011100111010101100001100101011010101111110000111100010101110000010010110001" ' Wolfram 30
  48. 'TheString = "001100000000001111111111111110110000000010111000000000111111111011111111100000000000110000000011111111110100011111100000000110110000110100111111111001101110100000000101000001100101110011111101001111000000000000000010000111001110011111111110111110000000000000000001100110001000011001011110000000000000000000000000000000000110101111100000000000000001100000000000000001111101111000000000000010000000000000011110111111111111000000000001100111110000111101111111111111100000000111110111110001111011111111111101110000000011111111000000000000000111111111111000000111100000000000000000000111110011110001010111100000110000000000000011110111110001111011110000000000010000000111100111111111111110000000000000110000001111001111100011111111110000000000000000000111111010110011111111110000000011000110000111110001010001111101111000000000011110001110110011010000110001111110000000111000011111000001010000111001111100000000000000111110011111001000000100111110011000000111111111111111111000000001111111111111111111111111111111000011000000100001110111111111111111111110100000000000111000111101111011111111111111000000000001111100111110000000011111111110000000100000001111011110000001111111111111110011010001111111111111000011111111111111110101101111111111011111001001111111111111" ' Chia
  49. 'TheString = "101000110111011000000001110011010010101011111010100110010111010000011110101101100001010110110000011001001001010101011011111111100100010010101110100001111001100000010011110000110011100011110010000000011101001101001100111110100001001110111100001110001101011010110100011110111110010110010000010111101100110110000011101100000100111100011000000111010110010101010000101001000111000011110011000101000100100010001100101110111000001000000111001011111101000111100001101010011010011001010100001101100001010111011011110000101111111000001011111000010001100010101011011110100010111110010100111001101001001001110100111010011100110101100110110110101101011000010000010101110111100010100001110111011101111100001010001110000011001110010100010001110111000111101000100100111110000011001111011000001111100101011100000111001110110011010011001111110110001100000100001010011100100011111001011111011101011100101000111010110011111011111100010101011001100011100000100111111010001010001010010010001101101001001001111011001100011100001000001010100000000011001111010011101101010111101101010011010000001011000010111100110011100101011011011101111110011000010000000001111001000111011101010000101001010001100110001010110100000100110101110001000110110110011001001100010111110111100010000010001010101110100010000001110011010111101010101101000000110000000110100111101011100101001100001111100100101010101010101101000111100000101011101100011010110010110101011101011010111101100110101010111100000100100100001011000100001100001010100010100011101011100111000101010101001000000010001010111100111001101011111110011100001000110110001001001101000100011111100011101010010111110101100101101110000111000100001101110101111010000011001110000000100111100001011010100101010010011100011101000110000110000111001001011100010010100110001101110001110010010101010001110011001111011101011000110101000110101011100100110011001100010010011100000110100100000010000001011110000110101011001011011111100000101100100110010101010010011101100011111111010001011000011111101010011100100010011101110010" ' Cobalt 3k
  50. 'TheString = "1011001010010100100100110010101010101001010101010101011010010101001010101001010010100110101011010101010101011010101101010101010101010010110101010101100101010101010110101101011010010101010010100110101101001010110101011010010101101010110100101111010101010011011011010010110101010010110100101101010100101011010010101001010101010001011101011010010101011100111010010001101011110010011010001011100110101010010011010101001001010010000101010110001" ' loudar
  51. 'TheString = "11111011110100101011111111110100000011011110101100111100111111110111101110100111100110011111110101111111010111101111100111110111111111111011100111110111111110010000101011111001110101101010110111110" ' Spriggs 2
  52. 'TheString = "1010001101110110000000011100110100101010111110101001100101110100000111101011011000010101101100000110010010010101010110111111111001000100101011101000011110011000000100111100001100111000111100100000000111010011010011001111101000010011101111000011100011010110101101000111101111100101100100000101111011001101100000111011000001001111000110000001110101100101" ' Coalt legit
  53. 'TheString = "01001111011010000010110000100000010010010010000001110111011011110110111001100100011001010111001000100000011010000110111101110111001000000110100101110100001000000111011101101001011011000110110000100000011001000110111100100000011101110110100101110100011010000010000001110011011101000111010101100110011001100010000001101100011010010110101101100101001000000110001101101111011011100111011001100101011100100111010001101001011011100110011100100000011011100110111101110010011011010110000101101100001000000111010001100101011110000111010000100000011101000110111100100000011000100110100101101110011000010111001001111001" ' Zach binary thing
  54. 'TheString = "1000000111011011110101111000000010101111000111011001111101010001010001100100110101111000001000000111010111100101101110111011001001100101000101001100011010000010101011100100101000011010010011011100100000110000000100001011110000010011111101011111101110001011011011111100110011100101010101000000000000101001100110111111100000001101000000110010001011111010011101100101100011001101001110101101100010100001100110101010001010010101011011101001011010000110110011111001101010001111100010100111101011100110101111001100001011000000110010110010010011110111001101111111110010111010001100000011000110111101011111000000000111010011000101101010001101101000001010110010100110101101010010001101101000000000001011101011110111110101000000010101001010001111110100101101001111010111000001011110101010011100100011101000101101100101101100111010100011100100100001010100110011111010000100100101010110100110101011011100011101110111011011100011101010111010010001000001001000110011110101011001010111000011101010101011011010100100001110010001100010001111010100000000011011110100101001011111001001100011110110010100100101111101111010001111011011110101111000010101111001011101010011101001000010110110101011110110000000001010101100111101000001101011001101100110100110110000000100001001001111100111111110010111011001000000100110011010110011110100011000000011101101010111001101101110011010001010110010010100001111001011000001010001111110100011101010101110011111100010101110100001101000011010111011111010101101111110110000010010010000101001011001000001011101000111101110010001000101011001010000011101110101010110100001000111100000011100110011111111011111100111000001010010011101111001110101001111001011011101101010101001101100110010010100101100110101100011000001000100110010100101111011011100110110001010011000011001110110100110110011111110110111011100010110010110011110101111001110011011010001001111010000111001001110001110001111101101111000000101001011001101110110100100001111100010001101111011000101101001110101010101001001111111011100001101110011000100011100011111011111001010010110001010111010101100010010101101100111110000010000110110110000101001111001110111001101100010111011110110001101101000011011111001111101100011100101010100001010000101111001101010000001000010100001111110110100100101011110000100001000001100110111010001110100011111101100001111000001011010011011111110110011010011011100001010100011001110100001001101111111110000100101011111010011111010111111110101111100101001011001001101011011101001000011101100100001100010000111011000100111101010011010100010110101001111101011101010000111100100011010001011011001010010111001001010100000101001111000101001011111011101011101001010000100111110111011110010010100101111000010001101100010010111111000110000110011010011110000101011011101001100101010000001010001111000110110011000110000010001010110110001011111001100100000110100100011110001010110011110010001000000100101111000111110101100011001010000110101001001010000100000101100010001011001110100010110100101010100010110110000100101000011111010000011110101010100100110101000001001110100101000010110100011111000110011111010010010000111101110111001111110000010110101101010010101011101001010001010101111110001101001101010010001011101011100101101010110001101010101101011101100111101110101111110011101110010100110111100101011110100110111111100110101011011111000100000100100011100111011111010111100111100111110100000010001011110111011000100101111100100100101000100110000110110111101010111001011011010000111000111111111001011000101011011000001011111000100001001011001111011011011101101011111000000000100110010011111000000111000110100010110101101001010110110100001100000011110011100110000101000101101010000010011011110000011001010111001011100000101111011110110100100010011100111000001001000110110111010101001011100010111010000101010001010001000001110011100001101010011001100011101010001111011111101001001010000010000011100110110001110000000100111010011111110011100111101000000011011000101101001011001110000110010001100000111101110010010100000101110010111110111000100001110011111111001111100101010110000110101101000000100110111000000110111001011110101100111100110101011000100000110110101100001000111010111101100000000100110101101101000101010100001110110010101011110010011100001010010100011010111110001010111001111011111001000110110001001100000010001001110001011000101101010111011101101110111100100000101011110000011001001110100111111010001001010000110010001111110000000010001011111000001001101101010111110111100011011011001000101100110010010100110110011110111110110101010010011000100101110011101010100010011110011001011100010101100000101011000111001111100010101010000100100110010110011001110111100100000001010001101111010011100110010101011101001110100111110100001111000111111101000110000001010001010010010111110011011011011010101000100101010011111100011111110101010101110001011110100100110001011011100100000010111010001010111101101100100111001001110101010000111010111111110000010011100101110101110010111100101010100001110100000111110010111111001110011101110001101100000011011110000111100101111100101111101010101001110110011010111110110011100000000010101001000000011100001111000011000110101001010101100110100110111001001010101001110010111000111111111101001111001101100001000010110000000100110110010001110000110001001111000011111110111011010111101001000010001110010101110000000100011100110101110111011000101100010100000101010110100111010010000111110011111100110010110111101010011000000101001001001100111010001001101101111010101110000010000111000101011111100010010101000110001010011101001111101110010110101110101011110011001001100011001011111100011011001000010101101100010110010011010111011111111110011011010111000100011011110100100111111110010100100100100010001000001111100100010011001101000100010110111001111100001010001010110100111111101110000000010100001111101000100011101110000100111011101100100111101110011011011000100010000100001111111011010010001001101000111000000100011011111101110100001100010000111110001110100111011010001001000111000010101100001101001000101001000111100100101000011111110001011011101110010011000110111100110000110111010111111001010100001010001110010100101001001001101111001000010010000111011011010000100111111100011111110100110111001111011001111011010000010001111010100000111010010011110000010011111111001100001010100110001111010001010110101100000010001101000101001110001100111111000101111011000001111110110001011110000001011010001110010011001001011110101001111010011000110001101111101000011110111011000000011100101011101100010010001101101011100000100000000101000101011101100011011100011001101010110011111100010011001110001010010011010110011111111111001010100110100101111001010100001010001001100101110110100111101100101010100000111110000011110001011000010110101110110001001100110011111111010101100100000100110010101000001001110101101100001000100110111011101011110100100110101010000110011111000101001011110111111010100000010000111010110110010001100001011100001100001001000001001011111011111011011100100100101001101110010101000111111000000100001101101010011110111000001000010100110111100100111110101111000110111110111000010110100110000001110110010000001111011000100110101010000100010110100101110010011001110100010111011100101100111011101110000011101100111010001010010100001011101010101101000111100100100110010010110001100010100101001010100111111010001100111111111001110001011101000101011101010110010101100011111101100010000000001111000011100010010001100100100001010000000000011100000001101110101111111110001011001101000101101000101001001000110000101110100000110001010011001001010100100111001110111001101010101101111000001011000100000001101000011000001001011001110101110101010010000100011100011010010001000100001011101000100101001111100010110001110101001011000101110010011101000001001111100110001000101010011011001111101101011111011010110101101101001001100100011001010001001011101000101000101110001101101110110010110011010000100000010101110111100001100111101111111110000001010111111001110100101010010100000110001001011111110001100011110101001011110000010111110000010000101110111000011001010011100010010101011101101110111001001110110101110110111011110001100010100101101011111111010011110000011010100111111001101010000101001000111000011110011000101000100100010001100101110111000001000000111001011111101000111100001101010011010011001010100001101100001010111011011110000101111111000001011111000010001100010101011011110100010111110010100111001101001001001110100111010011100110101100110110110101101011000010000010101110111100010100001110111011101111100001010001110000011001110010100010001110111000111101000100100111110000011001111011000001111100101011100000111001110110011010011001111110110001100000100001010011100100011111001011111011101011100101000111010110011111011111100010101011001100011100000100111111010001010001010010010001101101001001001111011001100011100001000001010100000000011001111010011101101010111101101010011010000001011000010111100110011100101011011011101111110011000010000000001111001000111011101010000101001010001100110001010110100000100110101110001000110110110011001001100010111110111100010000010001010101110100010000001110011010111101010101101000000110000000110100111101011100101001100001111100100101010101010101101000111100000101011101100011010110010110101011101011010111101100110101010111100000100100100001011000100001100001010100010100011101011100111000101010101001000000010001010111100111001101011111110011100001000110110001001001101000100011111100011101010010111110101100101101110000111000100001101110101111010000011001110000000100111100001011010100101010010011100011101000110000110000111001001011100010010100110001101110001110010010101010001110011001111011101011000110101000110101011100100110011001100010010011100000110100100000010000001011110000110101011001011011111100000101100100110010101010010011101100011111111010001011000011111101010011100100010011101110010101110101111011111001010010000100110101110011000100001010110011111001011010000100011011110001000101011100001100011001111000111111010" ' Cobol
  55. TheString = "10111010101010101010101001010101010101001010101001010101010101010101010101010101010101010101010101010101001010100100100101010101010101001010100101010101010100101010100101010101010101010101001010010110010101010010101010101010101010101010100101001001001010101010101010101010101001010101001001101010010" ' Spriggs hand
  56. 'TheString = "01100101001010001100001101101111011010010101010110110101001000001111001111110101000101111011010101111101010101101010101001010101011000010101010101001011010100110100110100110011010101010101110101010111111101011010100000001101111000010111000110111001000010100001101010110100000111101011111100001011001010110010110" ' Luke 50
  57. 'TheString = "010101111010111100110000001001100100101100000101110001100101000010001001111101111111111100011110000011011110011000100011100100001101110011001001011001000011110010001000111100011100011110010110011110111010110100001000110000010000111000111011100110011010101111111100100010001111111100010100001011000011" 'Spriggs
  58. 'TheString = "10101010101011101000011101010111010101010101100111001010100111100001011011110101000001111010101101010000001111110011111110111101110111001110110010000100010101010101010100101011010110101010101010101001000000001111110000011110101010101010100010101110101010101101111111111111111111101010101010101000000" ' 63
  59. 'TheString = "11100101110011011010110100110011111011010110100100000110000100101001001010011100111101101110000001000000011011100101110000000111100100011101000000101000110100001000000001111010101011000010001110111110001001110101011000010101001111010100100000011100110110110000111010001010000011010000101111101011000" ' using RND function
  60. 'TheString = "00101010001100101010010101010100101010010100101010010101010100100000101011110101001010010101010010000011101010100101010101001010010101010101010110101001010100101010101001010100101010100101010100101010101001010010101010010101010101010100101010101010101010101001010101010100101010101001010101001101010" ' 78
  61. 'TheString = "11100101010011001001001010101001010000101001000010100010110111010101010011010100100100110101010010010110100101001001010010101010010010100101001010010100100101001001010010010110010010101010101001010101001010101010010101001001010101001010101010101010101010101010101010010101001010010100101001010101001" ' 68
  62. 'TheString = "10101011100101100101010101010101010101010101010101010101010010011010100000000011111111111001011001101010101010110010101010101010101010101010100101100101010101010110011101011110101010101010101101101010101111010101100101001011010010101010101011010101001110101010111101110011010011001101001101011000101" ' 68
  63. 'TheString = "10101101000110101000101010101010101010100101010101010100101110010101001001010100101010101001001010101001010000010010001010010010101010100110010101010101010101010110010101010010100101010010101010101001010101010101010010101010101010101010010101010101010101010101010010101001001010010100101010101010101" ' 76
  64.  
  65. For j = 1 To Len(TheString)
  66.     Cls
  67.     Locate 1, 1
  68.     Print "Analyzing:"
  69.     Print
  70.     Print Left$(TheString, j) + "["; Right$(TheString, Len(TheString) - j); "]"
  71.     Print
  72.  
  73.     ' Main prediction call:
  74.     predictedGuess = Analyze(Left$(TheString, j), 0)
  75.  
  76.     Print "Prediction: "; _Trim$(Str$(predictedGuess))
  77.     Print "Actual:     "; _Trim$(Mid$(TheString, j + 1, 1))
  78.     If (predictedGuess = Val(Mid$(TheString, j + 1, 1))) Then
  79.         correctGuesses = correctGuesses + 1
  80.     End If
  81.     totalGuesses = totalGuesses + 1
  82.     Print "I have been correct for "; _Trim$(Str$(Int(100 * correctGuesses / totalGuesses))); "% of "; _Trim$(Str$(totalGuesses)); " guesses."
  83.  
  84.     f = (_Width - 1) / Int(Len(TheString))
  85.     If (f > 1) Then f = 1 / f
  86.     progressReport(1 + Int(j * f)) = correctGuesses / totalGuesses
  87.  
  88.     For k = 1 To 1 + Int(j * (_Width - 1) / Int(Len(TheString)))
  89.         Locate 25 - Int(10 * progressReport(1 + Int(k * f))), k: Print "*"
  90.     Next
  91.  
  92.     _Delay .05
  93.     _Display
  94.  
  95.  
  96. Function Analyze (TheStringIn As String, pswitch As Integer)
  97.     Dim TheReturn As Integer
  98.     Dim As Integer n
  99.     Dim As Double r, j, k, h
  100.     Dim Fingerprint(16) As String
  101.     Dim p(2 To 10, 2) As Double ' Change the upper bound to a higer number for more accuracy.
  102.  
  103.     ' Create shifted versions of string, i.e. ABCD -> BCDA, CDAB, DABC, ABCD, BCDA, etc.
  104.     Fingerprint(1) = TheStringIn
  105.     For n = 2 To UBound(Fingerprint)
  106.         Fingerprint(n) = Right$(Fingerprint(n - 1), Len(Fingerprint(n - 1)) - 1) + Left$(Fingerprint(n - 1), 1)
  107.     Next
  108.  
  109.     ' Initialize partial results.
  110.     For n = LBound(p) To UBound(p)
  111.         p(n, 1) = -999
  112.     Next
  113.  
  114.     Call CreateHisto(Fingerprint(), Alphabet2(), 2)
  115.     Call CreateHisto(Fingerprint(), Alphabet3(), 3)
  116.     Call CreateHisto(Fingerprint(), Alphabet4(), 4)
  117.     Call CreateHisto(Fingerprint(), Alphabet5(), 5)
  118.     Call CreateHisto(Fingerprint(), Alphabet6(), 6)
  119.     Call CreateHisto(Fingerprint(), Alphabet7(), 7)
  120.     Call CreateHisto(Fingerprint(), Alphabet8(), 8)
  121.     Call CreateHisto(Fingerprint(), Alphabet9(), 9)
  122.     Call CreateHisto(Fingerprint(), Alphabet10(), 10)
  123.     'Call CreateHisto(Fingerprint(), Alphabet11(), 11)
  124.     'Call CreateHisto(Fingerprint(), Alphabet12(), 12)
  125.     'Call CreateHisto(Fingerprint(), Alphabet13(), 13)
  126.  
  127.     If (pswitch = 1) Then
  128.         For n = 1 To _Width
  129.             Print "-";
  130.         Next
  131.         Print
  132.     End If
  133.  
  134.     If (pswitch = 1) Then
  135.         If (Len(TheStringIn) >= 2) Then Call PrintHisto(Alphabet2(), 3) ' Set the last number >=1 to print stats for that histogram.
  136.         If (Len(TheStringIn) >= 3) Then Call PrintHisto(Alphabet3(), 3)
  137.         If (Len(TheStringIn) >= 4) Then Call PrintHisto(Alphabet4(), 0)
  138.         If (Len(TheStringIn) >= 5) Then Call PrintHisto(Alphabet5(), 0)
  139.         If (Len(TheStringIn) >= 6) Then Call PrintHisto(Alphabet6(), 0)
  140.         If (Len(TheStringIn) >= 7) Then Call PrintHisto(Alphabet7(), 0)
  141.         If (Len(TheStringIn) >= 8) Then Call PrintHisto(Alphabet8(), 0)
  142.         If (Len(TheStringIn) >= 9) Then Call PrintHisto(Alphabet9(), 0)
  143.         If (Len(TheStringIn) >= 10) Then Call PrintHisto(Alphabet10(), 0)
  144.         'If (Len(TheStringIn) >= 11) Then Call PrintHisto(Alphabet11(), 0)
  145.         'If (Len(TheStringIn) >= 12) Then Call PrintHisto(Alphabet12(), 0)
  146.         'If (Len(TheStringIn) >= 13) Then Call PrintHisto(Alphabet13(), 0)
  147.         Print
  148.     End If
  149.  
  150.     If (Len(TheStringIn) >= 2) Then Call MakeGuess(TheStringIn, Alphabet2(), 2, p(), pswitch) ' Set the last number =1 to print guess for that histogram.
  151.     If (Len(TheStringIn) >= 3) Then Call MakeGuess(TheStringIn, Alphabet3(), 3, p(), pswitch)
  152.     If (Len(TheStringIn) >= 4) Then Call MakeGuess(TheStringIn, Alphabet4(), 4, p(), 0)
  153.     If (Len(TheStringIn) >= 5) Then Call MakeGuess(TheStringIn, Alphabet5(), 5, p(), 0)
  154.     If (Len(TheStringIn) >= 6) Then Call MakeGuess(TheStringIn, Alphabet6(), 6, p(), 0)
  155.     If (Len(TheStringIn) >= 7) Then Call MakeGuess(TheStringIn, Alphabet7(), 7, p(), 0)
  156.     If (Len(TheStringIn) >= 8) Then Call MakeGuess(TheStringIn, Alphabet8(), 8, p(), 0)
  157.     If (Len(TheStringIn) >= 9) Then Call MakeGuess(TheStringIn, Alphabet9(), 9, p(), 0)
  158.     If (Len(TheStringIn) >= 10) Then Call MakeGuess(TheStringIn, Alphabet10(), 10, p(), 0)
  159.     'If (Len(TheStringIn) >= 11) Then Call MakeGuess(TheStringIn, Alphabet11(), 11, p(), 0)
  160.     'If (Len(TheStringIn) >= 12) Then Call MakeGuess(TheStringIn, Alphabet12(), 12, p(), 0)
  161.     'If (Len(TheStringIn) >= 13) Then Call MakeGuess(TheStringIn, Alphabet13(), 13, p(), 0)
  162.     If (pswitch = 1) Then Print
  163.  
  164.     If (pswitch = 1) Then
  165.         Print "Analyzing:"
  166.         Print TheStringIn
  167.  
  168.         Print
  169.         Print "Thinking:";
  170.         For k = LBound(p) To UBound(p)
  171.             If (p(k, 1) <> -999) Then
  172.                 Print p(k, 1);
  173.             Else
  174.                 Print "_ ";
  175.             End If
  176.         Next
  177.         Print
  178.     End If
  179.  
  180.     j = 0
  181.     r = 0
  182.  
  183.     For k = UBound(p) To LBound(p) Step -1
  184.         If (p(k, 1) <> -999) Then
  185.  
  186.             ' This is the made-up part of the model:
  187.             ' The variable r contributes to weighted average.
  188.             ' The variable j is used for normalization.
  189.             ' Scaling factor h influences weighted average calculaton.
  190.             ' The factors multiplying h are totally arbitrary. Notes:
  191.             '   setting o(h^2) means the later alphabets count for more.
  192.             '   p(k, 1) euqals the calculated guess at frequency k.
  193.             '   p(k, 2) euqals the peak count of the unscaled histogram.
  194.             '   ...while p(k, 2) is here, it does not seem to help calculations.
  195.  
  196.             h = 1 + k - LBound(p)
  197.  
  198.             h = h ^ 2
  199.  
  200.             ' Standard weighted average:
  201.             r = r + h * p(k, 1)
  202.             j = j + h
  203.  
  204.         End If
  205.     Next
  206.     If (j <> 0) Then
  207.         r = r / j
  208.     End If
  209.  
  210.     If (pswitch = 1) Then Print "Predicting:  "; _Trim$(Str$(r))
  211.  
  212.     If (r > .5) Then
  213.         r = 1
  214.     Else
  215.         r = 0
  216.     End If
  217.  
  218.     If (pswitch = 1) Then
  219.         Print "Rounding to: "; _Trim$(Str$(r))
  220.     End If
  221.  
  222.     TheReturn = r
  223.     Analyze = TheReturn
  224.  
  225. Sub MakeGuess (OrigString As String, arralpha() As LetterBin, wid As Integer, arrbeta() As Double, pswitch As Integer)
  226.     Dim TheReturn As Double
  227.     Dim As Integer j, k, n
  228.     TheReturn = 0
  229.     j = 1 '0
  230.     k = 0
  231.     For n = 1 To UBound(arralpha)
  232.         If (Left$(arralpha(n).Signature, wid - 1) = Right$(OrigString, wid - 1)) Then
  233.             If (arralpha(n).Count >= j) Then
  234.                 If (pswitch = 1) Then Print "Order-"; Right$("0" + _Trim$(Str$(wid)), 2); " guess: "; arralpha(n).Signature; " . "; _Trim$(Str$(arralpha(n).Count))
  235.                 TheReturn = TheReturn + Val(Right$(arralpha(n).Signature, 1))
  236.                 k = k + 1
  237.                 j = arralpha(n).Count
  238.             End If
  239.         End If
  240.     Next
  241.     If (k <> 0) Then
  242.         TheReturn = TheReturn / k
  243.         arrbeta(wid, 1) = TheReturn
  244.         arrbeta(wid, 2) = j
  245.     Else
  246.         TheReturn = .5
  247.         arrbeta(wid, 1) = TheReturn
  248.         arrbeta(wid, 2) = j
  249.     End If
  250.  
  251. Sub CreateHisto (arrfinger() As String, arralpha() As LetterBin, w As Integer)
  252.     Dim As Integer j, k, n
  253.     For n = 1 To UBound(arralpha)
  254.         arralpha(n).Count = 0
  255.     Next
  256.     For j = 1 To w
  257.         For k = 1 To Len(arrfinger(j)) - (Len(arrfinger(j)) Mod w) Step w '- 0 Step 1 'w 'make the 0 a -w? might not matter at all
  258.             For n = 1 To UBound(arralpha)
  259.                 If (Mid$(arrfinger(j), k, w) = arralpha(n).Signature) Then
  260.                     arralpha(n).Count = arralpha(n).Count + 1
  261.                 End If
  262.             Next
  263.         Next
  264.     Next
  265.     Call QuickSort(arralpha(), 1, UBound(arralpha))
  266.  
  267. Sub PrintHisto (arr() As LetterBin, w As Integer)
  268.     Dim As Integer j, n
  269.     If (w > 0) Then
  270.         If (w > UBound(arr)) Then
  271.             j = UBound(arr)
  272.         Else
  273.             j = w
  274.         End If
  275.         Print "Histogram: "; _Trim$(Str$(UBound(arr))); "-letter regroup, showing top "; _Trim$(Str$(w))
  276.         For n = 1 To j
  277.             Print arr(n).Signature; arr(n).Count
  278.         Next
  279.     End If
  280.  
  281. Sub NewAlphabet (arrold() As LetterBin, arrnew() As LetterBin)
  282.     Dim As Integer j, k, n
  283.     n = 0
  284.     For k = 1 To 2
  285.         For j = 1 To UBound(arrold)
  286.             n = n + 1
  287.             arrnew(n).Signature = arrold(j).Signature
  288.         Next
  289.     Next
  290.     For j = 1 To UBound(arrnew)
  291.         If (j <= UBound(arrnew) / 2) Then
  292.             arrnew(j).Signature = "0" + arrnew(j).Signature
  293.         Else
  294.             arrnew(j).Signature = "1" + arrnew(j).Signature
  295.         End If
  296.     Next
  297.  
  298. Sub QuickSort (arr() As LetterBin, LowLimit As Long, HighLimit As Long)
  299.     Dim As Long piv
  300.     If (LowLimit < HighLimit) Then
  301.         piv = Partition(arr(), LowLimit, HighLimit)
  302.         Call QuickSort(arr(), LowLimit, piv - 1)
  303.         Call QuickSort(arr(), piv + 1, HighLimit)
  304.     End If
  305.  
  306. Function Partition (arr() As LetterBin, LowLimit As Long, HighLimit As Long)
  307.     Dim As Long i, j
  308.     Dim As Double pivot, tmp
  309.     pivot = arr(HighLimit).Count
  310.     i = LowLimit - 1
  311.     For j = LowLimit To HighLimit - 1
  312.         tmp = arr(j).Count - pivot
  313.         If (tmp >= 0) Then
  314.             i = i + 1
  315.             Swap arr(i), arr(j)
  316.         End If
  317.     Next
  318.     Swap arr(i + 1), arr(HighLimit)
  319.     Partition = i + 1
  320.  
You're not done when it works, you're done when it's right.

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
Re: Looking for old program or help recreating it
« Reply #59 on: December 15, 2021, 12:32:32 pm »
Hey r1, know what occurs to me? The progress indictor thing is already here, the answer was on screen the whole time and I wasn't noticing.

Just to get it out of the way, updated code:

Code: QB64: [Select]
  1.  
  2. Screen _NewImage(100, 30)
  3.  
  4. ' Version: 12
  5.  
  6. Type LetterBin
  7.     Signature As String
  8.     Count As Integer
  9.  
  10. Dim Shared Alphabet1(2) As LetterBin ' 0 1
  11. Dim Shared Alphabet2(4) As LetterBin ' 00 01 10 11
  12. Dim Shared Alphabet3(8) As LetterBin ' 000 001 010 011 100 101 110 111
  13. Dim Shared Alphabet4(16) As LetterBin ' etc.
  14. Dim Shared Alphabet5(32) As LetterBin
  15. Dim Shared Alphabet6(64) As LetterBin
  16. Dim Shared Alphabet7(128) As LetterBin
  17. Dim Shared Alphabet8(256) As LetterBin
  18. Dim Shared Alphabet9(512) As LetterBin
  19. Dim Shared Alphabet10(1024) As LetterBin
  20. Dim Shared Alphabet11(2048) As LetterBin
  21. Dim Shared Alphabet12(4096) As LetterBin
  22. Dim Shared Alphabet13(8192) As LetterBin
  23.  
  24. Alphabet1(1).Signature = "0"
  25. Alphabet1(2).Signature = "1"
  26. Call NewAlphabet(Alphabet1(), Alphabet2())
  27. Call NewAlphabet(Alphabet2(), Alphabet3())
  28. Call NewAlphabet(Alphabet3(), Alphabet4())
  29. Call NewAlphabet(Alphabet4(), Alphabet5())
  30. Call NewAlphabet(Alphabet5(), Alphabet6())
  31. Call NewAlphabet(Alphabet6(), Alphabet7())
  32. Call NewAlphabet(Alphabet7(), Alphabet8())
  33. Call NewAlphabet(Alphabet8(), Alphabet9())
  34. Call NewAlphabet(Alphabet9(), Alphabet10())
  35. Call NewAlphabet(Alphabet10(), Alphabet11())
  36. Call NewAlphabet(Alphabet11(), Alphabet12())
  37. Call NewAlphabet(Alphabet12(), Alphabet13())
  38.  
  39. '''
  40. Dim TheString As String
  41.  
  42. Dim predictedGuess As Integer
  43. Dim correctGuesses As Double
  44. Dim totalGuesses As Double
  45. Dim streakGuess As Integer
  46.  
  47. Dim ProgressGraph(1 To _Width) As Double
  48.  
  49. 'TheString = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  50. 'TheString = "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
  51. 'TheString = "01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
  52. 'TheString = "00000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100"
  53. TheString = "01010111000101101010101011010101011100010110101010101101010101110001011010101010110101010111000101101010101011010101011100010110101010101101"
  54. 'TheString = "00110000110001110001110010110011110101111000110001110011110010110001110011110100110101110101111000111001110001110100110100110010110011110011110011110111110111110110110001110000111001111000110111110001110101111001110111110010110101111000110100110100110001111000110001110110110111110110110101110001110000111001110100110110110001110111110111110001110001110010111000110110110101110111110100110110110011110110111000110111110101110000110010110101110001110010110001110011111001110011110001111001110110110100110001111000110011110001110111111000110001110001" ' Fibonacci
  55. 'TheString = "11010000100101101011010111010110101110101000001101001011100000111001010001100000101100110000010111000100100101110100001101111001011011001100110101111100010010111100010010111111010001111110010011110000110011110011010011010101100001101010011110101001110001100011001110111110011111111101100001100000011000000101101100111100011010001011010101001010000101010011000010011011010110110111011110000001110010100010000000101111101011101111000101010001011111100100101000011001011001101111101100010111010100111001"
  56. 'TheString = "110111001100010110010011101011100111010101100001100101011010101111110000111100010101110000010010110001" ' Wolfram 30
  57. 'TheString = "001100000000001111111111111110110000000010111000000000111111111011111111100000000000110000000011111111110100011111100000000110110000110100111111111001101110100000000101000001100101110011111101001111000000000000000010000111001110011111111110111110000000000000000001100110001000011001011110000000000000000000000000000000000110101111100000000000000001100000000000000001111101111000000000000010000000000000011110111111111111000000000001100111110000111101111111111111100000000111110111110001111011111111111101110000000011111111000000000000000111111111111000000111100000000000000000000111110011110001010111100000110000000000000011110111110001111011110000000000010000000111100111111111111110000000000000110000001111001111100011111111110000000000000000000111111010110011111111110000000011000110000111110001010001111101111000000000011110001110110011010000110001111110000000111000011111000001010000111001111100000000000000111110011111001000000100111110011000000111111111111111111000000001111111111111111111111111111111000011000000100001110111111111111111111110100000000000111000111101111011111111111111000000000001111100111110000000011111111110000000100000001111011110000001111111111111110011010001111111111111000011111111111111110101101111111111011111001001111111111111" ' Chia
  58. 'TheString = "1011001010010100100100110010101010101001010101010101011010010101001010101001010010100110101011010101010101011010101101010101010101010010110101010101100101010101010110101101011010010101010010100110101101001010110101011010010101101010110100101111010101010011011011010010110101010010110100101101010100101011010010101001010101010001011101011010010101011100111010010001101011110010011010001011100110101010010011010101001001010010000101010110001" ' loudar
  59. 'TheString = "11111011110100101011111111110100000011011110101100111100111111110111101110100111100110011111110101111111010111101111100111110111111111111011100111110111111110010000101011111001110101101010110111110" ' Spriggs 2
  60. 'TheString = "1010001101110110000000011100110100101010111110101001100101110100000111101011011000010101101100000110010010010101010110111111111001000100101011101000011110011000000100111100001100111000111100100000000111010011010011001111101000010011101111000011100011010110101101000111101111100101100100000101111011001101100000111011000001001111000110000001110101100101" ' Coalt legit
  61. 'TheString = "01001111011010000010110000100000010010010010000001110111011011110110111001100100011001010111001000100000011010000110111101110111001000000110100101110100001000000111011101101001011011000110110000100000011001000110111100100000011101110110100101110100011010000010000001110011011101000111010101100110011001100010000001101100011010010110101101100101001000000110001101101111011011100111011001100101011100100111010001101001011011100110011100100000011011100110111101110010011011010110000101101100001000000111010001100101011110000111010000100000011101000110111100100000011000100110100101101110011000010111001001111001" ' Zach binary thing
  62. 'TheString = "10111010101010101010101001010101010101001010101001010101010101010101010101010101010101010101010101010101001010100100100101010101010101001010100101010101010100101010100101010101010101010101001010010110010101010010101010101010101010101010100101001001001010101010101010101010101001010101001001101010010" ' Spriggs hand
  63. 'TheString = "01100101001010001100001101101111011010010101010110110101001000001111001111110101000101111011010101111101010101101010101001010101011000010101010101001011010100110100110100110011010101010101110101010111111101011010100000001101111000010111000110111001000010100001101010110100000111101011111100001011001010110010110" ' Luke 50
  64. 'TheString = "010101111010111100110000001001100100101100000101110001100101000010001001111101111111111100011110000011011110011000100011100100001101110011001001011001000011110010001000111100011100011110010110011110111010110100001000110000010000111000111011100110011010101111111100100010001111111100010100001011000011" 'Spriggs
  65. 'TheString = "10101010101011101000011101010111010101010101100111001010100111100001011011110101000001111010101101010000001111110011111110111101110111001110110010000100010101010101010100101011010110101010101010101001000000001111110000011110101010101010100010101110101010101101111111111111111111101010101010101000000" ' 63
  66. 'TheString = "11100101110011011010110100110011111011010110100100000110000100101001001010011100111101101110000001000000011011100101110000000111100100011101000000101000110100001000000001111010101011000010001110111110001001110101011000010101001111010100100000011100110110110000111010001010000011010000101111101011000" ' using RND function
  67. 'TheString = "00101010001100101010010101010100101010010100101010010101010100100000101011110101001010010101010010000011101010100101010101001010010101010101010110101001010100101010101001010100101010100101010100101010101001010010101010010101010101010100101010101010101010101001010101010100101010101001010101001101010" ' 78
  68. 'TheString = "11100101010011001001001010101001010000101001000010100010110111010101010011010100100100110101010010010110100101001001010010101010010010100101001010010100100101001001010010010110010010101010101001010101001010101010010101001001010101001010101010101010101010101010101010010101001010010100101001010101001" ' 68
  69. 'TheString = "10101011100101100101010101010101010101010101010101010101010010011010100000000011111111111001011001101010101010110010101010101010101010101010100101100101010101010110011101011110101010101010101101101010101111010101100101001011010010101010101011010101001110101010111101110011010011001101001101011000101" ' 68
  70. 'TheString = "10101101000110101000101010101010101010100101010101010100101110010101001001010100101010101001001010101001010000010010001010010010101010100110010101010101010101010110010101010010100101010010101010101001010101010101010010101010101010101010010101010101010101010101010010101001001010010100101010101010101" ' 76
  71.  
  72. For j = 1 To Len(TheString)
  73.  
  74.     Cls
  75.     Locate 1, 1
  76.     Print "Analyzing:"
  77.     Print
  78.     Print Left$(TheString, j) + "["; Right$(TheString, Len(TheString) - j); "]"
  79.     Print
  80.  
  81.     ' Main prediction call
  82.     predictedGuess = Analyze(Left$(TheString, j), 0)
  83.  
  84.     ' Reconciliation
  85.     Print "Prediction: "; _Trim$(Str$(predictedGuess))
  86.     Print "Actual:     "; _Trim$(Mid$(TheString, j + 1, 1))
  87.     Print
  88.     If (predictedGuess = Val(Mid$(TheString, j + 1, 1))) Then
  89.         correctGuesses = correctGuesses + 1
  90.         streakGuess = streakGuess + 1
  91.         Print "I was right."
  92.     Else
  93.         streakGuess = 0
  94.         Print "I was wrong."
  95.     End If
  96.     totalGuesses = totalGuesses + 1
  97.     Print "I'm on a "; _Trim$(Str$(streakGuess)); "-game winning streak."
  98.     Print "I have been correct on "; _Trim$(Str$(Int(100 * correctGuesses / totalGuesses))); "% of "; _Trim$(Str$(totalGuesses)); " guesses."
  99.  
  100.     ' Draw bottom graph
  101.     f = (_Width - 1) / Int(Len(TheString))
  102.     If (f > 1) Then f = 1 / f
  103.     ProgressGraph(1 + Int(j * f)) = correctGuesses / totalGuesses
  104.     For k = 1 To 1 + Int(j * (_Width - 1) / Int(Len(TheString)))
  105.         Locate 25 - Int(10 * ProgressGraph(1 + Int(k * f))), k: Print "*"
  106.     Next
  107.  
  108.     _Delay .015
  109.     _Display
  110.  
  111.  
  112. Function Analyze (TheStringIn As String, pswitch As Integer)
  113.     Dim TheReturn As Integer
  114.     Dim As Integer n
  115.     Dim As Double r, j, k, h
  116.     Dim Fingerprint(16) As String
  117.     Dim Partialguess(2 To 10, 2) As Double ' Change the upper bound to a higer number for more accuracy.
  118.  
  119.     ' Create shifted versions of string, i.e. ABCD -> BCDA, CDAB, DABC, ABCD, BCDA, etc.
  120.     Fingerprint(1) = TheStringIn
  121.     For n = 2 To UBound(Fingerprint)
  122.         Fingerprint(n) = Right$(Fingerprint(n - 1), Len(Fingerprint(n - 1)) - 1) + Left$(Fingerprint(n - 1), 1)
  123.     Next
  124.  
  125.     ' Initialize partial results.
  126.     For n = LBound(Partialguess) To UBound(Partialguess)
  127.         Partialguess(n, 1) = -999
  128.     Next
  129.  
  130.     Call CreateHisto(Fingerprint(), Alphabet2(), 2)
  131.     Call CreateHisto(Fingerprint(), Alphabet3(), 3)
  132.     Call CreateHisto(Fingerprint(), Alphabet4(), 4)
  133.     Call CreateHisto(Fingerprint(), Alphabet5(), 5)
  134.     Call CreateHisto(Fingerprint(), Alphabet6(), 6)
  135.     Call CreateHisto(Fingerprint(), Alphabet7(), 7)
  136.     Call CreateHisto(Fingerprint(), Alphabet8(), 8)
  137.     Call CreateHisto(Fingerprint(), Alphabet9(), 9)
  138.     Call CreateHisto(Fingerprint(), Alphabet10(), 10)
  139.     'Call CreateHisto(Fingerprint(), Alphabet11(), 11)
  140.     'Call CreateHisto(Fingerprint(), Alphabet12(), 12)
  141.     'Call CreateHisto(Fingerprint(), Alphabet13(), 13)
  142.  
  143.     If (pswitch = 1) Then
  144.         For n = 1 To _Width
  145.             Print "-";
  146.         Next
  147.         Print
  148.     End If
  149.  
  150.     If (pswitch = 1) Then
  151.         If (Len(TheStringIn) >= 2) Then Call PrintHisto(Alphabet2(), 3) ' Set the last number >=1 to print stats for that histogram.
  152.         If (Len(TheStringIn) >= 3) Then Call PrintHisto(Alphabet3(), 3)
  153.         If (Len(TheStringIn) >= 4) Then Call PrintHisto(Alphabet4(), 0)
  154.         If (Len(TheStringIn) >= 5) Then Call PrintHisto(Alphabet5(), 0)
  155.         If (Len(TheStringIn) >= 6) Then Call PrintHisto(Alphabet6(), 0)
  156.         If (Len(TheStringIn) >= 7) Then Call PrintHisto(Alphabet7(), 0)
  157.         If (Len(TheStringIn) >= 8) Then Call PrintHisto(Alphabet8(), 0)
  158.         If (Len(TheStringIn) >= 9) Then Call PrintHisto(Alphabet9(), 0)
  159.         If (Len(TheStringIn) >= 10) Then Call PrintHisto(Alphabet10(), 0)
  160.         'If (Len(TheStringIn) >= 11) Then Call PrintHisto(Alphabet11(), 0)
  161.         'If (Len(TheStringIn) >= 12) Then Call PrintHisto(Alphabet12(), 0)
  162.         'If (Len(TheStringIn) >= 13) Then Call PrintHisto(Alphabet13(), 0)
  163.         Print
  164.     End If
  165.  
  166.     If (Len(TheStringIn) >= 2) Then Call MakeGuess(TheStringIn, Alphabet2(), 2, Partialguess(), pswitch) ' Set the last number =1 to print guess for that histogram.
  167.     If (Len(TheStringIn) >= 3) Then Call MakeGuess(TheStringIn, Alphabet3(), 3, Partialguess(), pswitch)
  168.     If (Len(TheStringIn) >= 4) Then Call MakeGuess(TheStringIn, Alphabet4(), 4, Partialguess(), 0)
  169.     If (Len(TheStringIn) >= 5) Then Call MakeGuess(TheStringIn, Alphabet5(), 5, Partialguess(), 0)
  170.     If (Len(TheStringIn) >= 6) Then Call MakeGuess(TheStringIn, Alphabet6(), 6, Partialguess(), 0)
  171.     If (Len(TheStringIn) >= 7) Then Call MakeGuess(TheStringIn, Alphabet7(), 7, Partialguess(), 0)
  172.     If (Len(TheStringIn) >= 8) Then Call MakeGuess(TheStringIn, Alphabet8(), 8, Partialguess(), 0)
  173.     If (Len(TheStringIn) >= 9) Then Call MakeGuess(TheStringIn, Alphabet9(), 9, Partialguess(), 0)
  174.     If (Len(TheStringIn) >= 10) Then Call MakeGuess(TheStringIn, Alphabet10(), 10, Partialguess(), 0)
  175.     'If (Len(TheStringIn) >= 11) Then Call MakeGuess(TheStringIn, Alphabet11(), 11, Partialguess(), 0)
  176.     'If (Len(TheStringIn) >= 12) Then Call MakeGuess(TheStringIn, Alphabet12(), 12, Partialguess(), 0)
  177.     'If (Len(TheStringIn) >= 13) Then Call MakeGuess(TheStringIn, Alphabet13(), 13, Partialguess(), 0)
  178.     If (pswitch = 1) Then Print
  179.  
  180.     If (pswitch = 1) Then
  181.         Print "Analyzing:"
  182.         Print TheStringIn
  183.  
  184.         Print
  185.         Print "Thinking:";
  186.         For k = LBound(Partialguess) To UBound(Partialguess)
  187.             If (Partialguess(k, 1) <> -999) Then
  188.                 Print Partialguess(k, 1);
  189.             Else
  190.                 Print "_ ";
  191.             End If
  192.         Next
  193.         Print
  194.     End If
  195.  
  196.     j = 0
  197.     r = 0
  198.  
  199.     For k = UBound(Partialguess) To LBound(Partialguess) Step -1
  200.         If (Partialguess(k, 1) <> -999) Then
  201.  
  202.             ' This is the made-up part of the model:
  203.             ' The variable r contributes to weighted average.
  204.             ' The variable j is used for normalization.
  205.             ' Scaling factor h influences weighted average calculaton.
  206.             ' The factors multiplying h are totally arbitrary. Notes:
  207.             '   setting o(h^2) means the later alphabets count for more.
  208.             '   Partialguess(k, 1) euqals the calculated guess at frequency k.
  209.             '   Partialguess(k, 2) euqals the peak count of the unscaled histogram.
  210.             '   ...while Partialguess(k, 2) is here, it does not seem to help calculations.
  211.  
  212.             h = 1 + k - LBound(Partialguess)
  213.  
  214.             h = h ^ 2
  215.  
  216.             ' Standard weighted average:
  217.             r = r + h * Partialguess(k, 1)
  218.             j = j + h
  219.  
  220.         End If
  221.     Next
  222.     If (j <> 0) Then
  223.         r = r / j
  224.     End If
  225.  
  226.     If (pswitch = 1) Then Print "Predicting:  "; _Trim$(Str$(r))
  227.  
  228.     If (r > .5) Then
  229.         r = 1
  230.     Else
  231.         r = 0
  232.     End If
  233.  
  234.     If (pswitch = 1) Then
  235.         Print "Rounding to: "; _Trim$(Str$(r))
  236.     End If
  237.  
  238.     TheReturn = r
  239.     Analyze = TheReturn
  240.  
  241. Sub MakeGuess (TheStringIn As String, arralpha() As LetterBin, wid As Integer, arrbeta() As Double, pswitch As Integer)
  242.     Dim TheReturn As Double
  243.     Dim As Integer j, k, n
  244.     TheReturn = 0
  245.     j = 1 '0
  246.     k = 0
  247.     For n = 1 To UBound(arralpha)
  248.         If (Left$(arralpha(n).Signature, wid - 1) = Right$(TheStringIn, wid - 1)) Then
  249.             If (arralpha(n).Count >= j) Then
  250.                 If (pswitch = 1) Then Print "Order-"; Right$("0" + _Trim$(Str$(wid)), 2); " guess: "; arralpha(n).Signature; " . "; _Trim$(Str$(arralpha(n).Count))
  251.                 TheReturn = TheReturn + Val(Right$(arralpha(n).Signature, 1))
  252.                 k = k + 1
  253.                 j = arralpha(n).Count
  254.             End If
  255.         End If
  256.     Next
  257.     If (k <> 0) Then
  258.         TheReturn = TheReturn / k
  259.         arrbeta(wid, 1) = TheReturn
  260.         arrbeta(wid, 2) = j
  261.     Else
  262.         TheReturn = .5
  263.         arrbeta(wid, 1) = TheReturn
  264.         arrbeta(wid, 2) = j
  265.     End If
  266.  
  267. Sub CreateHisto (arrfinger() As String, arralpha() As LetterBin, w As Integer)
  268.     Dim As Integer j, k, n
  269.     For n = 1 To UBound(arralpha)
  270.         arralpha(n).Count = 0
  271.     Next
  272.     For j = 1 To w
  273.         For k = 1 To Len(arrfinger(j)) - (Len(arrfinger(j)) Mod w) Step w '- 0 Step 1 'w 'make the 0 a -w? might not matter at all
  274.             For n = 1 To UBound(arralpha)
  275.                 If (Mid$(arrfinger(j), k, w) = arralpha(n).Signature) Then
  276.                     arralpha(n).Count = arralpha(n).Count + 1
  277.                 End If
  278.             Next
  279.         Next
  280.     Next
  281.     Call QuickSort(arralpha(), 1, UBound(arralpha))
  282.  
  283. Sub PrintHisto (arr() As LetterBin, w As Integer)
  284.     Dim As Integer j, n
  285.     If (w > 0) Then
  286.         If (w > UBound(arr)) Then
  287.             j = UBound(arr)
  288.         Else
  289.             j = w
  290.         End If
  291.         Print "Histogram: "; _Trim$(Str$(UBound(arr))); "-letter regroup, showing top "; _Trim$(Str$(w))
  292.         For n = 1 To j
  293.             Print arr(n).Signature; arr(n).Count
  294.         Next
  295.     End If
  296.  
  297. Sub NewAlphabet (arrold() As LetterBin, arrnew() As LetterBin)
  298.     Dim As Integer j, k, n
  299.     n = 0
  300.     For k = 1 To 2
  301.         For j = 1 To UBound(arrold)
  302.             n = n + 1
  303.             arrnew(n).Signature = arrold(j).Signature
  304.         Next
  305.     Next
  306.     For j = 1 To UBound(arrnew)
  307.         If (j <= UBound(arrnew) / 2) Then
  308.             arrnew(j).Signature = "0" + arrnew(j).Signature
  309.         Else
  310.             arrnew(j).Signature = "1" + arrnew(j).Signature
  311.         End If
  312.     Next
  313.  
  314. Sub QuickSort (arr() As LetterBin, LowLimit As Long, HighLimit As Long)
  315.     Dim As Long piv
  316.     If (LowLimit < HighLimit) Then
  317.         piv = Partition(arr(), LowLimit, HighLimit)
  318.         Call QuickSort(arr(), LowLimit, piv - 1)
  319.         Call QuickSort(arr(), piv + 1, HighLimit)
  320.     End If
  321.  
  322. Function Partition (arr() As LetterBin, LowLimit As Long, HighLimit As Long)
  323.     Dim As Long i, j
  324.     Dim As Double pivot, tmp
  325.     pivot = arr(HighLimit).Count
  326.     i = LowLimit - 1
  327.     For j = LowLimit To HighLimit - 1
  328.         tmp = arr(j).Count - pivot
  329.         If (tmp >= 0) Then
  330.             i = i + 1
  331.             Swap arr(i), arr(j)
  332.         End If
  333.     Next
  334.     Swap arr(i + 1), arr(HighLimit)
  335.     Partition = i + 1
  336.  

Alright, so the rest can be explained in the screenshot.

  [ You are not allowed to view this attachment ]  

The fake little "graph" made of asterisks is designed to trace across the screen exactly like a progress indicator. It moves along linearly, doesn't jump around, and has only one speed. (It won't do that microsoft thing where 99% takes a month to complete.) The lines of code that are responsible for this graph are highlighted, and you can basically ignore the y-value in it. Hope that helps!
You're not done when it works, you're done when it's right.