Author Topic: Binary Sequence Predictor "game"?  (Read 10616 times)

0 Members and 1 Guest are viewing this topic.

This topic contains a post which is marked as Best Answer. Press here if you would like to see it.

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Binary Sequence Predictor "game"?
« on: December 09, 2021, 09:57:14 pm »
SKIP RIGHT TO THE BEST ANSWER -> https://www.qb64.org/forum/index.php?topic=4473.msg139248#msg139248
(Ignore everything between here and there.)

Alright I feel like not highjacking r1's thread anymore, so I will show this work here instead. What I've got is a thing that lets you type any random sequence of 1's and 0's, and the program will EERILY predict the next number. You can give this probably any pre-cooked, esoteric sequence you can think of - I know I did - and the program gets the next digit right.

Now, for the cases when you don't know the next digit - such as when you're whimsically flipping a coin or whatever - of course a program cannot *predict* that. That was never the goal, stay away from that straw man. What this thing *does*, is it will tell you the next digit in the sequence according to patterns you had no clue you were inputting. When I test this thing, trying to be random, I can always see why the answer it gives is the most "expected" next result. It's kinda wild.

So in this program, you get a prompt. Press 1011101000101 blah blah your heart's content. Then the thing shows you a few stats that you don't really need to see. For the curious, these are "scores" that say how random you are at different "frequencies". Finally, after a few of those screens, you get the final summary and the computer's prediction. Try this on a few sequences where you know what the next digit *should* be. Watch it get those right, and then "try to be random"... And watch the program understand what you type better than you do! Test data is still included but that mode is commented out.

Code: QB64: [Select]
  1.  
  2. ' Version: 5 OLD AS HELL, DO NOT RUN
  3.  
  4. Type LetterBin
  5.     Signature As String
  6.     Count As Integer
  7.  
  8. Dim Shared TheInput(1000, 2) As String
  9.  
  10. Dim Shared FingerPrint(16) As String
  11.  
  12. Dim Shared Alphabet1(2) As LetterBin
  13. Alphabet1(1).Signature = "0"
  14. Alphabet1(2).Signature = "1"
  15.  
  16. Dim Shared Alphabet2(4) As LetterBin
  17. Dim Shared Alphabet3(8) As LetterBin
  18. Dim Shared Alphabet4(16) As LetterBin
  19. Dim Shared Alphabet5(32) As LetterBin
  20. Dim Shared Alphabet6(64) As LetterBin
  21. Dim Shared Alphabet7(128) As LetterBin
  22. Dim Shared Alphabet8(256) As LetterBin
  23. Dim Shared Alphabet9(512) As LetterBin
  24. Dim Shared Alphabet10(1024) As LetterBin
  25. Dim Shared Alphabet11(2048) As LetterBin
  26. Dim Shared Alphabet12(4096) As LetterBin
  27. Dim Shared Alphabet13(8192) As LetterBin
  28.  
  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. Call LoadInput
  43.  
  44.  
  45. m = 1
  46.  
  47.     Cls
  48.     Call Analyze(m)
  49.     Print
  50.     Print "Press ESC to try again."
  51.  
  52.     _KeyClear: Do: k = _KeyHit: _Limit 30: Loop Until k = 27: _KeyClear
  53.  
  54.     'Select Case k
  55.     '    Case 19712
  56.     '        m = m + 1
  57.     '    Case 19200
  58.     '        m = m - 1
  59.     '    Case Else
  60.     '        Cls: _Display
  61.     'End Select
  62.     '_KeyClear
  63.  
  64.  
  65.  
  66. Sub Analyze (TheIndex As Integer)
  67.     Dim actual As String
  68.     Dim k As Integer
  69.     Dim As Double p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13
  70.  
  71.     'FingerPrint(1) = TheInput(TheIndex, 1)
  72.     'actual = TheInput(TheIndex, 2)
  73.  
  74.     FingerPrint(1) = ""
  75.     actual = "?"
  76.     Do While (Len(FingerPrint(1)) < 32)
  77.         Print "Type random 1's and 0's and press Enter (at least 32, preferably way more):"
  78.         Print "  ................................"
  79.         _KeyClear
  80.         Input FingerPrint(1)
  81.         Print
  82.     Loop
  83.  
  84.     For k = 2 To UBound(FingerPrint)
  85.         FingerPrint(k) = Right$(FingerPrint(k - 1), Len(FingerPrint(k - 1)) - 1) + Left$(FingerPrint(k - 1), 1)
  86.     Next
  87.  
  88.     Call CreateHisto(Alphabet2(), 2)
  89.     Call CreateHisto(Alphabet3(), 3)
  90.     Call CreateHisto(Alphabet4(), 4)
  91.     Call CreateHisto(Alphabet5(), 5)
  92.     Call CreateHisto(Alphabet6(), 6)
  93.     Call CreateHisto(Alphabet7(), 7)
  94.     Call CreateHisto(Alphabet8(), 8)
  95.     Call CreateHisto(Alphabet9(), 9)
  96.     Call CreateHisto(Alphabet10(), 10)
  97.     Call CreateHisto(Alphabet11(), 11)
  98.     Call CreateHisto(Alphabet12(), 12)
  99.     Call CreateHisto(Alphabet13(), 13)
  100.  
  101.     Call PrintHisto(Alphabet2(), 0) ' Turn these numbers high to see stats for that alphabet.
  102.     Call PrintHisto(Alphabet3(), 10)
  103.     Call PrintHisto(Alphabet4(), 10)
  104.     Call PrintHisto(Alphabet5(), 10)
  105.     Call PrintHisto(Alphabet6(), 0)
  106.     Call PrintHisto(Alphabet7(), 0)
  107.     Call PrintHisto(Alphabet8(), 0)
  108.     Call PrintHisto(Alphabet9(), 5)
  109.     Call PrintHisto(Alphabet10(), 5)
  110.     Call PrintHisto(Alphabet11(), 5)
  111.     Call PrintHisto(Alphabet12(), 0)
  112.     Call PrintHisto(Alphabet13(), 0)
  113.  
  114.     p2 = MakeGuess(Alphabet2(), 2)
  115.     p3 = MakeGuess(Alphabet3(), 3)
  116.     p4 = MakeGuess(Alphabet4(), 4)
  117.     p5 = MakeGuess(Alphabet5(), 5)
  118.     p6 = MakeGuess(Alphabet6(), 6)
  119.     p7 = MakeGuess(Alphabet7(), 7)
  120.     p8 = MakeGuess(Alphabet8(), 8)
  121.     p9 = MakeGuess(Alphabet9(), 9)
  122.     p10 = MakeGuess(Alphabet10(), 10)
  123.     p11 = MakeGuess(Alphabet11(), 11)
  124.     p12 = MakeGuess(Alphabet12(), 12)
  125.     p13 = MakeGuess(Alphabet13(), 13)
  126.  
  127.     Cls
  128.     'Print "String ID:"; TheIndex
  129.     Print "Conclusions:"
  130.     Print
  131.     Print FingerPrint(1)
  132.     Print
  133.     Print "Thinking:  "; p2; p3; p4; p5; p6; p7; p8; p9; p10; p11; p12; p13
  134.     Print
  135.     Print "Predicted next number:"; (1 / 4) * (p10 + p11 + p12 + p13)
  136.     Print
  137.     'Print "Actual next number:    "; actual
  138.  
  139. Function MakeGuess (arr() As LetterBin, w As Integer)
  140.     Dim TheReturn As Double
  141.     Dim As Integer k
  142.     For k = 1 To UBound(arr)
  143.         If (Left$(arr(k).Signature, w - 1) = Right$(FingerPrint(1), w - 1)) Then
  144.             Print "..."; arr(k).Signature; arr(k).Count
  145.             TheReturn = Val(Right$(arr(k).Signature, 1))
  146.             If (arr(k).Count = 0) Then TheReturn = .5
  147.             Exit For
  148.         End If
  149.     Next
  150.     MakeGuess = TheReturn
  151.  
  152. Sub CreateHisto (arr() As LetterBin, w As Integer)
  153.     Dim As Integer m, n, k
  154.     For k = 1 To UBound(arr)
  155.         arr(k).Count = 0
  156.     Next
  157.     For m = 1 To w
  158.         For n = 1 To Len(FingerPrint(m)) - w Step w 'added the -w
  159.             For k = 1 To UBound(arr)
  160.                 If (Mid$(FingerPrint(m), n, w) = arr(k).Signature) Then
  161.                     arr(k).Count = arr(k).Count + 1
  162.                 End If
  163.             Next
  164.         Next
  165.     Next
  166.     Call BubbleSort(arr())
  167.  
  168. Sub NewAlphabet (arrold() As LetterBin, arrnew() As LetterBin)
  169.     Dim As Integer n, j, k
  170.     n = 0
  171.     For j = 1 To 2
  172.         For k = 1 To UBound(arrold)
  173.             n = n + 1
  174.             arrnew(n).Signature = arrold(k).Signature
  175.         Next
  176.     Next
  177.     For k = 1 To UBound(arrnew)
  178.         If (k <= UBound(arrnew) / 2) Then
  179.             arrnew(k).Signature = "0" + arrnew(k).Signature
  180.         Else
  181.             arrnew(k).Signature = "1" + arrnew(k).Signature
  182.         End If
  183.     Next
  184.  
  185. Sub PrintHisto (arr() As LetterBin, w As Integer)
  186.     Dim As Integer n, k
  187.     If (w > 0) Then
  188.         Cls
  189.         Print "Unscaled randomness scores (top "; _Trim$(Str$(w)); "), Alphabet size:"; UBound(arr)
  190.         If w > UBound(arr) Then k = UBound(arr) Else k = w
  191.         For n = 1 To k
  192.             Print arr(n).Signature; arr(n).Count
  193.         Next
  194.         Print
  195.         Print "Press any key..."
  196.         Sleep
  197.         _KeyClear
  198.         '_KeyClear: Do: k = _KeyHit: Loop Until k
  199.     End If
  200.  
  201. Sub BubbleSort (arr() As LetterBin)
  202.     Dim As Integer i, j
  203.     Dim As Integer u, v
  204.     For j = UBound(arr) To 1 Step -1
  205.         For i = 2 To UBound(arr)
  206.             u = arr(i - 1).Count
  207.             v = arr(i).Count
  208.             If (u < v) Then
  209.                 Swap arr(i - 1), arr(i)
  210.             End If
  211.         Next
  212.     Next
  213.  
  214. Sub LoadInput
  215.     Dim n As Integer
  216.     '''
  217.     n = 0
  218.     '''
  219.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "0"
  220.     n = n + 1: TheInput(n, 1) = "01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101": TheInput(n, 2) = "0"
  221.     n = n + 1: TheInput(n, 1) = "10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010": TheInput(n, 2) = "1"
  222.     n = n + 1: TheInput(n, 1) = "00100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100": TheInput(n, 2) = "1"
  223.     n = n + 1: TheInput(n, 1) = "01001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001": TheInput(n, 2) = "0"
  224.     n = n + 1: TheInput(n, 1) = "10010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010": TheInput(n, 2) = "0"
  225.     n = n + 1: TheInput(n, 1) = "00010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001": TheInput(n, 2) = "0"
  226.     n = n + 1: TheInput(n, 1) = "00100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010": TheInput(n, 2) = "0"
  227.     n = n + 1: TheInput(n, 1) = "01000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100": TheInput(n, 2) = "0"
  228.     n = n + 1: TheInput(n, 1) = "10001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000": TheInput(n, 2) = "1"
  229.     n = n + 1: TheInput(n, 1) = "00001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000": TheInput(n, 2) = "0"
  230.     n = n + 1: TheInput(n, 1) = "00010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000": TheInput(n, 2) = "1"
  231.     n = n + 1: TheInput(n, 1) = "00100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001": TheInput(n, 2) = "0"
  232.     n = n + 1: TheInput(n, 1) = "01000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010": TheInput(n, 2) = "0"
  233.     n = n + 1: TheInput(n, 1) = "10000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100": TheInput(n, 2) = "0"
  234.     n = n + 1: TheInput(n, 1) = "00000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100": TheInput(n, 2) = "0"
  235.     n = n + 1: TheInput(n, 1) = "00001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000": TheInput(n, 2) = "0"
  236.     n = n + 1: TheInput(n, 1) = "00010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000": TheInput(n, 2) = "0"
  237.     n = n + 1: TheInput(n, 1) = "00100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000": TheInput(n, 2) = "1"
  238.     n = n + 1: TheInput(n, 1) = "01000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001": TheInput(n, 2) = "0"
  239.     n = n + 1: TheInput(n, 1) = "10000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010": TheInput(n, 2) = "0"
  240.     n = n + 1: TheInput(n, 1) = "00000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100": TheInput(n, 2) = "0"
  241.     n = n + 1: TheInput(n, 1) = "00100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000": TheInput(n, 2) = "1"
  242.     n = n + 1: TheInput(n, 1) = "00000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001": TheInput(n, 2) = "0"
  243.     n = n + 1: TheInput(n, 1) = "10000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000": TheInput(n, 2) = "1"
  244.     n = n + 1: TheInput(n, 1) = "00110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011": TheInput(n, 2) = "0"
  245.     n = n + 1: TheInput(n, 1) = "01100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110": TheInput(n, 2) = "0"
  246.     n = n + 1: TheInput(n, 1) = "11001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100": TheInput(n, 2) = "1"
  247.     n = n + 1: TheInput(n, 1) = "10011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001": TheInput(n, 2) = "1"
  248.     n = n + 1: TheInput(n, 1) = "00011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100": TheInput(n, 2) = "0"
  249.     n = n + 1: TheInput(n, 1) = "00111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000": TheInput(n, 2) = "1"
  250.     n = n + 1: TheInput(n, 1) = "01110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001": TheInput(n, 2) = "1"
  251.     n = n + 1: TheInput(n, 1) = "11100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011": TheInput(n, 2) = "1"
  252.     n = n + 1: TheInput(n, 1) = "11000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111": TheInput(n, 2) = "0"
  253.     n = n + 1: TheInput(n, 1) = "10001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110": TheInput(n, 2) = "0"
  254.     n = n + 1: TheInput(n, 1) = "01001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100": TheInput(n, 2) = "0"
  255.     n = n + 1: TheInput(n, 1) = "10011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000": TheInput(n, 2) = "1"
  256.     n = n + 1: TheInput(n, 1) = "00110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001": TheInput(n, 2) = "1"
  257.     n = n + 1: TheInput(n, 1) = "01100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011": TheInput(n, 2) = "1"
  258.     n = n + 1: TheInput(n, 1) = "11000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111": TheInput(n, 2) = "0"
  259.     n = n + 1: TheInput(n, 1) = "10001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110": TheInput(n, 2) = "1"
  260.     n = n + 1: TheInput(n, 1) = "00011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101": TheInput(n, 2) = "0"
  261.     n = n + 1: TheInput(n, 1) = "01001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001": TheInput(n, 2) = "0"
  262.     n = n + 1: TheInput(n, 1) = "10010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010": TheInput(n, 2) = "1"
  263.     n = n + 1: TheInput(n, 1) = "00101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101": TheInput(n, 2) = "0"
  264.     n = n + 1: TheInput(n, 1) = "01010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010": TheInput(n, 2) = "1"
  265.     n = n + 1: TheInput(n, 1) = "10101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101": TheInput(n, 2) = "0"
  266.     n = n + 1: TheInput(n, 1) = "01010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010": TheInput(n, 2) = "1"
  267.     n = n + 1: TheInput(n, 1) = "10101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101": TheInput(n, 2) = "0"
  268.     n = n + 1: TheInput(n, 1) = "01010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010": TheInput(n, 2) = "0"
  269.     n = n + 1: TheInput(n, 1) = "10101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100": TheInput(n, 2) = "0"
  270.     n = n + 1: TheInput(n, 1) = "01010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000": TheInput(n, 2) = "1"
  271.     n = n + 1: TheInput(n, 1) = "10100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001": TheInput(n, 2) = "1"
  272.     n = n + 1: TheInput(n, 1) = "10100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001": TheInput(n, 2) = "?"
  273.     n = n + 1: TheInput(n, 1) = "0001000001011100000011000100011000010010000000000000000011000000000000000001110010000000000001111000000001001110000000000000100000000011110000000000000000000000000000010100000000000000000100000000000000110001111000010001000000000000000000011010000000000000000010001101100000100001000000110011000011010010000000000000000000100001000011000110001010000000100000000000000000000000000000000000010000000000100000000000000010100000100000000000000000000000000000000000100001000000000000000010110100000000000010010000000000000000000100000000001100000011000000000000000000000000000000110010000110000100000": TheInput(n, 2) = "?"
  274.     '''
  275.     'n = 0
  276.     '''
  277.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  278.     n = n + 1: TheInput(n, 1) = "00000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  279.     n = n + 1: TheInput(n, 1) = "00000100000101110000001100010001100001001000000000000000001100000000000000000111001000000000000111100000000100111000000000000010000000001111000000000000000000000000000001010000000000000000010000000000000011000111100001000100000000000000000001101000000000000000001000110110000010000100000011001100001101001000000000000000000010000100001100011000101000000010000000000000000000000000000000000001000000000010000000000000001010000010000000000000000000000000000000000010000100000000000000001011010000000000": TheInput(n, 2) = "?"
  280.     n = n + 1: TheInput(n, 1) = "00011101100000000001011100001011101000100111101100011000000011001010101000101000111111011000111000100000000000000110110000000001001001110110100001011011101100000011001010001111111110101100001101100001100011000111101100110000000101101101110000001110110111000011000110000000001101111000110000000011111100110001111000011101111101010011111111101111010011011001111101100010001100101101001011000010100111111101111010111111010110001100011000000100010001100111111001101101111000000010110111110000001011010011": TheInput(n, 2) = "?"
  281.     n = n + 1: TheInput(n, 1) = "00000000100000000000110000000000000000010000000000000000010000000000000000001000000000000000000000000000000001000000010000000000000000000000000000000000000000000000000000011000000000000000001000000001000000000000000000000000000000000000000001001011001000000000000110000000000000000000000000000000000100010000000000000000000000000000000000001100000000000000000000000000000000100000000000000000001000000000000000000000000000000000000000000000100000000000000000100000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  282.     n = n + 1: TheInput(n, 1) = "01111011010110000100001000011001101101000011000011000000000100110010001010000100010000001110111000001000000000101110101100000000100011100101101110000010110101111001011010100000111011100110100001100100111010111110000010000110010000000100111100110000000101010100111001000000101000100101111001001001000010000100110011011010011011101000110011000000101000000100010000101101000101000110000100010101010111100000000001100000110010000001000011100001001000100000011100000101000001010101000100011010000100010011": TheInput(n, 2) = "?"
  283.     n = n + 1: TheInput(n, 1) = "11000110011000111000001101000010001000001110001001110010000110000111010001010001100010101100001111100000111100101100000011000111101101110010101101010000101010000001111100000111110101010000000011011100100110101100111101000000100100101000011010000000010110101010011001110011111000010001100110001111111001100010011100010101001100000101010101100000000001001010000011011100010011001000001001110111100110010010000010000111111101100011010101010101000111010110101000000010001001001011011011100101111110110010": TheInput(n, 2) = "?"
  284.     n = n + 1: TheInput(n, 1) = "10101101010001010110010110011111011111111101110100010011101110000000100011010000100111111001110110100011011110011101110001110011110000111011011110111011101100000010100111100010000010100111110010100100010001010101111000111010011101010111001110110000101101110001110010011101010110101110001111000101011001001101001011111101110010110101001100110010111101010111010010000010110100010001101110110101101110000101101010001001101101011000111110100000011101110010101111011110111110100110101001111101110001010110": TheInput(n, 2) = "?"
  285.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  286.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000001000000000000000000000000000100000000000000000000000000000000000000000000000100000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000": TheInput(n, 2) = "?"
  287.     n = n + 1: TheInput(n, 1) = "00000110110101110000001100100101000001001111101111100000011000000000001001000100011000000000100011100000100000001001000001000010000000010111001101000001100000010101100011010011111000100111010000000000001010001011101110010100000000000010001011101000010000100000101100110100000011111000000001110000010101010000111111110000000110000100111110011000100000010001010100000000000110000000011000100000000111110011110010000100001010000010011100000000010001101010000000000110010000000110000000110011000000000000": TheInput(n, 2) = "?"
  288.     n = n + 1: TheInput(n, 1) = "11011001010011000110101011011010000110001001010001001111100111001011110110111010001111010110010100100101011010110010010100111010111001101011100100001010011111111010011100101101000011011011000111011011010110111100110011100010100001101010110101110101110111010111010010011001110100011010011010101111101110100100100111101101001011100001001100100111010101100100101000111111111001001111100111010110111100001000000111101000111000001101011001001110001000010100110011111001001010101001110111010101111001100001": TheInput(n, 2) = "?"
  289.     n = n + 1: TheInput(n, 1) = "00000000000000000000010000000001100000000000000000000001010000000000110010000000000000000000000000000000000000000000000000001100000000000111000101000000000000000000000000000100010001000000000000000000000000000000001100010010000000000000000001100000000000000000000000000001000000000000000000000000000000000010000011000000000000010000000000000001000000001000000000000000000000000000000000000100100000000000100000000000000000000000000000000000100000000000000000000000000000000000000000100000000000000000": TheInput(n, 2) = "?"
  290.     n = n + 1: TheInput(n, 1) = "11101000011011010000101000100000010001001000000110011110001011010001001101101010001100111000000101001000011000001010010100010011100110101000101000000000010100111001010100010010101010100011000011000001011010000000010000000001011110110111000010000001011011100000000111001110100000110000000011000101100000001001000100110011000100100000100001001000000011010010100000000100100000101001100000110001001001110101010001000000011000000010101000110010000100001011000001101000101010011011001110010110000010000000": TheInput(n, 2) = "?"
  291.     n = n + 1: TheInput(n, 1) = "00000010100110101001001000100000010100100100101101010010000001001100000000001011001110011011000010000111111001100010110011000010100110110000000000011010011010010100100011011011001100110001101001110000101001001100100010001101001000001011111100011011100000011001001010111000000000111101111001111001111111101000000000101100011001001011011010010000100001100010011110010000001011000001010111010010011111001001001110111100110010000110100111101000000101110100101010001111001111101100010101001001010101000101": TheInput(n, 2) = "?"
  292.     n = n + 1: TheInput(n, 1) = "00111100000000000111001001100000111010010010010011100010001100001100000011011000100010000101110010110100110110011100010001111110011011000110010000001001101111111000011000010001101110011101111010100110100110000111011101001111110011011111100110111000001101101110001001001000011110100110000111110111010000001100100100100111110110100001001011100110111000100011110100100100110010011110011011100011101111010010000110000011101100000111001011000110000010001101111011111011001100000010000101000000000000101110": TheInput(n, 2) = "?"
  293.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  294.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000100000000000000000000000010000000000000001000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000": TheInput(n, 2) = "?"
  295.     n = n + 1: TheInput(n, 1) = "00000000010111101100110000001011000001001011001100000001001100001001000001001100010000111111000011100001000000001111010010000100001000000010001101001011101011011010000101010011110110110001100001000010000010100011000000110001000000011101110001000000000000110000100000101100000001011010000101000000100100011000111111110010110101010100011110100110110000010001101000000000101001000010100110000100010100111000010010100100001000110000000100010100010000000010000100011100010010110100010000010010001001000010": TheInput(n, 2) = "?"
  296.     n = n + 1: TheInput(n, 1) = "11111111011001010010001100000100110110101110100011010010111011110100101000100000000101100000000100110010111110111000110101101010111111011101101010011111100100110100010011011001100000001110111110000101000000001100110101011110011111101100001110011101111100111100011100010010110111100001010000010001101001001111000000000101001000100100000110011000101011100100000100111011010110100000010001011010101011010010100111011000100011001000001010001011101010000100001011001011100001001011101110100110110010111100": TheInput(n, 2) = "?"
  297.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000010000000000000000000000000000000100000000100000000000000000000011100000000000000000000000000001000000000000000000000000000011001000000000000100000000000000000000000000010010000000000000000000000000000000000000000000000000000000000000000000000000000010001000000000000000000000000000000000000010000000000000000000000010000000000000000000000000000000000000000000000001001000000000011100000000000000001000000000000000000100000000100010000110100000000000000000000000000000000000": TheInput(n, 2) = "?"
  298.     n = n + 1: TheInput(n, 1) = "01011000100010001000011010000010010010000100100101000100011001000010000010110110010110001100010001000010110110000011010100000100100010010011111101111100110010101100000001000000100111010000010000100000000111100110000101110001100100000001000001001100100100010000001001000110000000000100011100110110000101100011100010110100000011001001011000010001001000101010010010000001000000100101100101001110110010010000100010100010000000100111001100000000001000111111010100001000001010000010101010110101101000001100": TheInput(n, 2) = "?"
  299.     n = n + 1: TheInput(n, 1) = "00000101000010010110000110001101111110010001110010000010101001111111010000011011100000110000010101101110101111110101001100000100000000100110001000000000000001110011101011011110000001000110101001000000000000010100010010110110000010001100100010011001010011111011001110110000110100010010000010010110011000010110110010101000111000000100000001101100100110010100110111001110110101010001101100000000110010100010000001000101011100000000000111101110101011001011001100100000001101110000001001101010000000111011": TheInput(n, 2) = "?"
  300.     n = n + 1: TheInput(n, 1) = "10100010000111100111110001101101100001100111001010011110011001101110100111000111001010100111100010110010101010100100100000101010111100100000010111001000101110010010111000001100011011001011010100101101101110001001111100110000001011100000010110011010001000001101101111001000011101001000110010110111100011111011001100011110100110100111001110000101010001010001101001101001011001111010011001101010000001111010110011100001010100011100110100011011110011100101000001110010010111100111110011001110011111001010": TheInput(n, 2) = "?"
  301.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  302.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000100000000000001100000000000000000000000000000000000000000010000000000000000000000000000000001000000000000000000000000000000000001000000000000100000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  303.     n = n + 1: TheInput(n, 1) = "00100000011101101100000000000000000000001010001010001010010000000011101000010100001000000110000110100000000010001000111100100100001010110000011000001010110100110011000010001000110101001001100001011000001000000000000010110000100000110000001001000000100000110100100100100001010011000000010101010010100101000000001011100010000000001100000110100010100010000001110000000100000001110010100100001110000001100110000100001000001000000000010000001000001000000001001100000000010011110100000000001010100001111111": TheInput(n, 2) = "?"
  304.     n = n + 1: TheInput(n, 1) = "01010110100011101001111011101011111111101001100000010100001001111110010111100011101100011111110001101101111000110011010011010011110000101111110110010001000001010100100100110011010010010110101011100000111111111101111110110011111101010011110000111101000010010011010000011100001000011011000011001101100011011101000101010101111011000100001111010100111001011100011100011011011000000010011010010100110010011001111011010010110011111000101110010111111100100100111110111010101001101011010100000001011010010000": TheInput(n, 2) = "?"
  305.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000000000000000000000000001000000000000000000000000000000000000000010000000000000010010100000000000001000000000001000100000000000000000000001000000000000000000000000000000010000000010000000000000000000000001000000010000000000000000000000000000000000000000010000000110000000000000000000000001000000000010000100000000000000000100000001000000010000000000000000000000010000000000000000001000000000000000": TheInput(n, 2) = "?"
  306.     n = n + 1: TheInput(n, 1) = "00000001100010111010101010001001000011001100000000000000010011000111001101001010110010010010010100101010000001001000111000000010110000010001001110100000000101101001110100010100000101000100000101000000010000110000010011010000100101001111000000011110001000001101101100000001000101000000011001011001110111100010010001000011110011110010010001000001110100100010101001110000010100000010010100000000101001000100101000011000000001001010111010110100000011001100101010000000100100100111111001110101000100000001": TheInput(n, 2) = "?"
  307.     n = n + 1: TheInput(n, 1) = "11010010010101000010000011010000101110111010011001101000101111011101001110000001011110100101101111000100000010110001010101000110100001100000111000111100011110110011101101101111101010100100011101000000010010101110000011011100010010101110101010000001110001001111110011011101000010110000101111000000101100011100101100001001100001111110000101110000010010000001001010000000011011000001000101000100000111101100110011000111010000001000010000000000100101010001100001011000001010001000111111110110101000011111": TheInput(n, 2) = "?"
  308.     n = n + 1: TheInput(n, 1) = "11011111000111100000010011111111101111001100100010111010010000011000110100111010011000111101000111010000110110101010011010101011100110011101000001011011111110011100110100001001010000001000010010100101111011000101001000000011110011110001100100100011011001010000101101111110101011011100000111000111000011110101111011101000101010000111011110000111111101011101110110001000011000111011011011111100110000001011011010110101101111011001011000111100101100111010011100110111101100110110100110000010011111110101": TheInput(n, 2) = "?"
  309.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  310.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  311.     n = n + 1: TheInput(n, 1) = "00100000000000000011000000000000000000000110000010011111100000000000000001000000001000000000000000010110000110000001100010000000000011110000000001100000000000110011000011000000010000001110000000011000001000010000110100000010000000111101000000000000000000100000000001100000100011000000000100000000000101000000000011010000001100010100000110110010100001010000110000001000000001100000110000001100000000011010000000000000101001100000000000000000100000011010100000000010010000100100010000000000000001111000": TheInput(n, 2) = "?"
  312.     n = n + 1: TheInput(n, 1) = "00010100011101010101100000101000001100111001101101000000011001111001100110110111010111111011110001100000000001100000011001111000111001000110011010001110100110011001110111100000101000110001100110100111000111001000001001110101101110000000110000000000011001010101000110011101011001100011001001011001101100011110000101101001100011001010011000001100110000101000001111110110000000001100001100010010101111100101001101010000000110011011111100011111010000000101000000100101100111010110001101111010101010000110": TheInput(n, 2) = "?"
  313.     n = n + 1: TheInput(n, 1) = "00000010000000000001100000000000000001000000000000000000000000000000000000000000000001001000000000000000000100000000000000000000010000000000000000100100000101000001000000100001100000000000000000000000000010110000000000000000100001000000000000001000000001100010000000010000010000000000000110000000001000000000001000010000000000010000000000000000000000000000000000000100001000000000000100001000000000000000000100000000000100000000000000000000000001001000000000000000000001000010000000000010000011000000": TheInput(n, 2) = "?"
  314.     n = n + 1: TheInput(n, 1) = "11010000111110000000000011000001011000010011010100100000000000110011011101010010100100000000000000010001101001000001001010011000100101101000111011000001000010010000010000010100001000100110100001100100001001001001100011110010011000110111000011000000011000000000100110001000101101100000001000000000000100000000000001001110001110100000010100001011101010110100001001001000000010010100001010100111011111000100001010000011010001000011001101110001101110000011010101101001010100110100010001011100110100110111": TheInput(n, 2) = "?"
  315.     n = n + 1: TheInput(n, 1) = "00000000110110001000000011001000100000001110011010100010101101111100101100101000001010000000101101010100101011010000010001001110001001100001110101011010111010000100001011001010010100011001011000010000100001000000000100001111001000101011111110100001110010011000100001101000101001101011110001011111000110111010010101000001001011101101110000001011110000011001100011111001010100010101110011000100110000101101010010110000000000010011001001101101000010000010001110000011111100111101100100110000001000110000": TheInput(n, 2) = "?"
  316.     n = n + 1: TheInput(n, 1) = "00101101111001100011001000011101001000000001100000101001000010110101000011001101110010110011000010101100111010101111100101100111000010110111010100000000001010000111111011001000111011100100011111101010010101011111111010010110010001101010100101010110111010111000101111001101001101101111010101010010110001000110110110101000010100001000010011101010011110001000001111001100110001011010100011101011100000100000111001000111001010101111010010010100110111001000100011010110100011111011101001101010111101101010": TheInput(n, 2) = "?"
  317.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  318.     n = n + 1: TheInput(n, 1) = "10000000100000000000000001001001000000100011010001010100000100000000010101100110101000000000000100000101010000000101000000000101100000000000010000001000001011000110100110100010010100010111000100000100001010000000101010001000111001000000010000100100000000000000100000001001000000110001010001001010010000000010101001000111011000100100100000010010000100100000000000001000010010000110010110000110100000000000101001010100000110010001110000111000000110000000000000000000000100101100001010000100000101100010": TheInput(n, 2) = "?"
  319.     n = n + 1: TheInput(n, 1) = "00001101011011101101111110010000011011010000101110101011001001111000101010010001010111100001110011011010100011011010101010111010001010100110101100000110110100101001011001010000001010100000111010111011100100110111010101010100000010000010101110001011010011001111011110110000110010001010001000110100101111101100000110111000000000000010001111101001011011010111110110000100101000111000101001110001010011110100010100100011110000001100001011000100100000011110111111100011000011000011100101111010111010010101": TheInput(n, 2) = "?"
  320.     n = n + 1: TheInput(n, 1) = "01110011000100111110101110110110101110011100101000000011111010011111101010001000000000111110011010111010001110111000111111010010011101111101100111110001000000011000001000001101101001001000010001011000010001111100010001100111000100111111100011010001101101110110000001010110001111000100101110010001101101010001010110110000100111011001010100101101110000001111001111110111100101101001001001111001011111111011000010101001001001101010001111000011011001111111001011111101111001010010110000100001010000011000": TheInput(n, 2) = "?"
  321.     '''
[/s]
« Last Edit: December 20, 2021, 11:15:40 am by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Binary Sequence Predictor "game"?
« Reply #1 on: December 09, 2021, 11:59:44 pm »
Well I would have been very impressed if it got this right:
Code: QB64: [Select]
  1.  
  2. ' Version: 5
  3.  
  4. Type LetterBin
  5.     Signature As String
  6.     Count As Integer
  7.  
  8. Dim Shared TheInput(1000, 2) As String
  9.  
  10. Dim Shared FingerPrint(16) As String
  11.  
  12. Dim Shared Alphabet1(2) As LetterBin
  13. Alphabet1(1).Signature = "0"
  14. Alphabet1(2).Signature = "1"
  15.  
  16. Dim Shared Alphabet2(4) As LetterBin
  17. Dim Shared Alphabet3(8) As LetterBin
  18. Dim Shared Alphabet4(16) As LetterBin
  19. Dim Shared Alphabet5(32) As LetterBin
  20. Dim Shared Alphabet6(64) As LetterBin
  21. Dim Shared Alphabet7(128) As LetterBin
  22. Dim Shared Alphabet8(256) As LetterBin
  23. Dim Shared Alphabet9(512) As LetterBin
  24. Dim Shared Alphabet10(1024) As LetterBin
  25. Dim Shared Alphabet11(2048) As LetterBin
  26. Dim Shared Alphabet12(4096) As LetterBin
  27. Dim Shared Alphabet13(8192) As LetterBin
  28.  
  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. Call LoadInput
  43.  
  44.  
  45. m = 1
  46.  
  47.     Cls
  48.     Call Analyze(m)
  49.     Print
  50.     Print "Press ESC to try again."
  51.  
  52.     _KeyClear: Do: k = _KeyHit: _Limit 30: Loop Until k = 27: _KeyClear
  53.  
  54.     'Select Case k
  55.     '    Case 19712
  56.     '        m = m + 1
  57.     '    Case 19200
  58.     '        m = m - 1
  59.     '    Case Else
  60.     '        Cls: _Display
  61.     'End Select
  62.     '_KeyClear
  63.  
  64.  
  65.  
  66. Sub Analyze (TheIndex As Integer)
  67.     Dim actual As String
  68.     Dim k As Integer
  69.     Dim As Double p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13
  70.  
  71.     'FingerPrint(1) = TheInput(TheIndex, 1)
  72.     'actual = TheInput(TheIndex, 2)
  73. ' ============================== bplus  mod
  74.     FingerPrint(1) = "1010110100011110110100000000101100100111101111001" 'next is 011011010101111111111010100111101110011111101110100
  75.     'actual = "?"
  76.     'Do While (Len(FingerPrint(1)) < 32)
  77.     '    Print "Type random 1's and 0's and press Enter (at least 32, preferably way more):"
  78.     '    Print "  ................................"
  79.     '    _KeyClear
  80.     '    Input FingerPrint(1)
  81.     '    Print
  82.     'Loop
  83. '==================== end of bplus mod
  84.  
  85.     For k = 2 To UBound(FingerPrint)
  86.         FingerPrint(k) = Right$(FingerPrint(k - 1), Len(FingerPrint(k - 1)) - 1) + Left$(FingerPrint(k - 1), 1)
  87.     Next
  88.  
  89.     Call CreateHisto(Alphabet2(), 2)
  90.     Call CreateHisto(Alphabet3(), 3)
  91.     Call CreateHisto(Alphabet4(), 4)
  92.     Call CreateHisto(Alphabet5(), 5)
  93.     Call CreateHisto(Alphabet6(), 6)
  94.     Call CreateHisto(Alphabet7(), 7)
  95.     Call CreateHisto(Alphabet8(), 8)
  96.     Call CreateHisto(Alphabet9(), 9)
  97.     Call CreateHisto(Alphabet10(), 10)
  98.     Call CreateHisto(Alphabet11(), 11)
  99.     Call CreateHisto(Alphabet12(), 12)
  100.     Call CreateHisto(Alphabet13(), 13)
  101.  
  102.     Call PrintHisto(Alphabet2(), 0) ' Turn these numbers high to see stats for that alphabet.
  103.     Call PrintHisto(Alphabet3(), 10)
  104.     Call PrintHisto(Alphabet4(), 10)
  105.     Call PrintHisto(Alphabet5(), 10)
  106.     Call PrintHisto(Alphabet6(), 0)
  107.     Call PrintHisto(Alphabet7(), 0)
  108.     Call PrintHisto(Alphabet8(), 0)
  109.     Call PrintHisto(Alphabet9(), 5)
  110.     Call PrintHisto(Alphabet10(), 5)
  111.     Call PrintHisto(Alphabet11(), 5)
  112.     Call PrintHisto(Alphabet12(), 0)
  113.     Call PrintHisto(Alphabet13(), 0)
  114.  
  115.     p2 = MakeGuess(Alphabet2(), 2)
  116.     p3 = MakeGuess(Alphabet3(), 3)
  117.     p4 = MakeGuess(Alphabet4(), 4)
  118.     p5 = MakeGuess(Alphabet5(), 5)
  119.     p6 = MakeGuess(Alphabet6(), 6)
  120.     p7 = MakeGuess(Alphabet7(), 7)
  121.     p8 = MakeGuess(Alphabet8(), 8)
  122.     p9 = MakeGuess(Alphabet9(), 9)
  123.     p10 = MakeGuess(Alphabet10(), 10)
  124.     p11 = MakeGuess(Alphabet11(), 11)
  125.     p12 = MakeGuess(Alphabet12(), 12)
  126.     p13 = MakeGuess(Alphabet13(), 13)
  127.  
  128.     Cls
  129.     'Print "String ID:"; TheIndex
  130.     Print "Conclusions:"
  131.     Print
  132.     Print FingerPrint(1)
  133.     Print
  134.     Print "Thinking:  "; p2; p3; p4; p5; p6; p7; p8; p9; p10; p11; p12; p13
  135.     Print
  136.     Print "Predicted next number:"; (1 / 4) * (p10 + p11 + p12 + p13)
  137.     Print
  138.     'Print "Actual next number:    "; actual
  139.  
  140. Function MakeGuess (arr() As LetterBin, w As Integer)
  141.     Dim TheReturn As Double
  142.     Dim As Integer k
  143.     For k = 1 To UBound(arr)
  144.         If (Left$(arr(k).Signature, w - 1) = Right$(FingerPrint(1), w - 1)) Then
  145.             Print "..."; arr(k).Signature; arr(k).Count
  146.             TheReturn = Val(Right$(arr(k).Signature, 1))
  147.             If (arr(k).Count = 0) Then TheReturn = .5
  148.             Exit For
  149.         End If
  150.     Next
  151.     MakeGuess = TheReturn
  152.  
  153. Sub CreateHisto (arr() As LetterBin, w As Integer)
  154.     Dim As Integer m, n, k
  155.     For k = 1 To UBound(arr)
  156.         arr(k).Count = 0
  157.     Next
  158.     For m = 1 To w
  159.         For n = 1 To Len(FingerPrint(m)) - w Step w 'added the -w
  160.             For k = 1 To UBound(arr)
  161.                 If (Mid$(FingerPrint(m), n, w) = arr(k).Signature) Then
  162.                     arr(k).Count = arr(k).Count + 1
  163.                 End If
  164.             Next
  165.         Next
  166.     Next
  167.     Call BubbleSort(arr())
  168.  
  169. Sub NewAlphabet (arrold() As LetterBin, arrnew() As LetterBin)
  170.     Dim As Integer n, j, k
  171.     n = 0
  172.     For j = 1 To 2
  173.         For k = 1 To UBound(arrold)
  174.             n = n + 1
  175.             arrnew(n).Signature = arrold(k).Signature
  176.         Next
  177.     Next
  178.     For k = 1 To UBound(arrnew)
  179.         If (k <= UBound(arrnew) / 2) Then
  180.             arrnew(k).Signature = "0" + arrnew(k).Signature
  181.         Else
  182.             arrnew(k).Signature = "1" + arrnew(k).Signature
  183.         End If
  184.     Next
  185.  
  186. Sub PrintHisto (arr() As LetterBin, w As Integer)
  187.     Dim As Integer n, k
  188.     If (w > 0) Then
  189.         Cls
  190.         Print "Unscaled randomness scores (top "; _Trim$(Str$(w)); "), Alphabet size:"; UBound(arr)
  191.         If w > UBound(arr) Then k = UBound(arr) Else k = w
  192.         For n = 1 To k
  193.             Print arr(n).Signature; arr(n).Count
  194.         Next
  195.         Print
  196.         Print "Press any key..."
  197.         Sleep
  198.         _KeyClear
  199.         '_KeyClear: Do: k = _KeyHit: Loop Until k
  200.     End If
  201.  
  202. Sub BubbleSort (arr() As LetterBin)
  203.     Dim As Integer i, j
  204.     Dim As Integer u, v
  205.     For j = UBound(arr) To 1 Step -1
  206.         For i = 2 To UBound(arr)
  207.             u = arr(i - 1).Count
  208.             v = arr(i).Count
  209.             If (u < v) Then
  210.                 Swap arr(i - 1), arr(i)
  211.             End If
  212.         Next
  213.     Next
  214.  
  215. Sub LoadInput
  216.     Dim n As Integer
  217.     '''
  218.     n = 0
  219.     '''
  220.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "0"
  221.     n = n + 1: TheInput(n, 1) = "01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101": TheInput(n, 2) = "0"
  222.     n = n + 1: TheInput(n, 1) = "10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010": TheInput(n, 2) = "1"
  223.     n = n + 1: TheInput(n, 1) = "00100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100": TheInput(n, 2) = "1"
  224.     n = n + 1: TheInput(n, 1) = "01001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001": TheInput(n, 2) = "0"
  225.     n = n + 1: TheInput(n, 1) = "10010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010": TheInput(n, 2) = "0"
  226.     n = n + 1: TheInput(n, 1) = "00010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001": TheInput(n, 2) = "0"
  227.     n = n + 1: TheInput(n, 1) = "00100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010": TheInput(n, 2) = "0"
  228.     n = n + 1: TheInput(n, 1) = "01000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100": TheInput(n, 2) = "0"
  229.     n = n + 1: TheInput(n, 1) = "10001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000": TheInput(n, 2) = "1"
  230.     n = n + 1: TheInput(n, 1) = "00001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000": TheInput(n, 2) = "0"
  231.     n = n + 1: TheInput(n, 1) = "00010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000": TheInput(n, 2) = "1"
  232.     n = n + 1: TheInput(n, 1) = "00100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001": TheInput(n, 2) = "0"
  233.     n = n + 1: TheInput(n, 1) = "01000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010": TheInput(n, 2) = "0"
  234.     n = n + 1: TheInput(n, 1) = "10000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100": TheInput(n, 2) = "0"
  235.     n = n + 1: TheInput(n, 1) = "00000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100": TheInput(n, 2) = "0"
  236.     n = n + 1: TheInput(n, 1) = "00001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000": TheInput(n, 2) = "0"
  237.     n = n + 1: TheInput(n, 1) = "00010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000": TheInput(n, 2) = "0"
  238.     n = n + 1: TheInput(n, 1) = "00100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000": TheInput(n, 2) = "1"
  239.     n = n + 1: TheInput(n, 1) = "01000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001": TheInput(n, 2) = "0"
  240.     n = n + 1: TheInput(n, 1) = "10000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010": TheInput(n, 2) = "0"
  241.     n = n + 1: TheInput(n, 1) = "00000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100": TheInput(n, 2) = "0"
  242.     n = n + 1: TheInput(n, 1) = "00100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000": TheInput(n, 2) = "1"
  243.     n = n + 1: TheInput(n, 1) = "00000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001": TheInput(n, 2) = "0"
  244.     n = n + 1: TheInput(n, 1) = "10000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000": TheInput(n, 2) = "1"
  245.     n = n + 1: TheInput(n, 1) = "00110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011": TheInput(n, 2) = "0"
  246.     n = n + 1: TheInput(n, 1) = "01100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110": TheInput(n, 2) = "0"
  247.     n = n + 1: TheInput(n, 1) = "11001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100": TheInput(n, 2) = "1"
  248.     n = n + 1: TheInput(n, 1) = "10011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001": TheInput(n, 2) = "1"
  249.     n = n + 1: TheInput(n, 1) = "00011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100": TheInput(n, 2) = "0"
  250.     n = n + 1: TheInput(n, 1) = "00111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000": TheInput(n, 2) = "1"
  251.     n = n + 1: TheInput(n, 1) = "01110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001": TheInput(n, 2) = "1"
  252.     n = n + 1: TheInput(n, 1) = "11100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011": TheInput(n, 2) = "1"
  253.     n = n + 1: TheInput(n, 1) = "11000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111": TheInput(n, 2) = "0"
  254.     n = n + 1: TheInput(n, 1) = "10001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110": TheInput(n, 2) = "0"
  255.     n = n + 1: TheInput(n, 1) = "01001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100": TheInput(n, 2) = "0"
  256.     n = n + 1: TheInput(n, 1) = "10011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000": TheInput(n, 2) = "1"
  257.     n = n + 1: TheInput(n, 1) = "00110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001": TheInput(n, 2) = "1"
  258.     n = n + 1: TheInput(n, 1) = "01100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011": TheInput(n, 2) = "1"
  259.     n = n + 1: TheInput(n, 1) = "11000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111": TheInput(n, 2) = "0"
  260.     n = n + 1: TheInput(n, 1) = "10001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110": TheInput(n, 2) = "1"
  261.     n = n + 1: TheInput(n, 1) = "00011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101": TheInput(n, 2) = "0"
  262.     n = n + 1: TheInput(n, 1) = "01001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001": TheInput(n, 2) = "0"
  263.     n = n + 1: TheInput(n, 1) = "10010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010": TheInput(n, 2) = "1"
  264.     n = n + 1: TheInput(n, 1) = "00101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101": TheInput(n, 2) = "0"
  265.     n = n + 1: TheInput(n, 1) = "01010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010": TheInput(n, 2) = "1"
  266.     n = n + 1: TheInput(n, 1) = "10101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101": TheInput(n, 2) = "0"
  267.     n = n + 1: TheInput(n, 1) = "01010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010": TheInput(n, 2) = "1"
  268.     n = n + 1: TheInput(n, 1) = "10101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101": TheInput(n, 2) = "0"
  269.     n = n + 1: TheInput(n, 1) = "01010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010": TheInput(n, 2) = "0"
  270.     n = n + 1: TheInput(n, 1) = "10101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100": TheInput(n, 2) = "0"
  271.     n = n + 1: TheInput(n, 1) = "01010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000": TheInput(n, 2) = "1"
  272.     n = n + 1: TheInput(n, 1) = "10100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001": TheInput(n, 2) = "1"
  273.     n = n + 1: TheInput(n, 1) = "10100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001": TheInput(n, 2) = "?"
  274.     n = n + 1: TheInput(n, 1) = "0001000001011100000011000100011000010010000000000000000011000000000000000001110010000000000001111000000001001110000000000000100000000011110000000000000000000000000000010100000000000000000100000000000000110001111000010001000000000000000000011010000000000000000010001101100000100001000000110011000011010010000000000000000000100001000011000110001010000000100000000000000000000000000000000000010000000000100000000000000010100000100000000000000000000000000000000000100001000000000000000010110100000000000010010000000000000000000100000000001100000011000000000000000000000000000000110010000110000100000": TheInput(n, 2) = "?"
  275.     '''
  276.     'n = 0
  277.     '''
  278.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  279.     n = n + 1: TheInput(n, 1) = "00000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  280.     n = n + 1: TheInput(n, 1) = "00000100000101110000001100010001100001001000000000000000001100000000000000000111001000000000000111100000000100111000000000000010000000001111000000000000000000000000000001010000000000000000010000000000000011000111100001000100000000000000000001101000000000000000001000110110000010000100000011001100001101001000000000000000000010000100001100011000101000000010000000000000000000000000000000000001000000000010000000000000001010000010000000000000000000000000000000000010000100000000000000001011010000000000": TheInput(n, 2) = "?"
  281.     n = n + 1: TheInput(n, 1) = "00011101100000000001011100001011101000100111101100011000000011001010101000101000111111011000111000100000000000000110110000000001001001110110100001011011101100000011001010001111111110101100001101100001100011000111101100110000000101101101110000001110110111000011000110000000001101111000110000000011111100110001111000011101111101010011111111101111010011011001111101100010001100101101001011000010100111111101111010111111010110001100011000000100010001100111111001101101111000000010110111110000001011010011": TheInput(n, 2) = "?"
  282.     n = n + 1: TheInput(n, 1) = "00000000100000000000110000000000000000010000000000000000010000000000000000001000000000000000000000000000000001000000010000000000000000000000000000000000000000000000000000011000000000000000001000000001000000000000000000000000000000000000000001001011001000000000000110000000000000000000000000000000000100010000000000000000000000000000000000001100000000000000000000000000000000100000000000000000001000000000000000000000000000000000000000000000100000000000000000100000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  283.     n = n + 1: TheInput(n, 1) = "01111011010110000100001000011001101101000011000011000000000100110010001010000100010000001110111000001000000000101110101100000000100011100101101110000010110101111001011010100000111011100110100001100100111010111110000010000110010000000100111100110000000101010100111001000000101000100101111001001001000010000100110011011010011011101000110011000000101000000100010000101101000101000110000100010101010111100000000001100000110010000001000011100001001000100000011100000101000001010101000100011010000100010011": TheInput(n, 2) = "?"
  284.     n = n + 1: TheInput(n, 1) = "11000110011000111000001101000010001000001110001001110010000110000111010001010001100010101100001111100000111100101100000011000111101101110010101101010000101010000001111100000111110101010000000011011100100110101100111101000000100100101000011010000000010110101010011001110011111000010001100110001111111001100010011100010101001100000101010101100000000001001010000011011100010011001000001001110111100110010010000010000111111101100011010101010101000111010110101000000010001001001011011011100101111110110010": TheInput(n, 2) = "?"
  285.     n = n + 1: TheInput(n, 1) = "10101101010001010110010110011111011111111101110100010011101110000000100011010000100111111001110110100011011110011101110001110011110000111011011110111011101100000010100111100010000010100111110010100100010001010101111000111010011101010111001110110000101101110001110010011101010110101110001111000101011001001101001011111101110010110101001100110010111101010111010010000010110100010001101110110101101110000101101010001001101101011000111110100000011101110010101111011110111110100110101001111101110001010110": TheInput(n, 2) = "?"
  286.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  287.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000001000000000000000000000000000100000000000000000000000000000000000000000000000100000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000": TheInput(n, 2) = "?"
  288.     n = n + 1: TheInput(n, 1) = "00000110110101110000001100100101000001001111101111100000011000000000001001000100011000000000100011100000100000001001000001000010000000010111001101000001100000010101100011010011111000100111010000000000001010001011101110010100000000000010001011101000010000100000101100110100000011111000000001110000010101010000111111110000000110000100111110011000100000010001010100000000000110000000011000100000000111110011110010000100001010000010011100000000010001101010000000000110010000000110000000110011000000000000": TheInput(n, 2) = "?"
  289.     n = n + 1: TheInput(n, 1) = "11011001010011000110101011011010000110001001010001001111100111001011110110111010001111010110010100100101011010110010010100111010111001101011100100001010011111111010011100101101000011011011000111011011010110111100110011100010100001101010110101110101110111010111010010011001110100011010011010101111101110100100100111101101001011100001001100100111010101100100101000111111111001001111100111010110111100001000000111101000111000001101011001001110001000010100110011111001001010101001110111010101111001100001": TheInput(n, 2) = "?"
  290.     n = n + 1: TheInput(n, 1) = "00000000000000000000010000000001100000000000000000000001010000000000110010000000000000000000000000000000000000000000000000001100000000000111000101000000000000000000000000000100010001000000000000000000000000000000001100010010000000000000000001100000000000000000000000000001000000000000000000000000000000000010000011000000000000010000000000000001000000001000000000000000000000000000000000000100100000000000100000000000000000000000000000000000100000000000000000000000000000000000000000100000000000000000": TheInput(n, 2) = "?"
  291.     n = n + 1: TheInput(n, 1) = "11101000011011010000101000100000010001001000000110011110001011010001001101101010001100111000000101001000011000001010010100010011100110101000101000000000010100111001010100010010101010100011000011000001011010000000010000000001011110110111000010000001011011100000000111001110100000110000000011000101100000001001000100110011000100100000100001001000000011010010100000000100100000101001100000110001001001110101010001000000011000000010101000110010000100001011000001101000101010011011001110010110000010000000": TheInput(n, 2) = "?"
  292.     n = n + 1: TheInput(n, 1) = "00000010100110101001001000100000010100100100101101010010000001001100000000001011001110011011000010000111111001100010110011000010100110110000000000011010011010010100100011011011001100110001101001110000101001001100100010001101001000001011111100011011100000011001001010111000000000111101111001111001111111101000000000101100011001001011011010010000100001100010011110010000001011000001010111010010011111001001001110111100110010000110100111101000000101110100101010001111001111101100010101001001010101000101": TheInput(n, 2) = "?"
  293.     n = n + 1: TheInput(n, 1) = "00111100000000000111001001100000111010010010010011100010001100001100000011011000100010000101110010110100110110011100010001111110011011000110010000001001101111111000011000010001101110011101111010100110100110000111011101001111110011011111100110111000001101101110001001001000011110100110000111110111010000001100100100100111110110100001001011100110111000100011110100100100110010011110011011100011101111010010000110000011101100000111001011000110000010001101111011111011001100000010000101000000000000101110": TheInput(n, 2) = "?"
  294.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  295.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000100000000000000000000000010000000000000001000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000": TheInput(n, 2) = "?"
  296.     n = n + 1: TheInput(n, 1) = "00000000010111101100110000001011000001001011001100000001001100001001000001001100010000111111000011100001000000001111010010000100001000000010001101001011101011011010000101010011110110110001100001000010000010100011000000110001000000011101110001000000000000110000100000101100000001011010000101000000100100011000111111110010110101010100011110100110110000010001101000000000101001000010100110000100010100111000010010100100001000110000000100010100010000000010000100011100010010110100010000010010001001000010": TheInput(n, 2) = "?"
  297.     n = n + 1: TheInput(n, 1) = "11111111011001010010001100000100110110101110100011010010111011110100101000100000000101100000000100110010111110111000110101101010111111011101101010011111100100110100010011011001100000001110111110000101000000001100110101011110011111101100001110011101111100111100011100010010110111100001010000010001101001001111000000000101001000100100000110011000101011100100000100111011010110100000010001011010101011010010100111011000100011001000001010001011101010000100001011001011100001001011101110100110110010111100": TheInput(n, 2) = "?"
  298.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000010000000000000000000000000000000100000000100000000000000000000011100000000000000000000000000001000000000000000000000000000011001000000000000100000000000000000000000000010010000000000000000000000000000000000000000000000000000000000000000000000000000010001000000000000000000000000000000000000010000000000000000000000010000000000000000000000000000000000000000000000001001000000000011100000000000000001000000000000000000100000000100010000110100000000000000000000000000000000000": TheInput(n, 2) = "?"
  299.     n = n + 1: TheInput(n, 1) = "01011000100010001000011010000010010010000100100101000100011001000010000010110110010110001100010001000010110110000011010100000100100010010011111101111100110010101100000001000000100111010000010000100000000111100110000101110001100100000001000001001100100100010000001001000110000000000100011100110110000101100011100010110100000011001001011000010001001000101010010010000001000000100101100101001110110010010000100010100010000000100111001100000000001000111111010100001000001010000010101010110101101000001100": TheInput(n, 2) = "?"
  300.     n = n + 1: TheInput(n, 1) = "00000101000010010110000110001101111110010001110010000010101001111111010000011011100000110000010101101110101111110101001100000100000000100110001000000000000001110011101011011110000001000110101001000000000000010100010010110110000010001100100010011001010011111011001110110000110100010010000010010110011000010110110010101000111000000100000001101100100110010100110111001110110101010001101100000000110010100010000001000101011100000000000111101110101011001011001100100000001101110000001001101010000000111011": TheInput(n, 2) = "?"
  301.     n = n + 1: TheInput(n, 1) = "10100010000111100111110001101101100001100111001010011110011001101110100111000111001010100111100010110010101010100100100000101010111100100000010111001000101110010010111000001100011011001011010100101101101110001001111100110000001011100000010110011010001000001101101111001000011101001000110010110111100011111011001100011110100110100111001110000101010001010001101001101001011001111010011001101010000001111010110011100001010100011100110100011011110011100101000001110010010111100111110011001110011111001010": TheInput(n, 2) = "?"
  302.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  303.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000100000000000001100000000000000000000000000000000000000000010000000000000000000000000000000001000000000000000000000000000000000001000000000000100000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  304.     n = n + 1: TheInput(n, 1) = "00100000011101101100000000000000000000001010001010001010010000000011101000010100001000000110000110100000000010001000111100100100001010110000011000001010110100110011000010001000110101001001100001011000001000000000000010110000100000110000001001000000100000110100100100100001010011000000010101010010100101000000001011100010000000001100000110100010100010000001110000000100000001110010100100001110000001100110000100001000001000000000010000001000001000000001001100000000010011110100000000001010100001111111": TheInput(n, 2) = "?"
  305.     n = n + 1: TheInput(n, 1) = "01010110100011101001111011101011111111101001100000010100001001111110010111100011101100011111110001101101111000110011010011010011110000101111110110010001000001010100100100110011010010010110101011100000111111111101111110110011111101010011110000111101000010010011010000011100001000011011000011001101100011011101000101010101111011000100001111010100111001011100011100011011011000000010011010010100110010011001111011010010110011111000101110010111111100100100111110111010101001101011010100000001011010010000": TheInput(n, 2) = "?"
  306.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000000000000000000000000001000000000000000000000000000000000000000010000000000000010010100000000000001000000000001000100000000000000000000001000000000000000000000000000000010000000010000000000000000000000001000000010000000000000000000000000000000000000000010000000110000000000000000000000001000000000010000100000000000000000100000001000000010000000000000000000000010000000000000000001000000000000000": TheInput(n, 2) = "?"
  307.     n = n + 1: TheInput(n, 1) = "00000001100010111010101010001001000011001100000000000000010011000111001101001010110010010010010100101010000001001000111000000010110000010001001110100000000101101001110100010100000101000100000101000000010000110000010011010000100101001111000000011110001000001101101100000001000101000000011001011001110111100010010001000011110011110010010001000001110100100010101001110000010100000010010100000000101001000100101000011000000001001010111010110100000011001100101010000000100100100111111001110101000100000001": TheInput(n, 2) = "?"
  308.     n = n + 1: TheInput(n, 1) = "11010010010101000010000011010000101110111010011001101000101111011101001110000001011110100101101111000100000010110001010101000110100001100000111000111100011110110011101101101111101010100100011101000000010010101110000011011100010010101110101010000001110001001111110011011101000010110000101111000000101100011100101100001001100001111110000101110000010010000001001010000000011011000001000101000100000111101100110011000111010000001000010000000000100101010001100001011000001010001000111111110110101000011111": TheInput(n, 2) = "?"
  309.     n = n + 1: TheInput(n, 1) = "11011111000111100000010011111111101111001100100010111010010000011000110100111010011000111101000111010000110110101010011010101011100110011101000001011011111110011100110100001001010000001000010010100101111011000101001000000011110011110001100100100011011001010000101101111110101011011100000111000111000011110101111011101000101010000111011110000111111101011101110110001000011000111011011011111100110000001011011010110101101111011001011000111100101100111010011100110111101100110110100110000010011111110101": TheInput(n, 2) = "?"
  310.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  311.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  312.     n = n + 1: TheInput(n, 1) = "00100000000000000011000000000000000000000110000010011111100000000000000001000000001000000000000000010110000110000001100010000000000011110000000001100000000000110011000011000000010000001110000000011000001000010000110100000010000000111101000000000000000000100000000001100000100011000000000100000000000101000000000011010000001100010100000110110010100001010000110000001000000001100000110000001100000000011010000000000000101001100000000000000000100000011010100000000010010000100100010000000000000001111000": TheInput(n, 2) = "?"
  313.     n = n + 1: TheInput(n, 1) = "00010100011101010101100000101000001100111001101101000000011001111001100110110111010111111011110001100000000001100000011001111000111001000110011010001110100110011001110111100000101000110001100110100111000111001000001001110101101110000000110000000000011001010101000110011101011001100011001001011001101100011110000101101001100011001010011000001100110000101000001111110110000000001100001100010010101111100101001101010000000110011011111100011111010000000101000000100101100111010110001101111010101010000110": TheInput(n, 2) = "?"
  314.     n = n + 1: TheInput(n, 1) = "00000010000000000001100000000000000001000000000000000000000000000000000000000000000001001000000000000000000100000000000000000000010000000000000000100100000101000001000000100001100000000000000000000000000010110000000000000000100001000000000000001000000001100010000000010000010000000000000110000000001000000000001000010000000000010000000000000000000000000000000000000100001000000000000100001000000000000000000100000000000100000000000000000000000001001000000000000000000001000010000000000010000011000000": TheInput(n, 2) = "?"
  315.     n = n + 1: TheInput(n, 1) = "11010000111110000000000011000001011000010011010100100000000000110011011101010010100100000000000000010001101001000001001010011000100101101000111011000001000010010000010000010100001000100110100001100100001001001001100011110010011000110111000011000000011000000000100110001000101101100000001000000000000100000000000001001110001110100000010100001011101010110100001001001000000010010100001010100111011111000100001010000011010001000011001101110001101110000011010101101001010100110100010001011100110100110111": TheInput(n, 2) = "?"
  316.     n = n + 1: TheInput(n, 1) = "00000000110110001000000011001000100000001110011010100010101101111100101100101000001010000000101101010100101011010000010001001110001001100001110101011010111010000100001011001010010100011001011000010000100001000000000100001111001000101011111110100001110010011000100001101000101001101011110001011111000110111010010101000001001011101101110000001011110000011001100011111001010100010101110011000100110000101101010010110000000000010011001001101101000010000010001110000011111100111101100100110000001000110000": TheInput(n, 2) = "?"
  317.     n = n + 1: TheInput(n, 1) = "00101101111001100011001000011101001000000001100000101001000010110101000011001101110010110011000010101100111010101111100101100111000010110111010100000000001010000111111011001000111011100100011111101010010101011111111010010110010001101010100101010110111010111000101111001101001101101111010101010010110001000110110110101000010100001000010011101010011110001000001111001100110001011010100011101011100000100000111001000111001010101111010010010100110111001000100011010110100011111011101001101010111101101010": TheInput(n, 2) = "?"
  318.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  319.     n = n + 1: TheInput(n, 1) = "10000000100000000000000001001001000000100011010001010100000100000000010101100110101000000000000100000101010000000101000000000101100000000000010000001000001011000110100110100010010100010111000100000100001010000000101010001000111001000000010000100100000000000000100000001001000000110001010001001010010000000010101001000111011000100100100000010010000100100000000000001000010010000110010110000110100000000000101001010100000110010001110000111000000110000000000000000000000100101100001010000100000101100010": TheInput(n, 2) = "?"
  320.     n = n + 1: TheInput(n, 1) = "00001101011011101101111110010000011011010000101110101011001001111000101010010001010111100001110011011010100011011010101010111010001010100110101100000110110100101001011001010000001010100000111010111011100100110111010101010100000010000010101110001011010011001111011110110000110010001010001000110100101111101100000110111000000000000010001111101001011011010111110110000100101000111000101001110001010011110100010100100011110000001100001011000100100000011110111111100011000011000011100101111010111010010101": TheInput(n, 2) = "?"
  321.     n = n + 1: TheInput(n, 1) = "01110011000100111110101110110110101110011100101000000011111010011111101010001000000000111110011010111010001110111000111111010010011101111101100111110001000000011000001000001101101001001000010001011000010001111100010001100111000100111111100011010001101101110110000001010110001111000100101110010001101101010001010110110000100111011001010100101101110000001111001111110111100101101001001001111001011111111011000010101001001001101010001111000011011001111111001011111101111001010010110000100001010000011000": TheInput(n, 2) = "?"
  322.     '''
  323.  
  324.  

I'm assuming the last digit in thinking is the prediction? and the .875 means it's pretty sure?
Add the next 50 in and still misses, next is 0.
 
STx predictor.PNG

« Last Edit: December 10, 2021, 12:13:40 am by bplus »

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: Binary Sequence Predictor "game"?
« Reply #2 on: December 10, 2021, 12:43:24 am »
Quote
I'm assuming the last digit in thinking is the prediction? and the .875 means it's pretty sure?
Add the next 50 in and still misses, next is 0.

No. .875 is the answer, so call it 1 for that example. I take some exception to this stuff:

Code: [Select]
FingerPrint(1) = "1010110100011110110100000000101100100111101111001" 'next is 011011010101111111111010100111101110011111101110100
Because it seems that both you and r1 are falling for the same fallacy. No program will predict your next coin toss. The best any program will do, and the thing this does very well, is to predict what'll happen based on the patterns already contained. If you feel like you've outsmarted it, play for longer and make sure you're asking a well-defined question.

 
ssss.png


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

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Binary Sequence Predictor "game"?
« Reply #3 on: December 10, 2021, 02:09:33 am »
What people fall for is thinking that the past results affect future results.

I've flipped a coin 5 times, and every time I've flipped it, it's shown HEADS.  Now, this isn't a trick coin.  I'm not altering the odds in any way.  That's just the natural results of five random coin flips.

Heads - Heads - Heads - Heads - Heads.

What's the next coin toss going to be??

People will look at that and say, "TAILS!  The chances of six heads in a row is miniscule!!"

And they'd be right.  Well, they'd be right exactly 50% of the time!!

There's the EXACT same chance to generate H-H-H-H-H-H as their is to generate H-H-H-H-H-T. 

The question isn't, "What's the chance of flipping 6 heads in a row?"  The question is simply, "What's the chances for the next coin flip?"   And, like all coin flips (that are fair and balanced), the answer is "50-50".

You can't predict randomness.  If you can, it's not random!

BUT, people and nature are seldom random.  Psychology comes into play.  If a person writes on a piece of paper 6 results for an imaginary coin toss, and it's revealed the first five are heads, you then have to analyze the person who wrote the values.  Are they looking bored and indifferent, and couldn't be bothered to care enough to alternate values?   If so, it's probably Heads for the next value as well.  Or are they simply trying hard to look disinterested while sneaking peaks to watch your reaction?  If so, they're trying to outsmart you.  It's probably Tails.  Either way, it's hard for any program to truly predict that person's behavior/guess.

What programs like STx's is doing is simply looking for patterns inside your results and seeing if it can guess what the next value is based on past patterns.  Feed it ten heads in a row, and it's going to look at that and guess number eleven is a head as well.  Which, in true random flips, it'd guess right half the time.  With Bob the indifferent drunk, it'd probably guess right as he's too lazy to move his finger off the H key on his keyboard.  For Joe the cunning, he'd go home and laugh like mad to all his buddies about how he "beat the machine"!
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline _vince

  • Seasoned Forum Regular
  • Posts: 422
    • View Profile
Re: Binary Sequence Predictor "game"?
« Reply #4 on: December 10, 2021, 02:51:35 am »
What people fall for is thinking that the past results affect future results.

I've flipped a coin 5 times, and every time I've flipped it, it's shown HEADS.  Now, this isn't a trick coin.  I'm not altering the odds in any way.  That's just the natural results of five random coin flips.

Heads - Heads - Heads - Heads - Heads.

What's the next coin toss going to be??

People will look at that and say, "TAILS!  The chances of six heads in a row is miniscule!!"

And they'd be right.  Well, they'd be right exactly 50% of the time!!

There's the EXACT same chance to generate H-H-H-H-H-H as their is to generate H-H-H-H-H-T. 

The question isn't, "What's the chance of flipping 6 heads in a row?"  The question is simply, "What's the chances for the next coin flip?"   And, like all coin flips (that are fair and balanced), the answer is "50-50".

You can't predict randomness.  If you can, it's not random!

BUT, people and nature are seldom random.  Psychology comes into play.  If a person writes on a piece of paper 6 results for an imaginary coin toss, and it's revealed the first five are heads, you then have to analyze the person who wrote the values.  Are they looking bored and indifferent, and couldn't be bothered to care enough to alternate values?   If so, it's probably Heads for the next value as well.  Or are they simply trying hard to look disinterested while sneaking peaks to watch your reaction?  If so, they're trying to outsmart you.  It's probably Tails.  Either way, it's hard for any program to truly predict that person's behavior/guess.

What programs like STx's is doing is simply looking for patterns inside your results and seeing if it can guess what the next value is based on past patterns.  Feed it ten heads in a row, and it's going to look at that and guess number eleven is a head as well.  Which, in true random flips, it'd guess right half the time.  With Bob the indifferent drunk, it'd probably guess right as he's too lazy to move his finger off the H key on his keyboard.  For Joe the cunning, he'd go home and laugh like mad to all his buddies about how he "beat the machine"!

nicely written, Steve the cunning!

Offline DANILIN

  • Forum Regular
  • Posts: 128
    • View Profile
    • Danilin youtube
Re: Binary Sequence Predictor "game"?
« Reply #5 on: December 10, 2021, 08:22:59 am »
there were my messages here and disappeared with offtopic section,
but it was saved years ago in different languages:

in short: logarithm

Waves of probability increase reliability. Priority of Russia
https://dev.to/andreydanilin/waves-of-probability-increase-reliability-46bk

+ synthesize a lot of random ones into a column in Excel
=RANDBETWEEN(0;1)
and develop down and Word replacement ^p will create a string

« Last Edit: December 10, 2021, 01:34:44 pm by DANILIN »
Russia looks world from future. big data is peace data.
https://youtube.com/playlist?list=PLBBTP9oVY7IagpH0g9FNUQ8JqmHwxDDDB
i never recommend anything to anyone and always write only about myself

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Binary Sequence Predictor "game"?
« Reply #6 on: December 10, 2021, 12:57:44 pm »
OP
Quote
You can give this probably any pre-cooked, esoteric sequence you can think of

I did and now it's
Quote
and make sure you're asking a well-defined question.

Professor @STxAxTIC,
If I take a very well known sequence of digits, starting at a random part in the sequence but continuing on from there for as long as we like and converting those digits to 0 or 1 depending if even or odd and use that for "pattern" of 1's and 0's,

is that well defined or not?

I think it is because I just stated the construction and it is computable.
« Last Edit: December 10, 2021, 01:05:07 pm by bplus »

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Binary Sequence Predictor "game"?
« Reply #7 on: December 10, 2021, 01:29:02 pm »
How would this do for something completely non-random, such as the Fibonacci Sequence converted to binary?   

0000 0001 0001 0010 0011 0101 1000
0, 1, 1, 2, 3, 5, 8, ....  13 is next

It should give us: 1101

I'm just curious; what exactly does it predict in cases like this?
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: Binary Sequence Predictor "game"?
« Reply #8 on: December 10, 2021, 01:58:00 pm »
Morning boys, just a few quick notes before I open my IDE for the day.

So bplus - The code right now predicts patterns in clusters of 2 characters, 3 characters, 4, etc etc - all the way to 13 for no good reason. This means any patterns "smaller" than 13 will 100% be detected by this algorithm, there's no hiding such order. But - if your input string "repeats" on a basis greater than say, 13, this method will have to look for sub-patterns in your sequence, but won't be able to "zoom out" enough to think really hard about the whole string. The reason I stopped at 13 is completely arbitrary, I can code more frequencies into this, but I figured a human being mashing keys wouldn't be so superhumanly robotic when "trying" to be random. So, one version of asking this program a "good question" is making sure your input string is not too contrived so to have really long frequencies in there, the way I defined them. (Very unrealistic for randomness anyway.)

Another way to ask the program a "good question" usually means you know the answer ahead of time. To know the answer ahead of time, you have to be able infer it from what's laying around, and I can't really think of another way to *guarantee* this than by using a deterministic sequence, but all results are convincing nonetheless. When it spits out a result, I can always look back and go "oh of course"! Haha.

Steve, good question. Already fed the central column of Wolfram's Rule 30 into this thing and got pretty ambiguous results. No wonder they use Rule 30 in their random number generators over there. It's random as hell. Things like the fib sequence, even digits of pi - are effectively random too. If I gave you 1000 digits of pi, starting 1500 digits out, such a list is effectively random as hell, you'd never find any order. Then you could catch me and say "oh no way, thats not random, this is PI, we're talking about circular perfection here" - which is right. In a sense, there's nothing random about pi, but in another sense, it's one of the more disorderly numbers we know about. That all said, this thing will STILL produce AN answer to the question, I'll look into this! (Soon)

Let me remind us all of something, too. The word "random" basically means nothing. It's just like other words that mean nothing, such as "sports". The word is so vague, it means nothing until you get extremely specific. Are sports violent? (yes and no). Do sports require teams? (yes and no). Is shooting a sport? (yes and no)... If I have a system (of classification) where every single question I ask of it results in "yes and no", then that system is useless. Point is, "random" is just like that. The world should really be done away with, somehow, and replaced with maybe 6 new words to specify exactly what is meant.

Okay, back to work. We'll see what this code transforms into today.
« Last Edit: December 10, 2021, 02:11:34 pm by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline jack

  • Seasoned Forum Regular
  • Posts: 408
    • View Profile
Re: Binary Sequence Predictor "game"?
« Reply #9 on: December 10, 2021, 03:28:38 pm »
How would this do for something completely non-random, such as the Fibonacci Sequence converted to binary?   

0000 0001 0001 0010 0011 0101 1000
0, 1, 1, 2, 3, 5, 8, ....  13 is next

It should give us: 1101

I'm just curious; what exactly does it predict in cases like this?
finding subsequent terms of sequence is possible but I have no idea how, I know because there was a library for Maple 4 that would do just that, the function's name was guesss

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Binary Sequence Predictor "game"?
« Reply #10 on: December 10, 2021, 04:39:37 pm »
finding subsequent terms of sequence is possible but I have no idea how, I know because there was a library for Maple 4 that would do just that, the function's name was guesss

Yeah I think could be done, but need terms either separated or like for binary, need a constant amount of 1s and 0s for each term. You'd start by taking difference of each term and then the difference of differences... analyzing increasing, decreasing, alternating... arithmetically, geometrically or exponentially...

Just from differences of differences you could establish degree of polynomial, if I recall correctly.
« Last Edit: December 10, 2021, 04:50:08 pm by bplus »

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: Binary Sequence Predictor "game"?
« Reply #11 on: December 14, 2021, 12:53:24 pm »
Alright this thing has gone through several revisions. In a push to test its lower limits, I disabled some of the high-frequency analysis, so this thing keeps approximate pace with regular typing speed (almost). End result is, the game is way more fun. There's no nonsense on the screen, just a plain story of what's going on. So what's going on?

This thing now keeps a running tally of how well it performs, reported as a percentage of correct guesses. Qualitatively, this thing tends toward the high 50's, low 60's when I'm "trying" to be random. Since I've been staring at binary for some weeks now in various projects, I've become pretty good at beating the machine... for a while. The best I can do is keep it in the high 40's for 150 or so characters, then it catches on and it's right back to high-50s prediction rates. It continues to astound.

 
sssssss.png


Anyway, code is still ugly, but I thought I'd share this toy. I traded a little accuracy for a little fun, was prolly worth it:

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

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Binary Sequence Predictor "game"?
« Reply #12 on: December 14, 2021, 01:03:40 pm »
Not to nitpick, but even if the machine just guessed randomly, shouldn't it have a 50% chance to guess your next move?  58% doesn't seem like that big of an improvement over what I'd consider a baseline guesser.  Am I missing something here?
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: Binary Sequence Predictor "game"?
« Reply #13 on: December 14, 2021, 01:05:50 pm »
yeah because the long-term average is way above 50 when a human uses it

feed it real randomness to hover near 50%

EDIT:

Read this post: https://www.qb64.org/forum/index.php?topic=4463.msg139110#msg139110

or more importantly, play with this since you never ever wanna hear it from me:  https://www.expunctis.com/2019/03/07/Not-so-random.html
« Last Edit: December 14, 2021, 01:14:47 pm by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Binary Sequence Predictor "game"?
« Reply #14 on: December 14, 2021, 01:32:45 pm »
I'd consider this a little baseline for these type of programs:

Code: QB64: [Select]
  1. OM = -1: OM2 = -1
  2.  
  3.     MB = _MouseButton(1): MB2 = _MouseButton(2): C$ = ""
  4.     Cls
  5.     Print "RANDOM GUESSER!"
  6.     Print
  7.     Print "Left Click or Right Click and try to generate as random of a pattern as possibble, and I'll predict what you're going to click"
  8.     Print
  9.     Print "So far, you have         :"; Click$
  10.     Print
  11.     Print "And my guesses have been :"; Guess$
  12.     Print
  13.     If total > 0 Then Print Using "I am ##.##% accurate!"; 100 * right / total
  14.     If MB And Not OM Then C$ = "L"
  15.     If MB2 And Not OM2 Then C$ = "R"
  16.     If C$ <> "" Then
  17.         total = total + 1
  18.         Click$ = Click$ + C$
  19.         If Int(Rnd * 2) Then G$ = "L" Else G$ = "R"
  20.         Guess$ = Guess$ + G$
  21.         If G$ = C$ Then right = right + 1
  22.     End If
  23.  
  24.     OM = MB: OM2 = MB2
  25.     _Limit 60
  26.     _Display

 
SS.png
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!