12
Answers

help required in rock,paper,scissors game development ?

SUNIL GUTTA

SUNIL GUTTA

11y
21.4k
1
Hi

Well i done all the coding in C# but finally there is  a case i need code in VB :( .. i am just familiar with only basics .. anyone help me with this requirement .. 

Create an application that lets the user play the game of "Rock, Paper, Scissors" against the computer. The program should work as follows:

1. The winner of the game is the one who has the won the most of three matches.
2. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, the computer has chosen scissors. (Don't display the computer's choice yet!)

3. The user clicks a button to select his or her choice of rock, paper, or
scissors.
4. The computers choice is displayed.
5. The winner is selected according to the following rules:
a. If one player chooses rock and the other player chooses scissors, then rock wins. (Rock smashes
scissors.)
b. If one player chooses scissors and the other player chooses paper, then scissors wins. (Scissors cuts paper.)
c. If one player chooses paper and the other player chooses rock, then paper wins. (Paper covers rock.)
d. If both players make the same choice, the game must be played again to determine the player.
6. Display the result of the match (in either a text box or dialog box).
7.Display the result of the game when 3 matches have been played (either in a message or a dialog box).
8.The game should have a "Play Again" button that resets the entire game.


Rock, Scissors, Paper Rubix

ItemPoints
GUI Appearance and tab order - 10
Loop 3 times - 15
Increment wins - 10
Random Function - 15
Nested IF or Switch Statement - 15
Click Event to Display Computer's Choice - 10
Message to display Winner of Match - 5
Message to display Winner of Game - 5
Reset Game - 15
Total - 100

Cheers & ty for help ..

Answers (12)
1
Vulpes

Vulpes

NA 98.3k 1.5m 11y
OK, I've altered it on those lines and tried to highlight the changes.

It's a very odd game though since if someone has won the first two matches you still have to play a third even though it won't affect the result!

' rock.vb

Imports System
Imports System.Windows.Forms
Imports System.ComponentModel


<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.btnRock = New System.Windows.Forms.Button()
        Me.btnPaper = New System.Windows.Forms.Button()
        Me.btnScissors = New System.Windows.Forms.Button()
        Me.btnPlayAgain = New System.Windows.Forms.Button()
        Me.lblComputerChoice = New System.Windows.Forms.Label()
        Me.SuspendLayout()
        '
        'btnRock
        '
        Me.btnRock.Location = New System.Drawing.Point(12, 75)
        Me.btnRock.Name = "btnRock"
        Me.btnRock.Size = New System.Drawing.Size(75, 23)
        Me.btnRock.TabIndex = 0
        Me.btnRock.Text = "Rock"
        Me.btnRock.UseVisualStyleBackColor = True
        '
        'btnPaper
        '
        Me.btnPaper.Location = New System.Drawing.Point(104, 75)
        Me.btnPaper.Name = "btnPaper"
        Me.btnPaper.Size = New System.Drawing.Size(75, 23)
        Me.btnPaper.TabIndex = 1
        Me.btnPaper.Text = "Paper"
        Me.btnPaper.UseVisualStyleBackColor = True
        '
        'btnScissors
        '
        Me.btnScissors.Location = New System.Drawing.Point(197, 75)
        Me.btnScissors.Name = "btnScissors"
        Me.btnScissors.Size = New System.Drawing.Size(75, 23)
        Me.btnScissors.TabIndex = 2
        Me.btnScissors.Text = "Scissors"
        Me.btnScissors.UseVisualStyleBackColor = True
        '
        'btnPlayAgain
        '
        Me.btnPlayAgain.Location = New System.Drawing.Point(104, 152)
        Me.btnPlayAgain.Name = "btnPlayAgain"
        Me.btnPlayAgain.Size = New System.Drawing.Size(75, 23)
        Me.btnPlayAgain.TabIndex = 3
        Me.btnPlayAgain.Text = "Play Again"
        Me.btnPlayAgain.UseVisualStyleBackColor = True
        '
        'lblComputerChoice
        '
        Me.lblComputerChoice.AutoSize = True
        Me.lblComputerChoice.Location = New System.Drawing.Point(79, 21)
        Me.lblComputerChoice.Name = "lblComputerChoice"
        Me.lblComputerChoice.Size = New System.Drawing.Size(0, 13)
        Me.lblComputerChoice.TabIndex = 4
        '
        'Form1
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(284, 262)
        Me.Controls.Add(Me.lblComputerChoice)
        Me.Controls.Add(Me.btnPlayAgain)
        Me.Controls.Add(Me.btnScissors)
        Me.Controls.Add(Me.btnPaper)
        Me.Controls.Add(Me.btnRock)
        Me.Name = "Form1"
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub
    Friend WithEvents btnRock As System.Windows.Forms.Button
    Friend WithEvents btnPaper As System.Windows.Forms.Button
    Friend WithEvents btnScissors As System.Windows.Forms.Button
    Friend WithEvents btnPlayAgain As System.Windows.Forms.Button
    Friend WithEvents lblComputerChoice As System.Windows.Forms.Label
    
End Class

Public Class Form1
    Inherits Form

    Private rand As New Random
    Private names As String() = {"Rock", "Paper", "Scissors"}
    Private reasons As String() = {"Rock smashes scissors", "Paper covers rock", "Scissors cuts paper"}
    Private userScore As Integer = 0
    Private computerScore As Integer = 0
    Private numMatches As Integer = 0 

    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        btnPlayAgain.Enabled = False
    End Sub

    Private Function GetComputerChoice() As Integer
        Dim choice As Integer = rand.Next(1, 4)
        lblComputerChoice.Text = "Computer chose " & names(choice - 1)
        Return choice
    End Function

    Private Sub PlayAgain()        
        MessageBox.Show("Your choice was the same as the computer's." & vbCrLf & vbCrLf & "So match tied!")
        If numMatches = 3 Then
            ShowGameResult()
            DisableButtons() 
        End If
        lblComputerChoice.Text = ""
    End Sub

    Private Sub ComputerWins(ByVal reason As Integer)
        MessageBox.Show(reasons(reason) & vbCrLf & vbCrLf & "The COMPUTER has won this match!")
        computerScore += 1
        If numMatches = 3 Then 
            ShowGameResult() 
            DisableButtons()
        End If
        lblComputerChoice.Text = ""
    End Sub

    Private Sub UserWins(ByVal reason As Integer)
        MessageBox.Show(reasons(reason) & vbCrLf & vbCrLf & "The USER has won this match!")
        userScore += 1
        If numMatches = 3 Then 
            ShowGameResult() 
            DisableButtons()
        End If
        lblComputerChoice.Text = ""
    End Sub

    Private Sub DisableButtons()
        btnRock.Enabled = False
        btnPaper.Enabled = False
        btnScissors.Enabled = False
        btnPlayAgain.Enabled = True
    End Sub

    Private Sub ShowGameResult() 
        Dim msg As String = Nothing
        If userScore = 3 Then
           msg = "The USER has won the game, 3 matches to 0!"
        ElseIf computerScore = 3 Then
           msg = "The COMPUTER has won the game, 3 matches to 0!"
        ElseIf userScore = 2 AndAlso computerScore = 1 Then
           msg = "The USER has won the game, 2 matches to 1!"
        ElseIf userScore = 1 AndAlso computerScore = 2 Then
           msg = "The COMPUTER has won the game, 2 matches to 1!"
        ElseIf userScore = 2 AndAlso computerScore = 0 Then
           msg = "The USER has won the game, 2 matches to 0 with 1 tie!"
        ElseIf userScore = 0 AndAlso computerScore = 2 Then
           msg = "The COMPUTER has won the game, 2 matches to 0 with 1 tie!"
        ElseIf userScore = 1 AndAlso computerScore = 1 Then
           msg = "The game is tied, 1 match each with 1 tie!"
        ElseIf userScore = 1 AndAlso computerScore = 0 Then
           msg = "The USER has won the game, 1 match to 0 with 2 ties!"
        ElseIf userScore = 0 AndAlso computerScore = 1 Then
           msg = "The COMPUTER has won the game, 1 match to 0 with 2 ties!"
        ElseIf userScore = 0 AndAlso computerScore = 0 Then
           msg = "The game is tied, 0 matches each with 3 ties!"
        End If
        MessageBox.Show(msg)
    End Sub

    Private Sub btnRock_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRock.Click

        Dim computerChoice As Integer = GetComputerChoice()
        numMatches += 1 
        Select Case computerChoice
            Case 1
                PlayAgain()
            Case 2
                ComputerWins(1)
            Case 3
                UserWins(0)
        End Select

    End Sub


    Private Sub btnPaper_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPaper.Click

        Dim computerChoice As Integer = GetComputerChoice()
        numMatches += 1 
        Select Case computerChoice
            Case 1
                UserWins(1)
            Case 2
                PlayAgain()
            Case 3
                ComputerWins(2)
        End Select

    End Sub

    Private Sub btnScissors_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnScissors.Click

        Dim computerChoice As Integer = GetComputerChoice()
        numMatches += 1 
        Select Case computerChoice
            Case 1
                ComputerWins(0)
            Case 2
                UserWins(2)
            Case 3
                PlayAgain()
        End Select

    End Sub


    Private Sub btnPlayAgain_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlayAgain.Click
        btnRock.Enabled = True
        btnPaper.Enabled = True
        btnScissors.Enabled = True
        userScore = 0
        computerScore = 0
        numMatches = 0 
        btnPlayAgain.Enabled = False
    End Sub

    Protected Overrides Sub Finalize()
        MyBase.Finalize()
    End Sub

    <STAThread> _
    Shared Sub Main()
   
        Application.EnableVisualStyles()
        Application.SetCompatibleTextRenderingDefault(False)
        Application.Run(New Form1())

    End Sub

End Class


Accepted
10
Vulpes

Vulpes

NA 98.3k 1.5m 11y
Try this:

Public Class Form1

    Private rand As New Random
    Private names As String() = {"Rock", "Paper", "Scissors"}
    Private reasons As String() = {"Rock smashes scissors", "Paper covers rock", "Scissors cuts paper"}
    Private userScore As Integer = 0
    Private computerScore As Integer = 0

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        btnPlayAgain.Enabled = False
    End Sub

    Private Function GetComputerChoice() As Integer
        Dim choice As Integer = rand.Next(1, 4)
        lblComputerChoice.Text = "Computer chose " & names(choice - 1)
        Return choice
    End Function

    Private Sub PlayAgain()
        MessageBox.Show("Your choice was the same as the computer's." & vbCrLf & "Please play again")
        lblComputerChoice.Text = ""
    End Sub

    Private Sub ComputerWins(ByVal reason As Integer)
        MessageBox.Show(reasons(reason) & vbCrLf & vbCrLf & "The COMPUTER has won this match!")
        computerScore += 1
        If computerScore = 3 Then
            MessageBox.Show("The COMPUTER has won the game!!")
            DisableButtons()
        End If
        lblComputerChoice.Text = ""
    End Sub

    Private Sub UserWins(ByVal reason As Integer)
        MessageBox.Show(reasons(reason) & vbCrLf & vbCrLf & "The USER has won this match!")
        userScore += 1
        If userScore = 3 Then
            MessageBox.Show("The USER has won the game!!")
            DisableButtons()
        End If
        lblComputerChoice.Text = ""
    End Sub

    Private Sub DisableButtons()
        btnRock.Enabled = False
        btnPaper.Enabled = False
        btnScissors.Enabled = False
        btnPlayAgain.Enabled = True
    End Sub

    Private Sub btnRock_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRock.Click

        Dim computerChoice As Integer = GetComputerChoice()
        Select Case computerChoice
            Case 1
                PlayAgain()
            Case 2
                ComputerWins(1)
            Case 3
                UserWins(0)
        End Select

    End Sub

    Private Sub btnPaper_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPaper.Click

        Dim computerChoice As Integer = GetComputerChoice()
        Select Case computerChoice
            Case 1
                UserWins(1)
            Case 2
                PlayAgain()
            Case 3
                ComputerWins(2)
        End Select

    End Sub

    Private Sub btnScissors_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnScissors.Click

        Dim computerChoice As Integer = GetComputerChoice()
        Select Case computerChoice
            Case 1
                ComputerWins(0)
            Case 2
                UserWins(2)
            Case 3
                PlayAgain()
        End Select

    End Sub

    Private Sub btnPlayAgain_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlayAgain.Click
        btnRock.Enabled = True
        btnPaper.Enabled = True
        btnScissors.Enabled = True
        userScore = 0
        computerScore = 0
        btnPlayAgain.Enabled = False
    End Sub

End Class
5
Vulpes

Vulpes

NA 98.3k 1.5m 11y
You will get errors if you try to compile the above code using either the command line or an online compiler because, in a VB.NET windows forms application, VS 2010 hides the designed generated code and auto-generates the Main method!

Also, the project file will be of no use to you outside the VS environment.

I've therefore prepared a special version (rock.vb) which includes the hidden code and also a Main() method.

This should compile OK from the command line by simply typing:

vbc rock.vb

Anyway here's the code:

' rock.vb

Imports System
Imports System.Windows.Forms
Imports System.ComponentModel


<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.btnRock = New System.Windows.Forms.Button()
        Me.btnPaper = New System.Windows.Forms.Button()
        Me.btnScissors = New System.Windows.Forms.Button()
        Me.btnPlayAgain = New System.Windows.Forms.Button()
        Me.lblComputerChoice = New System.Windows.Forms.Label()
        Me.SuspendLayout()
        '
        'btnRock
        '
        Me.btnRock.Location = New System.Drawing.Point(12, 75)
        Me.btnRock.Name = "btnRock"
        Me.btnRock.Size = New System.Drawing.Size(75, 23)
        Me.btnRock.TabIndex = 0
        Me.btnRock.Text = "Rock"
        Me.btnRock.UseVisualStyleBackColor = True
        '
        'btnPaper
        '
        Me.btnPaper.Location = New System.Drawing.Point(104, 75)
        Me.btnPaper.Name = "btnPaper"
        Me.btnPaper.Size = New System.Drawing.Size(75, 23)
        Me.btnPaper.TabIndex = 1
        Me.btnPaper.Text = "Paper"
        Me.btnPaper.UseVisualStyleBackColor = True
        '
        'btnScissors
        '
        Me.btnScissors.Location = New System.Drawing.Point(197, 75)
        Me.btnScissors.Name = "btnScissors"
        Me.btnScissors.Size = New System.Drawing.Size(75, 23)
        Me.btnScissors.TabIndex = 2
        Me.btnScissors.Text = "Scissors"
        Me.btnScissors.UseVisualStyleBackColor = True
        '
        'btnPlayAgain
        '
        Me.btnPlayAgain.Location = New System.Drawing.Point(104, 152)
        Me.btnPlayAgain.Name = "btnPlayAgain"
        Me.btnPlayAgain.Size = New System.Drawing.Size(75, 23)
        Me.btnPlayAgain.TabIndex = 3
        Me.btnPlayAgain.Text = "Play Again"
        Me.btnPlayAgain.UseVisualStyleBackColor = True
        '
        'lblComputerChoice
        '
        Me.lblComputerChoice.AutoSize = True
        Me.lblComputerChoice.Location = New System.Drawing.Point(79, 21)
        Me.lblComputerChoice.Name = "lblComputerChoice"
        Me.lblComputerChoice.Size = New System.Drawing.Size(0, 13)
        Me.lblComputerChoice.TabIndex = 4
        '
        'Form1
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(284, 262)
        Me.Controls.Add(Me.lblComputerChoice)
        Me.Controls.Add(Me.btnPlayAgain)
        Me.Controls.Add(Me.btnScissors)
        Me.Controls.Add(Me.btnPaper)
        Me.Controls.Add(Me.btnRock)
        Me.Name = "Form1"
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub
    Friend WithEvents btnRock As System.Windows.Forms.Button
    Friend WithEvents btnPaper As System.Windows.Forms.Button
    Friend WithEvents btnScissors As System.Windows.Forms.Button
    Friend WithEvents btnPlayAgain As System.Windows.Forms.Button
    Friend WithEvents lblComputerChoice As System.Windows.Forms.Label
    
End Class

Public Class Form1
    Inherits Form

    Private rand As New Random
    Private names As String() = {"Rock", "Paper", "Scissors"}
    Private reasons As String() = {"Rock smashes scissors", "Paper covers rock", "Scissors cuts paper"}
    Private userScore As Integer = 0
    Private computerScore As Integer = 0

    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        btnPlayAgain.Enabled = False
    End Sub

    Private Function GetComputerChoice() As Integer
        Dim choice As Integer = rand.Next(1, 4)
        lblComputerChoice.Text = "Computer chose " & names(choice - 1)
        Return choice
    End Function

    Private Sub PlayAgain()
        MessageBox.Show("Your choice was the same as the computer's." & vbCrLf & "Please play again")
        lblComputerChoice.Text = ""
    End Sub

    Private Sub ComputerWins(ByVal reason As Integer)
        MessageBox.Show(reasons(reason) & vbCrLf & vbCrLf & "The COMPUTER has won this match!")
        computerScore += 1
        If computerScore = 3 Then
            MessageBox.Show("The COMPUTER has won the game!!")
            DisableButtons()
        End If
        lblComputerChoice.Text = ""
    End Sub

    Private Sub UserWins(ByVal reason As Integer)
        MessageBox.Show(reasons(reason) & vbCrLf & vbCrLf & "The USER has won this match!")
        userScore += 1
        If userScore = 3 Then
            MessageBox.Show("The USER has won the game!!")
            DisableButtons()
        End If
        lblComputerChoice.Text = ""
    End Sub

    Private Sub DisableButtons()
        btnRock.Enabled = False
        btnPaper.Enabled = False
        btnScissors.Enabled = False
        btnPlayAgain.Enabled = True
    End Sub

    Private Sub btnRock_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRock.Click

        Dim computerChoice As Integer = GetComputerChoice()
        Select Case computerChoice
            Case 1
                PlayAgain()
            Case 2
                ComputerWins(1)
            Case 3
                UserWins(0)
        End Select

    End Sub


    Private Sub btnPaper_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPaper.Click

        Dim computerChoice As Integer = GetComputerChoice()
        Select Case computerChoice
            Case 1
                UserWins(1)
            Case 2
                PlayAgain()
            Case 3
                ComputerWins(2)
        End Select

    End Sub

    Private Sub btnScissors_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnScissors.Click

        Dim computerChoice As Integer = GetComputerChoice()
        Select Case computerChoice
            Case 1
                ComputerWins(0)
            Case 2
                UserWins(2)
            Case 3
                PlayAgain()
        End Select

    End Sub


    Private Sub btnPlayAgain_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlayAgain.Click
        btnRock.Enabled = True
        btnPaper.Enabled = True
        btnScissors.Enabled = True
        userScore = 0
        computerScore = 0
        btnPlayAgain.Enabled = False
    End Sub

    Protected Overrides Sub Finalize()
        MyBase.Finalize()
    End Sub

    <STAThread> _
    Shared Sub Main()
   
        Application.EnableVisualStyles()
        Application.SetCompatibleTextRenderingDefault(False)
        Application.Run(New Form1())

    End Sub

End Class


0
SUNIL GUTTA

SUNIL GUTTA

NA 1.1k 285.8k 11y
Humm just check ur post let me check it completely . just in case issues i will get back :) 

Just a glace at ur new code looks confident .. i believe no issues will be there 

Ty 

It's a very odd game though since if someone has won the first two matches you still have to play a third even though it won't affect the result!

Yes i completely agree with you .. 

Cheers
have a nice day 
0
Vulpes

Vulpes

NA 98.3k 1.5m 11y
Yep, I'm here now :)

Is there a problem with my latest code?
0
SUNIL GUTTA

SUNIL GUTTA

NA 1.1k 285.8k 11y
Vulpes mate ?? are u there ? ? ? ? 
0
SUNIL GUTTA

SUNIL GUTTA

NA 1.1k 285.8k 11y
Small modification required //

Here is what happened when i checked your code: The game keeps on going until user or computer scores 3. That can be 3 match or 4 or 5.

What I want is, the result of the game must be displayed right after 3 matches are played. It doesn't matter if user or computer wins by 3-0 or 2-1 or 2-0 and 1 tie, or 1-0 and 2 ties. if it is a tie by 1-1 and 1 tie, 0-0 and 3 ties. GAME result must be displayed right when 3 matches are done.

Cheers ty mate 
Have a nice day :) 
0
SUNIL GUTTA

SUNIL GUTTA

NA 1.1k 285.8k 11y
yeah thanks output :) came looks cool .. ty for support .. ty 
0
Vulpes

Vulpes

NA 98.3k 1.5m 11y
The only output is the label text - to show the computer's choice - and the message box - to show the result of the match and (eventually) who's won the game.

This is all the question asked for but there's nothing to stop you making the UI more interesting by showing running scores, using coloured buttons etc. though you may not get any marks for doing so :)
0
SUNIL GUTTA

SUNIL GUTTA

NA 1.1k 285.8k 11y
Awesome .. ty for your extended efforts .. .. 

code now executed with no errors anything .. but i couldn't find any o/p .. appearing blank ? 
any guesses problem with my software or system  ?

0
SUNIL GUTTA

SUNIL GUTTA

NA 1.1k 285.8k 11y
trying to compile using vs command prompt .. still no use .. 

just saved ur code in a notepad file & named as rock.vb  later i using command prompt
i typed

vbc.exe rock and enter ... i am getting errors ..


rock.vb ... file name 

am i doing something wrong ..
0
SUNIL GUTTA

SUNIL GUTTA

NA 1.1k 285.8k 11y
Well dam its so sudden .. my vs 2010 stuck .. 

so , i am trying to run the code you given online .. i am getting too many compile time errors ..
May be problem some were with online compilers .

Can you just attach the project file . . else two or three screenshots of o/p form ..

Will cross verify ..

Ty mate ..