VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



8 Ball Type Fortune Teller

by Chapin Walton (1 Submission)
Category: Complete Applications
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (40 Votes)

Random call to find your Fortune. Like an 8 Ball. Contains a litte Easter Egg too, just for fun. This would look much nicer if you put an 8 Ball Graphic in
which I didn't do, sorry

Inputs
Ask a Question
Assumes
I assume you know what an 8 ball is. To use this add a command button textbox and label, after that have fun :)
Code Returns
a Random Answer
Side Effects
Insanity - Just like me :)

Rate 8 Ball Type Fortune Teller

Dim ans As Integer
Private Sub Command1_Click()
If Text1.Text = " " Or "Question_Goes_Here" Then
MsgBox "ah, ask a question first!", vbCritical, "ERROR!!!!"
' calls random Change the # 8 to get more varibles
' but don't forget to add them below
Else
ans = (Int(Rnd * 8) + 1)
'If you want diffrent answers put them in below
If ans = 1 Then
Label1.Caption = "Its not likely"
End If
If ans = 2 Then
Label1.Caption = "It looks possible"
End If
If ans = 3 Then
Label1.Caption = "Yes"
End If
If ans = 4 Then
Label1.Caption = "No"
End If
If ans = 5 Then
Label1.Caption = "Things are looking up"
End If
If ans = 6 Then
Label1.Caption = "Ask again later"
End If
If ans = 7 Then
Label1.Caption = "Only if you get me a brownie"
End If
If ans = 8 Then
Label1.Caption = "Certinally"
End If
End If
End Sub
Private Sub Form_DblClick()
MsgBox "MMM.... YOUR EYE TASTES LIKE CHEESE"
'EASTER EGG!!!! ALL PROGRAMS SHOULD HAVE THESE!!
End Sub
End Sub
Private Sub Form_Load()
Text1.Text = "Question_Goes_Here"
Command1.Caption = "Ask me..."
End Sub
Private Sub Text1_Click()
Text1.Text = " "
End Sub

Download this snippet    Add to My Saved Code

8 Ball Type Fortune Teller Comments

No comments have been posted about 8 Ball Type Fortune Teller. Why not be the first to post a comment about 8 Ball Type Fortune Teller.

Post your comment

Subject:
Message:
0/1000 characters