Advertisement
cjminchin

Untitled

Apr 9th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class Form1
  2.  
  3.  
  4.     Dim card1 As Integer
  5.     Dim card2 As Integer
  6.  
  7.     Dim p1Score As Integer = 26
  8.     Dim p2Score As Integer = 26
  9.  
  10.     Dim pointVal1 As Integer
  11.     Dim pointVal2 As Integer
  12.  
  13.     Dim WpointVal1 As Integer
  14.     Dim WpointVal2 As Integer
  15.  
  16.  
  17.  
  18.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  19.  
  20.         Randomize()
  21.  
  22.         p1Score = p1Score - 1
  23.         p2Score = p2Score - 1
  24.  
  25.         card1 = (Rnd() * 52) + 1
  26.         card2 = (Rnd() * 52) + 1
  27.  
  28.         Label1.Text = card1
  29.         lblP1Val.Text = card2
  30.  
  31.         If card1 = 1 Then
  32.  
  33.             PictureBox1.BackgroundImage = My.Resources.aceclubs
  34.             pointVal1 = 14
  35.  
  36.         ElseIf card1 = 2 Then
  37.             PictureBox1.BackgroundImage = My.Resources._2clubs
  38.             pointVal1 = 2
  39.  
  40.  
  41.         ElseIf card1 = 3 Then
  42.             PictureBox1.BackgroundImage = My.Resources._3clubs
  43.             pointVal1 = 3
  44.  
  45.  
  46.         ElseIf card1 = 4 Then
  47.             PictureBox1.BackgroundImage = My.Resources._4clubs
  48.             pointVal1 = 4
  49.  
  50.         ElseIf card1 = 5 Then
  51.             PictureBox1.BackgroundImage = My.Resources._5clubs
  52.             pointVal1 = 5
  53.  
  54.         ElseIf card1 = 6 Then
  55.             PictureBox1.BackgroundImage = My.Resources._6clubs
  56.             pointVal1 = 6
  57.  
  58.         ElseIf card1 = 7 Then
  59.             PictureBox1.BackgroundImage = My.Resources._7clubs
  60.             pointVal1 = 7
  61.  
  62.         ElseIf card1 = 8 Then
  63.             PictureBox1.BackgroundImage = My.Resources._8clubs
  64.             pointVal1 = 8
  65.  
  66.         ElseIf card1 = 9 Then
  67.             PictureBox1.BackgroundImage = My.Resources._9clubs
  68.             pointVal1 = 9
  69.  
  70.         ElseIf card1 = 10 Then
  71.             PictureBox1.BackgroundImage = My.Resources._10clubs
  72.             pointVal1 = 10
  73.  
  74.         ElseIf card1 = 11 Then
  75.             PictureBox1.BackgroundImage = My.Resources.jackclubs
  76.             pointVal1 = 11
  77.  
  78.         ElseIf card1 = 12 Then
  79.             PictureBox1.BackgroundImage = My.Resources.queenclubs
  80.             pointVal1 = 12
  81.  
  82.         ElseIf card1 = 13 Then
  83.             PictureBox1.BackgroundImage = My.Resources.kingclubs
  84.             pointVal1 = 13
  85.  
  86.         ElseIf card1 = 14 Then
  87.             PictureBox1.BackgroundImage = My.Resources.acediamonds
  88.             pointVal1 = 14
  89.  
  90.         ElseIf card1 = 15 Then
  91.             PictureBox1.BackgroundImage = My.Resources._2diamonds
  92.             pointVal1 = 2
  93.  
  94.         ElseIf card1 = 16 Then
  95.             PictureBox1.BackgroundImage = My.Resources._3diamonds
  96.             pointVal1 = 3
  97.  
  98.         ElseIf card1 = 17 Then
  99.             PictureBox1.BackgroundImage = My.Resources._4diamonds
  100.             pointVal1 = 1
  101.  
  102.         ElseIf card1 = 18 Then
  103.             PictureBox1.BackgroundImage = My.Resources._5diamonds
  104.             pointVal1 = 5
  105.  
  106.         ElseIf card1 = 18 Then
  107.             PictureBox1.BackgroundImage = My.Resources._6diamonds
  108.             pointVal1 = 6
  109.  
  110.         ElseIf card1 = 20 Then
  111.             PictureBox1.BackgroundImage = My.Resources._7diamonds
  112.             pointVal1 = 7
  113.  
  114.         ElseIf card1 = 21 Then
  115.             PictureBox1.BackgroundImage = My.Resources._8diamonds
  116.             pointVal1 = 8
  117.  
  118.         ElseIf card1 = 22 Then
  119.             PictureBox1.BackgroundImage = My.Resources._9diamonds
  120.             pointVal1 = 9
  121.  
  122.         ElseIf card1 = 23 Then
  123.             PictureBox1.BackgroundImage = My.Resources._10diamonds
  124.             pointVal1 = 10
  125.  
  126.         ElseIf card1 = 24 Then
  127.             PictureBox1.BackgroundImage = My.Resources.jackdiamonds
  128.             pointVal1 = 11
  129.  
  130.         ElseIf card1 = 25 Then
  131.             PictureBox1.BackgroundImage = My.Resources.queendiamonds
  132.             pointVal1 = 12
  133.  
  134.         ElseIf card1 = 26 Then
  135.             PictureBox1.BackgroundImage = My.Resources.kingdiamonds
  136.             pointVal1 = 13
  137.  
  138.         ElseIf card1 = 27 Then
  139.             PictureBox1.BackgroundImage = My.Resources.acehearts
  140.             pointVal1 = 14
  141.  
  142.         ElseIf card1 = 28 Then
  143.             PictureBox1.BackgroundImage = My.Resources._2hearts
  144.             pointVal1 = 2
  145.  
  146.         ElseIf card1 = 29 Then
  147.             PictureBox1.BackgroundImage = My.Resources._3hearts
  148.             pointVal1 = 3
  149.  
  150.         ElseIf card1 = 30 Then
  151.             PictureBox1.BackgroundImage = My.Resources._4hearts
  152.             pointVal1 = 4
  153.  
  154.         ElseIf card1 = 31 Then
  155.             PictureBox1.BackgroundImage = My.Resources._5hearts
  156.             pointVal1 = 5
  157.  
  158.         ElseIf card1 = 32 Then
  159.             PictureBox1.BackgroundImage = My.Resources._6hearts
  160.             pointVal1 = 6
  161.  
  162.         ElseIf card1 = 33 Then
  163.             PictureBox1.BackgroundImage = My.Resources._7hearts
  164.             pointVal1 = 7
  165.  
  166.         ElseIf card1 = 34 Then
  167.             PictureBox1.BackgroundImage = My.Resources._8hearts
  168.             pointVal1 = 8
  169.  
  170.         ElseIf card1 = 35 Then
  171.             PictureBox1.BackgroundImage = My.Resources._9hearts
  172.             pointVal1 = 9
  173.  
  174.         ElseIf card1 = 36 Then
  175.             PictureBox1.BackgroundImage = My.Resources._10hearts
  176.             pointVal1 = 10
  177.  
  178.         ElseIf card1 = 37 Then
  179.             PictureBox1.BackgroundImage = My.Resources.jackhearts
  180.             pointVal1 = 11
  181.  
  182.         ElseIf card1 = 38 Then
  183.             PictureBox1.BackgroundImage = My.Resources.queenhearts
  184.             pointVal1 = 12
  185.  
  186.         ElseIf card1 = 39 Then
  187.             PictureBox1.BackgroundImage = My.Resources.kinghearts
  188.             pointVal1 = 13
  189.  
  190.         ElseIf card1 = 40 Then
  191.             PictureBox1.BackgroundImage = My.Resources.acespades
  192.             pointVal1 = 14
  193.  
  194.         ElseIf card1 = 41 Then
  195.             PictureBox1.BackgroundImage = My.Resources._2spades
  196.             pointVal1 = 2
  197.  
  198.         ElseIf card1 = 42 Then
  199.             PictureBox1.BackgroundImage = My.Resources._3spades
  200.             pointVal1 = 3
  201.  
  202.         ElseIf card1 = 43 Then
  203.             PictureBox1.BackgroundImage = My.Resources._4spades
  204.             pointVal1 = 4
  205.  
  206.         ElseIf card1 = 44 Then
  207.             PictureBox1.BackgroundImage = My.Resources._5spades
  208.             pointVal1 = 5
  209.  
  210.         ElseIf card1 = 45 Then
  211.             PictureBox1.BackgroundImage = My.Resources._6spades
  212.             pointVal1 = 6
  213.  
  214.         ElseIf card1 = 46 Then
  215.             PictureBox1.BackgroundImage = My.Resources._7spades
  216.             pointVal1 = 7
  217.  
  218.         ElseIf card1 = 47 Then
  219.             PictureBox1.BackgroundImage = My.Resources._8spades
  220.             pointVal1 = 8
  221.  
  222.         ElseIf card1 = 48 Then
  223.             PictureBox1.BackgroundImage = My.Resources._9spades
  224.             pointVal1 = 9
  225.  
  226.         ElseIf card1 = 49 Then
  227.             PictureBox1.BackgroundImage = My.Resources._10spades
  228.             pointVal1 = 10
  229.  
  230.         ElseIf card1 = 50 Then
  231.             PictureBox1.BackgroundImage = My.Resources.jackspades
  232.             pointVal1 = 11
  233.  
  234.         ElseIf card1 = 51 Then
  235.             PictureBox1.BackgroundImage = My.Resources.queenspades
  236.             pointVal1 = 12
  237.  
  238.         ElseIf card1 = 52 Then
  239.             PictureBox1.BackgroundImage = My.Resources.kingspades
  240.             pointVal1 = 13
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.             ' this is continued for 52 cards --> for player 1 and then recreated for player 2...
  248.  
  249.  
  250.         End If
  251.  
  252.  
  253.         If card2 = 1 Then
  254.  
  255.             PictureBox2.BackgroundImage = My.Resources.aceclubs
  256.             pointVal2 = 14
  257.  
  258.         ElseIf card2 = 2 Then
  259.             PictureBox2.BackgroundImage = My.Resources._2clubs
  260.             pointVal2 = 2
  261.  
  262.  
  263.         ElseIf card2 = 3 Then
  264.             PictureBox2.BackgroundImage = My.Resources._3clubs
  265.             pointVal2 = 3
  266.  
  267.  
  268.         ElseIf card2 = 4 Then
  269.             PictureBox2.BackgroundImage = My.Resources._4clubs
  270.             pointVal2 = 4
  271.  
  272.         ElseIf card2 = 5 Then
  273.             PictureBox2.BackgroundImage = My.Resources._5clubs
  274.             pointVal2 = 5
  275.  
  276.         ElseIf card2 = 6 Then
  277.             PictureBox2.BackgroundImage = My.Resources._6clubs
  278.             pointVal2 = 6
  279.  
  280.         ElseIf card2 = 7 Then
  281.             PictureBox2.BackgroundImage = My.Resources._7clubs
  282.             pointVal2 = 7
  283.  
  284.         ElseIf card2 = 8 Then
  285.             PictureBox2.BackgroundImage = My.Resources._8clubs
  286.             pointVal2 = 8
  287.  
  288.         ElseIf card2 = 9 Then
  289.             PictureBox2.BackgroundImage = My.Resources._9clubs
  290.             pointVal2 = 9
  291.  
  292.         ElseIf card2 = 10 Then
  293.             PictureBox2.BackgroundImage = My.Resources._10clubs
  294.             pointVal2 = 10
  295.  
  296.         ElseIf card2 = 11 Then
  297.             PictureBox2.BackgroundImage = My.Resources.jackclubs
  298.             pointVal2 = 11
  299.  
  300.         ElseIf card2 = 12 Then
  301.             PictureBox2.BackgroundImage = My.Resources.queenclubs
  302.             pointVal2 = 12
  303.  
  304.         ElseIf card2 = 13 Then
  305.             PictureBox2.BackgroundImage = My.Resources.kingclubs
  306.             pointVal2 = 13
  307.  
  308.         ElseIf card2 = 14 Then
  309.             PictureBox2.BackgroundImage = My.Resources.acediamonds
  310.             pointVal2 = 14
  311.  
  312.         ElseIf card2 = 15 Then
  313.             PictureBox2.BackgroundImage = My.Resources._2diamonds
  314.             pointVal2 = 2
  315.  
  316.         ElseIf card2 = 16 Then
  317.             PictureBox2.BackgroundImage = My.Resources._3diamonds
  318.             pointVal2 = 3
  319.  
  320.         ElseIf card2 = 17 Then
  321.             PictureBox2.BackgroundImage = My.Resources._4diamonds
  322.             pointVal2 = 1
  323.  
  324.         ElseIf card2 = 18 Then
  325.             PictureBox2.BackgroundImage = My.Resources._5diamonds
  326.             pointVal2 = 5
  327.  
  328.         ElseIf card2 = 18 Then
  329.             PictureBox2.BackgroundImage = My.Resources._6diamonds
  330.             pointVal2 = 6
  331.  
  332.         ElseIf card2 = 20 Then
  333.             PictureBox2.BackgroundImage = My.Resources._7diamonds
  334.             pointVal2 = 7
  335.  
  336.         ElseIf card2 = 21 Then
  337.             PictureBox2.BackgroundImage = My.Resources._8diamonds
  338.             pointVal2 = 8
  339.  
  340.         ElseIf card2 = 22 Then
  341.             PictureBox2.BackgroundImage = My.Resources._9diamonds
  342.             pointVal2 = 9
  343.  
  344.         ElseIf card2 = 23 Then
  345.             PictureBox2.BackgroundImage = My.Resources._10diamonds
  346.             pointVal2 = 10
  347.  
  348.         ElseIf card2 = 24 Then
  349.             PictureBox2.BackgroundImage = My.Resources.jackdiamonds
  350.             pointVal2 = 11
  351.  
  352.         ElseIf card2 = 25 Then
  353.             PictureBox2.BackgroundImage = My.Resources.queendiamonds
  354.             pointVal2 = 12
  355.  
  356.         ElseIf card2 = 26 Then
  357.             PictureBox2.BackgroundImage = My.Resources.kingdiamonds
  358.             pointVal2 = 13
  359.  
  360.         ElseIf card2 = 27 Then
  361.             PictureBox2.BackgroundImage = My.Resources.acehearts
  362.             pointVal2 = 14
  363.  
  364.         ElseIf card2 = 28 Then
  365.             PictureBox2.BackgroundImage = My.Resources._2hearts
  366.             pointVal2 = 2
  367.  
  368.         ElseIf card2 = 29 Then
  369.             PictureBox2.BackgroundImage = My.Resources._3hearts
  370.             pointVal2 = 3
  371.  
  372.         ElseIf card2 = 30 Then
  373.             PictureBox2.BackgroundImage = My.Resources._4hearts
  374.             pointVal2 = 4
  375.  
  376.         ElseIf card2 = 31 Then
  377.             PictureBox2.BackgroundImage = My.Resources._5hearts
  378.             pointVal2 = 5
  379.  
  380.         ElseIf card2 = 32 Then
  381.             PictureBox2.BackgroundImage = My.Resources._6hearts
  382.             pointVal2 = 6
  383.  
  384.         ElseIf card2 = 33 Then
  385.             PictureBox2.BackgroundImage = My.Resources._7hearts
  386.             pointVal2 = 7
  387.  
  388.         ElseIf card2 = 34 Then
  389.             PictureBox2.BackgroundImage = My.Resources._8hearts
  390.             pointVal2 = 8
  391.  
  392.         ElseIf card2 = 35 Then
  393.             PictureBox2.BackgroundImage = My.Resources._9hearts
  394.             pointVal2 = 9
  395.  
  396.         ElseIf card2 = 36 Then
  397.             PictureBox2.BackgroundImage = My.Resources._10hearts
  398.             pointVal2 = 10
  399.  
  400.         ElseIf card2 = 37 Then
  401.             PictureBox2.BackgroundImage = My.Resources.jackhearts
  402.             pointVal2 = 11
  403.  
  404.         ElseIf card2 = 38 Then
  405.             PictureBox2.BackgroundImage = My.Resources.queenhearts
  406.             pointVal2 = 12
  407.  
  408.         ElseIf card2 = 39 Then
  409.             PictureBox2.BackgroundImage = My.Resources.kinghearts
  410.             pointVal2 = 13
  411.  
  412.         ElseIf card2 = 40 Then
  413.             PictureBox2.BackgroundImage = My.Resources.acespades
  414.             pointVal2 = 14
  415.  
  416.         ElseIf card2 = 41 Then
  417.             PictureBox2.BackgroundImage = My.Resources._2spades
  418.             pointVal2 = 2
  419.  
  420.         ElseIf card2 = 42 Then
  421.             PictureBox2.BackgroundImage = My.Resources._3spades
  422.             pointVal2 = 3
  423.  
  424.         ElseIf card2 = 43 Then
  425.             PictureBox2.BackgroundImage = My.Resources._4spades
  426.             pointVal2 = 4
  427.  
  428.         ElseIf card2 = 44 Then
  429.             PictureBox2.BackgroundImage = My.Resources._5spades
  430.             pointVal2 = 5
  431.  
  432.         ElseIf card2 = 45 Then
  433.             PictureBox2.BackgroundImage = My.Resources._6spades
  434.             pointVal2 = 6
  435.  
  436.         ElseIf card2 = 46 Then
  437.             PictureBox2.BackgroundImage = My.Resources._7spades
  438.             pointVal2 = 7
  439.  
  440.         ElseIf card2 = 47 Then
  441.             PictureBox2.BackgroundImage = My.Resources._8spades
  442.             pointVal2 = 8
  443.  
  444.         ElseIf card2 = 48 Then
  445.             PictureBox2.BackgroundImage = My.Resources._9spades
  446.             pointVal2 = 9
  447.  
  448.         ElseIf card2 = 49 Then
  449.             PictureBox2.BackgroundImage = My.Resources._10spades
  450.             pointVal2 = 10
  451.  
  452.         ElseIf card2 = 50 Then
  453.             PictureBox2.BackgroundImage = My.Resources.jackspades
  454.             pointVal2 = 11
  455.  
  456.         ElseIf card2 = 51 Then
  457.             PictureBox2.BackgroundImage = My.Resources.queenspades
  458.             pointVal2 = 12
  459.  
  460.         ElseIf card2 = 52 Then
  461.             PictureBox2.BackgroundImage = My.Resources.kingspades
  462.             pointVal2 = 13
  463.  
  464.             ' this is continued for 52 cards --> for player 1 and then recreated for player 2...
  465.  
  466.         End If
  467.  
  468.  
  469.  
  470.         If pointVal1 < pointVal2 Then
  471.  
  472.             p2Score = p2Score + 2
  473.  
  474.         End If
  475.  
  476.         If pointVal1 = pointVal2 Then
  477.  
  478.             Button1.Enabled = False
  479.  
  480.             btnWar.Visible = True
  481.             btnWar.Enabled = True
  482.  
  483.  
  484.  
  485.             warcard1.Visible = True
  486.             warcard2.Visible = True
  487.             warcard3.Visible = True
  488.             warcard4.Visible = True
  489.             warcard5.Visible = True
  490.             warcard6.Visible = True
  491.  
  492.  
  493.         End If
  494.  
  495.  
  496.         lblP1Val.Text = p1Score
  497.         lblP2Val.Text = p2Score
  498.         'update score here too
  499.  
  500.         If p1Score >= 52 Then
  501.             MessageBox.Show("Player 1 Wins!")
  502.  
  503.             Application.Restart()
  504.  
  505.  
  506.         End If
  507.  
  508.         If p2Score >= 52 Then
  509.             MessageBox.Show("Player 2 Wins!")
  510.  
  511.             Application.Restart()
  512.  
  513.  
  514.         End If
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.     End Sub
  524.  
  525.  
  526.  
  527.     Private Sub btnWar_Click(sender As Object, e As EventArgs) Handles btnWar.Click
  528.  
  529.  
  530.         'this is where the war code goes... good luck muhahahhaahahah
  531.        Dim w1 As Integer
  532.         Dim w2 As Integer
  533.  
  534.         p1Score = p1Score - 4
  535.         p2Score = p2Score - 4
  536.  
  537.         w1 = (Rnd() * 52) + 1
  538.         w2 = (Rnd() * 52) + 1
  539.  
  540.  
  541.         If w1 = 1 Then
  542.  
  543.             warval1.BackgroundImage = My.Resources.aceclubs
  544.             WpointVal1 = 14
  545.  
  546.  
  547.         ElseIf w1 = 2 Then
  548.             warval1.BackgroundImage = My.Resources._2clubs
  549.             WpointVal1 = 2
  550.  
  551.         ElseIf w1 = 3 Then
  552.  
  553.             warval1.BackgroundImage = My.Resources._3clubs
  554.             WpointVal1 = 3
  555.  
  556.         ElseIf w1 = 4 Then
  557.  
  558.             warval1.BackgroundImage = My.Resources._4clubs
  559.             WpointVal1 = 4
  560.  
  561.         ElseIf w1 = 5 Then
  562.  
  563.             warval1.BackgroundImage = My.Resources._5clubs
  564.             WpointVal1 = 5
  565.  
  566.         ElseIf w1 = 6 Then
  567.  
  568.             warval1.BackgroundImage = My.Resources._6clubs
  569.             WpointVal1 = 6
  570.  
  571.         ElseIf w1 = 7 Then
  572.  
  573.             warval1.BackgroundImage = My.Resources._7clubs
  574.             WpointVal1 = 7
  575.  
  576.         ElseIf w1 = 8 Then
  577.  
  578.             warval1.BackgroundImage = My.Resources._8clubs
  579.             WpointVal1 = 8
  580.  
  581.         ElseIf w1 = 9 Then
  582.  
  583.             warval1.BackgroundImage = My.Resources._9clubs
  584.             WpointVal1 = 9
  585.  
  586.         ElseIf w1 = 10 Then
  587.  
  588.             warval1.BackgroundImage = My.Resources._10clubs
  589.             WpointVal1 = 10
  590.  
  591.         ElseIf w1 = 11 Then
  592.  
  593.             warval1.BackgroundImage = My.Resources.jackclubs
  594.             WpointVal1 = 11
  595.  
  596.         ElseIf w1 = 12 Then
  597.  
  598.             warval1.BackgroundImage = My.Resources.queenclubs
  599.             WpointVal1 = 12
  600.  
  601.         ElseIf w1 = 13 Then
  602.  
  603.             warval1.BackgroundImage = My.Resources.kingclubs
  604.             WpointVal1 = 13
  605.  
  606.         ElseIf w1 = 14 Then
  607.  
  608.             warval1.BackgroundImage = My.Resources.acediamonds
  609.             WpointVal1 = 14
  610.  
  611.         ElseIf w1 = 15 Then
  612.  
  613.             warval1.BackgroundImage = My.Resources._2diamonds
  614.             WpointVal1 = 12
  615.  
  616.         ElseIf w1 = 16 Then
  617.  
  618.             warval1.BackgroundImage = My.Resources._3diamonds
  619.             WpointVal1 = 3
  620.  
  621.         ElseIf w1 = 17 Then
  622.  
  623.             warval1.BackgroundImage = My.Resources._4diamonds
  624.             WpointVal1 = 4
  625.  
  626.         ElseIf w1 = 18 Then
  627.  
  628.             warval1.BackgroundImage = My.Resources._5diamonds
  629.             WpointVal1 = 5
  630.  
  631.         ElseIf w1 = 19 Then
  632.  
  633.             warval1.BackgroundImage = My.Resources._6diamonds
  634.             WpointVal1 = 6
  635.  
  636.         ElseIf w1 = 20 Then
  637.  
  638.             warval1.BackgroundImage = My.Resources._7diamonds
  639.             WpointVal1 = 7
  640.  
  641.         ElseIf w1 = 21 Then
  642.  
  643.             warval1.BackgroundImage = My.Resources._8diamonds
  644.             WpointVal1 = 8
  645.  
  646.         ElseIf w1 = 22 Then
  647.  
  648.             warval1.BackgroundImage = My.Resources._9diamonds
  649.             WpointVal1 = 9
  650.  
  651.         ElseIf w1 = 23 Then
  652.  
  653.             warval1.BackgroundImage = My.Resources._10diamonds
  654.             WpointVal1 = 10
  655.  
  656.         ElseIf w1 = 24 Then
  657.  
  658.             warval1.BackgroundImage = My.Resources.jackdiamonds
  659.             WpointVal1 = 11
  660.  
  661.         ElseIf w1 = 25 Then
  662.  
  663.             warval1.BackgroundImage = My.Resources.queendiamonds
  664.             WpointVal1 = 12
  665.  
  666.         ElseIf w1 = 26 Then
  667.  
  668.             warval1.BackgroundImage = My.Resources.kingdiamonds
  669.             WpointVal1 = 13
  670.  
  671.         ElseIf w1 = 27 Then
  672.  
  673.             warval1.BackgroundImage = My.Resources.acehearts
  674.             WpointVal1 = 14
  675.  
  676.         ElseIf w1 = 28 Then
  677.  
  678.             warval1.BackgroundImage = My.Resources._2hearts
  679.             WpointVal1 = 2
  680.  
  681.         ElseIf w1 = 29 Then
  682.  
  683.             warval1.BackgroundImage = My.Resources._3hearts
  684.             WpointVal1 = 3
  685.  
  686.         ElseIf w1 = 30 Then
  687.  
  688.             warval1.BackgroundImage = My.Resources._4hearts
  689.             WpointVal1 = 4
  690.  
  691.         ElseIf w1 = 31 Then
  692.  
  693.             warval1.BackgroundImage = My.Resources._5hearts
  694.             WpointVal1 = 5
  695.  
  696.         ElseIf w1 = 32 Then
  697.  
  698.             warval1.BackgroundImage = My.Resources._6hearts
  699.             WpointVal1 = 6
  700.  
  701.         ElseIf w1 = 33 Then
  702.  
  703.             warval1.BackgroundImage = My.Resources._7hearts
  704.             WpointVal1 = 7
  705.  
  706.         ElseIf w1 = 34 Then
  707.  
  708.             warval1.BackgroundImage = My.Resources._8hearts
  709.             WpointVal1 = 8
  710.  
  711.         ElseIf w1 = 35 Then
  712.  
  713.             warval1.BackgroundImage = My.Resources._9hearts
  714.             WpointVal1 = 9
  715.  
  716.         ElseIf w1 = 36 Then
  717.  
  718.             warval1.BackgroundImage = My.Resources._10hearts
  719.             WpointVal1 = 10
  720.  
  721.         ElseIf w1 = 37 Then
  722.  
  723.             warval1.BackgroundImage = My.Resources.jackhearts
  724.             WpointVal1 = 11
  725.  
  726.         ElseIf w1 = 38 Then
  727.  
  728.             warval1.BackgroundImage = My.Resources.queenhearts
  729.             WpointVal1 = 12
  730.  
  731.         ElseIf w1 = 39 Then
  732.  
  733.             warval1.BackgroundImage = My.Resources.kinghearts
  734.             WpointVal1 = 13
  735.  
  736.         ElseIf w1 = 40 Then
  737.  
  738.             warval1.BackgroundImage = My.Resources.acespades
  739.             WpointVal1 = 14
  740.  
  741.         ElseIf w1 = 41 Then
  742.  
  743.             warval1.BackgroundImage = My.Resources._2spades
  744.             WpointVal1 = 2
  745.  
  746.         ElseIf w1 = 42 Then
  747.  
  748.             warval1.BackgroundImage = My.Resources._3spades
  749.             WpointVal1 = 3
  750.  
  751.         ElseIf w1 = 43 Then
  752.  
  753.             warval1.BackgroundImage = My.Resources._4spades
  754.             WpointVal1 = 4
  755.  
  756.         ElseIf w1 = 44 Then
  757.  
  758.             warval1.BackgroundImage = My.Resources._5spades
  759.             WpointVal1 = 5
  760.  
  761.         ElseIf w1 = 45 Then
  762.  
  763.             warval1.BackgroundImage = My.Resources._6spades
  764.             WpointVal1 = 6
  765.  
  766.         ElseIf w1 = 46 Then
  767.  
  768.             warval1.BackgroundImage = My.Resources._7spades
  769.             WpointVal1 = 7
  770.  
  771.         ElseIf w1 = 47 Then
  772.  
  773.             warval1.BackgroundImage = My.Resources._8spades
  774.             WpointVal1 = 8
  775.  
  776.         ElseIf w1 = 48 Then
  777.  
  778.             warval1.BackgroundImage = My.Resources._9spades
  779.             WpointVal1 = 9
  780.  
  781.         ElseIf w1 = 49 Then
  782.  
  783.             warval1.BackgroundImage = My.Resources._10spades
  784.             WpointVal1 = 10
  785.  
  786.         ElseIf w1 = 50 Then
  787.  
  788.             warval1.BackgroundImage = My.Resources.jackspades
  789.             WpointVal1 = 11
  790.  
  791.         ElseIf w1 = 51 Then
  792.  
  793.             warval1.BackgroundImage = My.Resources.queenspades
  794.             WpointVal1 = 12
  795.  
  796.         ElseIf w1 = 52 Then
  797.  
  798.             warval1.BackgroundImage = My.Resources.kingspades
  799.             WpointVal1 = 13
  800.  
  801.  
  802.         End If
  803.  
  804.         If w2 = 1 Then
  805.  
  806.             warval2.BackgroundImage = My.Resources.aceclubs
  807.             WpointVal2 = 14
  808.  
  809.         ElseIf w2 = 2 Then
  810.             warval2.BackgroundImage = My.Resources._2clubs
  811.             WpointVal2 = 2
  812.  
  813.         ElseIf w2 = 3 Then
  814.  
  815.             warval2.BackgroundImage = My.Resources._3clubs
  816.             WpointVal2 = 3
  817.  
  818.         ElseIf w2 = 4 Then
  819.  
  820.             warval2.BackgroundImage = My.Resources._4clubs
  821.             WpointVal2 = 4
  822.  
  823.         ElseIf w2 = 5 Then
  824.  
  825.             warval2.BackgroundImage = My.Resources._5clubs
  826.             WpointVal2 = 5
  827.  
  828.         ElseIf w2 = 6 Then
  829.  
  830.             warval2.BackgroundImage = My.Resources._6clubs
  831.             WpointVal2 = 6
  832.  
  833.         ElseIf w2 = 7 Then
  834.  
  835.             warval2.BackgroundImage = My.Resources._7clubs
  836.             WpointVal2 = 7
  837.  
  838.         ElseIf w2 = 8 Then
  839.  
  840.             warval2.BackgroundImage = My.Resources._8clubs
  841.             WpointVal2 = 8
  842.  
  843.         ElseIf w2 = 9 Then
  844.  
  845.             warval2.BackgroundImage = My.Resources._9clubs
  846.             WpointVal2 = 9
  847.  
  848.         ElseIf w2 = 10 Then
  849.  
  850.             warval2.BackgroundImage = My.Resources._10clubs
  851.             WpointVal2 = 10
  852.  
  853.         ElseIf w2 = 11 Then
  854.  
  855.             warval2.BackgroundImage = My.Resources.jackclubs
  856.             WpointVal2 = 11
  857.  
  858.         ElseIf w2 = 12 Then
  859.  
  860.             warval2.BackgroundImage = My.Resources.queenclubs
  861.             WpointVal2 = 12
  862.  
  863.         ElseIf w2 = 13 Then
  864.  
  865.             warval2.BackgroundImage = My.Resources.kingclubs
  866.             WpointVal2 = 13
  867.  
  868.         ElseIf w2 = 14 Then
  869.  
  870.             warval2.BackgroundImage = My.Resources.acediamonds
  871.             WpointVal2 = 14
  872.  
  873.         ElseIf w2 = 15 Then
  874.  
  875.             warval2.BackgroundImage = My.Resources._2diamonds
  876.             WpointVal2 = 12
  877.  
  878.         ElseIf w2 = 16 Then
  879.  
  880.             warval2.BackgroundImage = My.Resources._3diamonds
  881.             WpointVal2 = 3
  882.  
  883.         ElseIf w2 = 17 Then
  884.  
  885.             warval2.BackgroundImage = My.Resources._4diamonds
  886.             WpointVal2 = 4
  887.  
  888.         ElseIf w2 = 18 Then
  889.  
  890.             warval2.BackgroundImage = My.Resources._5diamonds
  891.             WpointVal2 = 5
  892.  
  893.         ElseIf w2 = 19 Then
  894.  
  895.             warval2.BackgroundImage = My.Resources._6diamonds
  896.             WpointVal2 = 6
  897.  
  898.         ElseIf w2 = 20 Then
  899.  
  900.             warval2.BackgroundImage = My.Resources._7diamonds
  901.             WpointVal2 = 7
  902.  
  903.         ElseIf w2 = 21 Then
  904.  
  905.             warval2.BackgroundImage = My.Resources._8diamonds
  906.             WpointVal2 = 8
  907.  
  908.         ElseIf w2 = 22 Then
  909.  
  910.             warval2.BackgroundImage = My.Resources._9diamonds
  911.             WpointVal2 = 9
  912.  
  913.         ElseIf w2 = 23 Then
  914.  
  915.             warval2.BackgroundImage = My.Resources._10diamonds
  916.             WpointVal2 = 10
  917.  
  918.         ElseIf w2 = 24 Then
  919.  
  920.             warval2.BackgroundImage = My.Resources.jackdiamonds
  921.             WpointVal2 = 11
  922.  
  923.         ElseIf w2 = 25 Then
  924.  
  925.             warval2.BackgroundImage = My.Resources.queendiamonds
  926.             WpointVal2 = 12
  927.  
  928.         ElseIf w2 = 26 Then
  929.  
  930.             warval2.BackgroundImage = My.Resources.kingdiamonds
  931.             WpointVal2 = 13
  932.  
  933.         ElseIf w2 = 27 Then
  934.  
  935.             warval2.BackgroundImage = My.Resources.acehearts
  936.             WpointVal2 = 14
  937.  
  938.         ElseIf w2 = 28 Then
  939.  
  940.             warval2.BackgroundImage = My.Resources._2hearts
  941.             WpointVal2 = 2
  942.  
  943.         ElseIf w2 = 29 Then
  944.  
  945.             warval2.BackgroundImage = My.Resources._3hearts
  946.             WpointVal2 = 3
  947.  
  948.         ElseIf w2 = 30 Then
  949.  
  950.             warval2.BackgroundImage = My.Resources._4hearts
  951.             WpointVal2 = 4
  952.  
  953.         ElseIf w2 = 31 Then
  954.  
  955.             warval2.BackgroundImage = My.Resources._5hearts
  956.             WpointVal2 = 5
  957.  
  958.         ElseIf w2 = 32 Then
  959.  
  960.             warval2.BackgroundImage = My.Resources._6hearts
  961.             WpointVal2 = 6
  962.  
  963.         ElseIf w2 = 33 Then
  964.  
  965.             warval2.BackgroundImage = My.Resources._7hearts
  966.             WpointVal2 = 7
  967.  
  968.         ElseIf w2 = 34 Then
  969.  
  970.             warval2.BackgroundImage = My.Resources._8hearts
  971.             WpointVal2 = 8
  972.  
  973.         ElseIf w2 = 35 Then
  974.  
  975.             warval2.BackgroundImage = My.Resources._9hearts
  976.             WpointVal2 = 9
  977.  
  978.         ElseIf w2 = 36 Then
  979.  
  980.             warval2.BackgroundImage = My.Resources._10hearts
  981.             WpointVal2 = 10
  982.  
  983.         ElseIf w2 = 37 Then
  984.  
  985.             warval2.BackgroundImage = My.Resources.jackhearts
  986.             WpointVal2 = 11
  987.  
  988.         ElseIf w2 = 38 Then
  989.  
  990.             warval2.BackgroundImage = My.Resources.queenhearts
  991.             WpointVal2 = 12
  992.  
  993.         ElseIf w2 = 39 Then
  994.  
  995.             warval2.BackgroundImage = My.Resources.kinghearts
  996.             WpointVal2 = 13
  997.  
  998.         ElseIf w2 = 40 Then
  999.  
  1000.             warval2.BackgroundImage = My.Resources.acespades
  1001.             WpointVal2 = 14
  1002.  
  1003.         ElseIf w2 = 41 Then
  1004.  
  1005.             warval2.BackgroundImage = My.Resources._2spades
  1006.             WpointVal2 = 2
  1007.  
  1008.         ElseIf w2 = 42 Then
  1009.  
  1010.             warval2.BackgroundImage = My.Resources._3spades
  1011.             WpointVal2 = 3
  1012.  
  1013.         ElseIf w2 = 43 Then
  1014.  
  1015.             warval2.BackgroundImage = My.Resources._4spades
  1016.             WpointVal2 = 4
  1017.  
  1018.         ElseIf w2 = 44 Then
  1019.  
  1020.             warval2.BackgroundImage = My.Resources._5spades
  1021.             WpointVal2 = 5
  1022.  
  1023.         ElseIf w2 = 45 Then
  1024.  
  1025.             warval2.BackgroundImage = My.Resources._6spades
  1026.             WpointVal2 = 6
  1027.  
  1028.         ElseIf w2 = 46 Then
  1029.  
  1030.             warval2.BackgroundImage = My.Resources._7spades
  1031.             WpointVal2 = 7
  1032.  
  1033.         ElseIf w2 = 47 Then
  1034.  
  1035.             warval2.BackgroundImage = My.Resources._8spades
  1036.             WpointVal2 = 8
  1037.  
  1038.         ElseIf w2 = 48 Then
  1039.  
  1040.             warval2.BackgroundImage = My.Resources._9spades
  1041.             WpointVal2 = 9
  1042.  
  1043.         ElseIf w2 = 49 Then
  1044.  
  1045.             warval2.BackgroundImage = My.Resources._10spades
  1046.             WpointVal2 = 10
  1047.  
  1048.         ElseIf w2 = 50 Then
  1049.  
  1050.             warval2.BackgroundImage = My.Resources.jackspades
  1051.             WpointVal2 = 11
  1052.  
  1053.         ElseIf w2 = 51 Then
  1054.  
  1055.             warval2.BackgroundImage = My.Resources.queenspades
  1056.             WpointVal2 = 12
  1057.  
  1058.         ElseIf w2 = 52 Then
  1059.  
  1060.             warval2.BackgroundImage = My.Resources.kingspades
  1061.             WpointVal2 = 13
  1062.  
  1063.  
  1064.         End If
  1065.  
  1066.  
  1067.  
  1068.         warval1.Visible = True
  1069.         warval2.Visible = True
  1070.  
  1071.  
  1072.         If WpointVal1 > WpointVal2 Then
  1073.             'need to code in here
  1074.            p1Score = p1Score + 10
  1075.  
  1076.  
  1077.         End If
  1078.  
  1079.  
  1080.         If WpointVal2 > WpointVal1 Then
  1081.             'need to code in here
  1082.            p2Score = p2Score + 10
  1083.  
  1084.         End If
  1085.  
  1086.         If WpointVal1 = WpointVal2 Then
  1087.  
  1088.             MessageBox.Show("Double war... I didnt code that.... RESTART!")
  1089.  
  1090.             Application.Restart()
  1091.  
  1092.         End If
  1093.  
  1094.  
  1095.  
  1096.         'need code to consider who wins/loses...
  1097.  
  1098.  
  1099.  
  1100.  
  1101.         'same scoring system as c1 and c2
  1102.        ' need anotehr button to toggle
  1103.        'make sure that wcoreing is updated and labeled
  1104.        ' check the conditions in c1 and w1 to ensure correctness
  1105.  
  1106.  
  1107.         Button1.Enabled = True
  1108.  
  1109.  
  1110.  
  1111.         'Update score here
  1112.        lblP1Val.Text = p1Score
  1113.         lblP2Val.Text = p2Score
  1114.  
  1115.  
  1116.         Button1.Enabled = True
  1117.         Button1.Visible = True
  1118.  
  1119.         btnWar.Visible = False
  1120.         btnWar.Enabled = False
  1121.  
  1122.  
  1123.  
  1124.         warcard1.Visible = False
  1125.         warcard2.Visible = False
  1126.         warcard3.Visible = False
  1127.         warcard4.Visible = False
  1128.         warcard5.Visible = False
  1129.         warcard6.Visible = False
  1130.  
  1131.  
  1132.  
  1133.         If p1Score >= 52 Then
  1134.             MessageBox.Show("Player 1 Wins!")
  1135.  
  1136.             Application.Restart()
  1137.  
  1138.  
  1139.         End If
  1140.  
  1141.         If p2Score >= 52 Then
  1142.             MessageBox.Show("Player 2 Wins!")
  1143.  
  1144.             Application.Restart()
  1145.  
  1146.  
  1147.         End If
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.         lblP1Val.Text = p1Score
  1156.         lblP2Val.Text = p2Score
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.     End Sub
  1172.  
  1173.     Private Sub Label4_Click(sender As Object, e As EventArgs) Handles lblP2Val.Click
  1174.  
  1175.     End Sub
  1176. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement