Visual Basic Project: Simple Slot Machine
Vložit
- čas přidán 25. 06. 2016
- Welcome! This is the second video in a series of Visual Basic projects!
In this video, I will be creating a very simple slot machine. The code will be posted below, and feel free to edit it for your own projects.
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Label1.Text = Int(3 * Rnd() + 1)
Label2.Text = Int(3 * Rnd() + 1)
Label3.Text = Int(3 * Rnd() + 1)
Label5.Text = Label5.Text - 1
If Label1.Text = Label2.Text And Label1.Text = Label3.Text Then
MsgBox("YOU WIN 1 COIN")
Label5.Text = Label5.Text + 1
End If
If Label5.Text = 0 Then
MsgBox("OUT OF COINS")
Button1.Enabled = False
End If
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Randomize()
Label5.Text = 10
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Label1.Text = ""
Label2.Text = ""
Label3.Text = ""
Button1.Enabled = True
Label5.Text = 10
End Sub
End Class - Věda a technologie
ganito gusto ko. bihira lang ako mag comment. peru.. thnak you. kasi.. sobrang na aapreciate ko yung ginawa mo.. more videos pa.. suportahan ka namin.. maganda kasi, may codes at may running adad. . god bless ..
thank you for this video. Its 2022 and I have had fun learning with you
This video was great! Thank you!
Thank you so much u done a amazing job
Error conversion from string label5 to type double not valid how to solve this
that's because the variable string cannot be converted in double. so, don't concatenate two strings and just add another label
How to have pictures instead of numbers ?
Hey :)
Could you write a Console application slot machine 3 random charachters if they are the same then you win using methods on C#
Hey man this is 🎉🎉🎉🎉
Do you know how to do this easily on the new Visual Studio 2017? The "Int" and "Rnd" seem to not be recognized through the new system. I am trying to make a very simple slot machine for a class project.
Thanks!
Cheyanne
Cheyanne Ashe Hello, sorry to get back to you so late. I do not have any experience with Visual Studio 2017, so the most I can do is to tell you to make sure that you are in a Visual Basic project, and not a project in another language such as C#. If this has not been of any use, there is a wealth of information on the Internet for Visual Basic 2017 such as vbtutor.net.
Best regards
You did use windows forms right?
Bhai iska documentation mil jayega kya abhi 1 .2 dino me
error pls help
Repent ye: "For the wages of sin is death; but the gift of God is eternal life through Jesus Christ our Lord." Romans 6:23
Jesus Christ loves you: "For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life." John 3:16
Read Revelation 18
"And saying, The time is fulfilled, and the kingdom of God is at hand: repent ye, and believe the gospel." Mark 1:15
"Better is a dry morsel, and quietness therewith, than an house full of sacrifices with strife." Proverbs 17:1
Read Jeremiah 47
Read Luke 18:1-8
Read Luke 21:1-4
Read Zephaniah 3:8-17
"Mortify therefore your members which are upon the earth; fornication, uncleanness, inordinate affection, evil concupiscence, and covetousness, which is idolatry:" Colossians 3:5
"Now concerning the things whereof ye wrote unto me: It is good for a man not to touch a woman."I Corinthians 7:1
"Nevertheless, to avoid fornication, let every man have his own wife, and let every woman have her own husband."I Corinthians 7:2
Read Revelation Chapter 2 and 3
wow, sad, just a truly bad video
Thank you for this video..