Top

8ball in Visual basic


.NET Code
+ 1 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  Oct 17, 2009
Last Updated  Oct 18, 2009
Tags  2008  8ball  basic  visual 

Introduction

Download visual basic 2008 and paste it in and run it.

I don't know which was easier to make. The python 8ball or the VB one. I think it's the VB one since I hadn't done any python before.



Grab the Code

Module Module1
    Sub Main()
        Dim x As Integer, rand As New Random, a As Integer, b As String
        x = 1
        Do While x
            Console.WriteLine("Enter a question here!")
            b = Console.ReadLine()
            a = rand.Next(1, 5)
            If b = "exit" Then
                Exit Do
            End If
            Select Case a
                Case 1
                    Console.WriteLine("The answer is in your heart")
                Case 2
                    Console.WriteLine("The answer is no")
                Case 3
                    Console.WriteLine("The answer is yes")
                Case 4
                    Console.WriteLine("Go away and ask me later")
            End Select
        Loop
    End Sub
End Module

Comments

  (10)  RSS
`Green
Comments: 34
 
.NET Snippet:  8ball in Visual basic
Posted on Oct 18, 2009 10:46 am
uh looks good. but idk how this whole new VB scripting is supposed to work because you would have to match all the buttons and textboxes and names and stuff to what the script says. and also you missed the r in answer from "The amswer is yes"
Lord-Harlot
Comments: 60
 
.NET Snippet:  8ball in Visual basic
Posted on Oct 18, 2009 3:21 pm
This is just a basic console app. No GUI
`Green
Comments: 34
 
.NET Snippet:  8ball in Visual basic
Posted on Oct 18, 2009 3:32 pm
well yeah i know this one is. but im saying that if i wanted to post a code for a "Form" wouldnt i have to do all of that?
Lord-Harlot
Comments: 60
 
.NET Snippet:  8ball in Visual basic
Posted on Oct 18, 2009 3:41 pm
I have no idea. I guess you would have to find the source code for the form as well.
`Green
Comments: 34
 
.NET Snippet:  8ball in Visual basic
Posted on Oct 18, 2009 4:05 pm
yeah that would be easier lol. and im kinda new to VB08 coding. are you good or no?
Lord-Harlot
Comments: 60
 
.NET Snippet:  8ball in Visual basic
Posted on Oct 18, 2009 4:15 pm
I've just started it
doing it in college but only 1 unit of it.
PePpEr
Comments: 17
 
.NET Snippet:  8ball in Visual basic
Posted on Oct 19, 2009 4:27 pm
nice :-)
i like that you didnt use random sayings like all the other's
mountaindew
Comments: 1,826
 
.NET Snippet:  8ball in Visual basic
Posted on Oct 19, 2009 5:00 pm
You can just do Do...Loop, no real need for the x var.
Blogger
Comments: 5
 
.NET Snippet:  8ball in Visual basic
Posted on Oct 19, 2009 10:50 pm
Hello PePpEr --> U on BhasIrc nah..... See you in here...

I can't make Snipest,any1 can help me.........

lol
jonesy44
Comments: 1,856
 
.NET Snippet:  8ball in Visual basic
Posted on Oct 22, 2009 5:55 pm
There is a source code for the GUI, when you open the project, select the Form1 source from the Solution explorer and the options are around there, however im not sure if you can paste a new one in etc, i've stuck to posting console apps only.

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom