Advertisement
Guest User

okeefej code stuff

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