Advertisement
Brandan

Untitled

Dec 24th, 2011
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 8.86 KB | None | 0 0
  1.   If ai = 1 Then
  2.             Dim AntiAiTeam
  3.             If Whosup = "X" Then
  4.                 AntiAiTeam = "O"
  5.             Else
  6.                 AntiAiTeam = "X"
  7.             End If
  8.  
  9.             ' Checking If it can win
  10.  
  11.             ' PATTERN 1
  12.             If gameboard_1_1.Text = spaces And gameboard_2_1.Text = AiTeam And gameboard_3_1.Text = AiTeam Then
  13.                 gameboard_1_1.Text = Whosup
  14.                 GoTo end_of_ai
  15.             End If
  16.  
  17.             'PATTERN 2
  18.             If gameboard_1_1.Text = spaces And gameboard_1_2.Text = AiTeam And gameboard_1_3.Text = AiTeam Then
  19.                 gameboard_1_1.Text = Whosup
  20.                 GoTo end_of_ai
  21.             End If
  22.  
  23.             'PATTERN 3
  24.             If gameboard_1_1.Text = spaces And gameboard_2_2.Text = AiTeam And gameboard_3_3.Text = AiTeam Then
  25.                 gameboard_1_1.Text = Whosup
  26.                 GoTo end_of_ai
  27.             End If
  28.  
  29.             'PATTERN 4
  30.             If gameboard_2_1.Text = spaces And gameboard_1_1.Text = AiTeam And gameboard_3_1.Text = AiTeam Then
  31.                 gameboard_2_1.Text = Whosup
  32.                 GoTo end_of_ai
  33.             End If
  34.  
  35.             'PATTERN 5
  36.             If gameboard_2_1.Text = spaces And gameboard_2_2.Text = AiTeam And gameboard_2_3.Text = AiTeam Then
  37.                 gameboard_2_1.Text = Whosup
  38.                 GoTo end_of_ai
  39.             End If
  40.  
  41.             ' Pattern 6
  42.             If gameboard_1_1.Text = spaces And gameboard_2_1.Text = AntiAiTeam And gameboard_3_1.Text = AntiAiTeam Then
  43.                 gameboard_1_1.Text = Whosup
  44.                 GoTo end_of_ai
  45.             End If
  46.  
  47.             ' Pattern 7
  48.             If gameboard_1_1.Text = spaces And gameboard_1_2.Text = AntiAiTeam And gameboard_1_3.Text = AntiAiTeam Then
  49.                 gameboard_1_1.Text = Whosup
  50.                 GoTo end_of_ai
  51.             End If
  52.  
  53.             ' Pattern 8
  54.             If gameboard_1_1.Text = spaces And gameboard_2_2.Text = AntiAiTeam And gameboard_3_3.Text = AntiAiTeam Then
  55.                 gameboard_1_1.Text = Whosup
  56.                 GoTo end_of_ai
  57.             End If
  58.  
  59.             ' Pattern 9
  60.             If gameboard_2_1.Text = spaces And gameboard_1_1.Text = AntiAiTeam And gameboard_3_1.Text = AntiAiTeam Then
  61.                 gameboard_2_1.Text = Whosup
  62.                 GoTo end_of_ai
  63.             End If
  64.  
  65.             ' Pattern 10
  66.             If gameboard_2_1.Text = spaces And gameboard_2_2.Text = AntiAiTeam And gameboard_2_3.Text = AntiAiTeam Then
  67.                 gameboard_2_1.Text = Whosup
  68.                 GoTo end_of_ai
  69.             End If
  70.  
  71.             ' Causes glitches
  72.             '' Pattern 11
  73.             'If gameboard_2_1.Text = spaces And gameboard_2_2.Text = AiTeam And gameboard_1_3.Text = AntiAiTeam And gameboard_3_1.Text = AntiAiTeam Then
  74.             '    gameboard_2_1.Text = Whosup
  75.             '    GoTo end_of_ai
  76.             'End If
  77.  
  78.             ' Pattern 12
  79.             If gameboard_1_1.Text = spaces And gameboard_1_2.Text = AntiAiTeam And gameboard_2_1.Text = AntiAiTeam And gameboard_2_2.Text = AiTeam Then
  80.                 gameboard_1_1.Text = Whosup
  81.                 GoTo end_of_ai
  82.             End If
  83.  
  84.             ' Pattern 13
  85.             If gameboard_1_1.Text = spaces And gameboard_1_2.Text = AntiAiTeam And gameboard_2_2.Text = AiTeam And gameboard_3_1.Text = AntiAiTeam Then
  86.                 gameboard_1_1.Text = Whosup
  87.                 GoTo end_of_ai
  88.             End If
  89.  
  90.             ' Pattern 14
  91.             If gameboard_1_1.Text = spaces And gameboard_1_3.Text = AntiAiTeam And gameboard_2_2.Text = AiTeam And gameboard_3_1.Text = AntiAiTeam Then
  92.                 gameboard_1_1.Text = Whosup
  93.                 GoTo end_of_ai
  94.             End If
  95.  
  96.             ' Pattern 15
  97.             If gameboard_2_1.Text = spaces And gameboard_2_1.Text = AntiAiTeam Then
  98.                 gameboard_2_1.Text = Whosup
  99.                 GoTo end_of_ai
  100.             End If
  101.  
  102.             ' Causes gliches
  103.             '' Pattern 16
  104.             'If gameboard_1_1.Text = spaces And gameboard_2_2.Text = AntiAiTeam Then
  105.             '    gameboard_1_1.Text = Whosup
  106.             '    GoTo end_of_ai
  107.             'End If
  108.  
  109.             ' Pattern 17
  110.             If gameboard_3_3.Text = spaces And gameboard_2_3.Text = AntiAiTeam And gameboard_1_3.Text = AntiAiTeam Then
  111.                 gameboard_3_3.Text = Whosup
  112.                 GoTo end_of_ai
  113.             End If
  114.  
  115.             ' Pattern 18
  116.             If gameboard_3_1.Text = spaces And gameboard_3_2.Text = AntiAiTeam And gameboard_3_3.Text = AntiAiTeam Then
  117.                 gameboard_3_1.Text = Whosup
  118.                 GoTo end_of_ai
  119.             End If
  120.  
  121.             ' Pattern 19
  122.             If gameboard_1_3.Text = spaces And gameboard_1_1.Text = AntiAiTeam And gameboard_1_2.Text = AntiAiTeam Then
  123.                 gameboard_1_3.Text = Whosup
  124.                 GoTo end_of_ai
  125.             End If
  126.  
  127.             ' Pattern 20
  128.             If gameboard_2_2.Text = spaces And gameboard_1_2.Text = AntiAiTeam And gameboard_3_2.Text = AntiAiTeam Then
  129.                 gameboard_2_2.Text = Whosup
  130.                 GoTo end_of_ai
  131.             End If
  132.  
  133.             ' Pattern 21
  134.             If gameboard_2_2.Text = spaces And gameboard_1_3.Text = AntiAiTeam And gameboard_3_1.Text = AntiAiTeam Then
  135.                 gameboard_2_2.Text = Whosup
  136.                 GoTo end_of_ai
  137.             End If
  138.  
  139.             ' Pattern 22
  140.             If gameboard_3_1.Text = spaces And gameboard_2_2.Text = AntiAiTeam And gameboard_1_3.Text = AntiAiTeam Then
  141.                 gameboard_3_1.Text = Whosup
  142.                 GoTo end_of_ai
  143.             End If
  144.  
  145.             ' Pattern 23
  146.             If gameboard_3_2.Text = spaces And gameboard_1_2.Text = AntiAiTeam And gameboard_2_2.Text = AntiAiTeam Then
  147.                 gameboard_3_2.Text = Whosup
  148.                 GoTo end_of_ai
  149.             End If
  150.  
  151.             ' Pattern 24
  152.             If gameboard_2_3.Text = spaces And gameboard_2_1.Text = AntiAiTeam And gameboard_2_2.Text = spaces Then
  153.                 gameboard_2_3.Text = Whosup
  154.                 GoTo end_of_ai
  155.             End If
  156.  
  157.             ' Pattern 25
  158.             If gameboard_3_1.Text = spaces And gameboard_2_1.Text = AntiAiTeam And gameboard_1_1.Text = AntiAiTeam Then
  159.                 gameboard_3_1.Text = Whosup
  160.                 GoTo end_of_ai
  161.             End If
  162.  
  163.             ' Pattern 26
  164.             If gameboard_3_1.Text = spaces And gameboard_2_1.Text = AntiAiTeam And gameboard_1_1.Text = AntiAiTeam Then
  165.                 gameboard_3_1.Text = Whosup
  166.                 GoTo end_of_ai
  167.             End If
  168.  
  169.             ' Pattern 27
  170.             If gameboard_3_1.Text = spaces And gameboard_2_2.Text = AntiAiTeam And gameboard_1_3.Text = AntiAiTeam Then
  171.                 gameboard_3_1.Text = Whosup
  172.                 GoTo end_of_ai
  173.             End If
  174.  
  175.             ' Pattern 28
  176.             If gameboard_2_3.Text = spaces And gameboard_1_3.Text = AntiAiTeam And gameboard_3_3.Text = AntiAiTeam Then
  177.                 gameboard_2_3.Text = Whosup
  178.                 GoTo end_of_ai
  179.             End If
  180.  
  181.             ' Pattern 29
  182.             If gameboard_1_3.Text = spaces And gameboard_2_2.Text = AntiAiTeam And gameboard_3_1.Text = AntiAiTeam Then
  183.                 gameboard_1_3.Text = Whosup
  184.                 GoTo end_of_ai
  185.             End If
  186.  
  187.             ' Pattern 30
  188.             If gameboard_2_3.Text = spaces And gameboard_2_2.Text = AntiAiTeam And gameboard_2_1.Text = AntiAiTeam Then
  189.                 gameboard_2_3.Text = Whosup
  190.                 GoTo end_of_ai
  191.             End If
  192.  
  193.             ' Pattern 31
  194.             If gameboard_2_3.Text = spaces And gameboard_3_3.Text = spaces And gameboard_1_3.Text = AntiAiTeam Then
  195.                 gameboard_2_3.Text = Whosup
  196.                 GoTo end_of_ai
  197.             End If
  198.  
  199.             If gameboard_1_3.Text = spaces Then
  200.                 gameboard_1_3.Text = Whosup
  201.                 GoTo end_of_ai
  202.             ElseIf gameboard_1_2.Text = spaces Then
  203.                 gameboard_1_2.Text = Whosup
  204.                 GoTo end_of_ai
  205.             ElseIf gameboard_1_3.Text = spaces Then
  206.                 gameboard_1_3.Text = Whosup
  207.                 GoTo end_of_ai
  208.             ElseIf gameboard_2_1.Text = spaces Then
  209.                 gameboard_2_1.Text = Whosup
  210.                 GoTo end_of_ai
  211.             ElseIf gameboard_2_2.Text = spaces Then
  212.                 gameboard_2_2.Text = Whosup
  213.             ElseIf gameboard_2_3.Text = spaces Then
  214.                 gameboard_2_3.Text = Whosup
  215.                 GoTo end_of_ai
  216.             ElseIf gameboard_3_1.Text = spaces Then
  217.                 gameboard_3_1.Text = Whosup
  218.                 GoTo end_of_ai
  219.             ElseIf gameboard_3_2.Text = spaces Then
  220.                 gameboard_3_2.Text = Whosup
  221.                 GoTo end_of_ai
  222.             ElseIf gameboard_3_3.Text = spaces Then
  223.                 gameboard_3_3.Text = Whosup
  224.                 GoTo end_of_ai
  225.             End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement