Visual Basic Project: Simple Slot Machine

Sdílet
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

Komentáře • 18

  • @Playlist-zh7zi
    @Playlist-zh7zi Před rokem

    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 ..

  • @pdesignsconsult2144
    @pdesignsconsult2144 Před rokem +1

    thank you for this video. Its 2022 and I have had fun learning with you

  • @stellavu3578
    @stellavu3578 Před 3 lety +1

    This video was great! Thank you!

  • @alagappanthalapathy5593
    @alagappanthalapathy5593 Před 5 lety +1

    Thank you so much u done a amazing job

  • @dhanaraj5195
    @dhanaraj5195 Před 4 lety +4

    Error conversion from string label5 to type double not valid how to solve this

    • @RSathsskks
      @RSathsskks Před 3 lety +1

      that's because the variable string cannot be converted in double. so, don't concatenate two strings and just add another label

  • @JesterSantos
    @JesterSantos Před 4 lety +1

    How to have pictures instead of numbers ?

  • @adamkarlsson6815
    @adamkarlsson6815 Před 4 lety +4

    Hey :)
    Could you write a Console application slot machine 3 random charachters if they are the same then you win using methods on C#

  • @jacksonnsashe2150
    @jacksonnsashe2150 Před 6 měsíci

    Hey man this is 🎉🎉🎉🎉

  • @cheyanneashe9926
    @cheyanneashe9926 Před 7 lety +1

    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

    • @quickcode1245
      @quickcode1245  Před 7 lety

      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

    • @mrndreams_
      @mrndreams_ Před 4 lety

      You did use windows forms right?

  • @PikendraKurre
    @PikendraKurre Před měsícem

    Bhai iska documentation mil jayega kya abhi 1 .2 dino me

  • @theFAMOUSfile
    @theFAMOUSfile Před 3 lety

    error pls help

  • @rafaelportugal5261
    @rafaelportugal5261 Před 3 lety

    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

  • @shrimpjesus9915
    @shrimpjesus9915 Před 7 lety +1

    wow, sad, just a truly bad video

  • @teacherleoyoutubechannel.com_5

    Thank you for this video..