thank you very much for the person who made this code. it helps me a lot for my final project. really don't know what to do, if you didn't made this. thank you very very much
@MrBejta There is No straight function in VB to find Percentage. Try this : Dim Amt, P, R, T, I as Double P = val(Textbox1.Text) R = val(Textbox2.Text) T = val(Textbox3.Text) I = (P*R)/100 *T Amt = P + I Label1.Text = “Interest :” & I Label2.Text = “Total :” & Amt
me podrias decir el nombre de la cancion ? jejeje tocar guitarra es mi otra pasion aparte de programar :D buenisimo tuto por cierto va para mis favoritos!
@MrBejta Eg: 15 % on 1500 € for 2 year Formula for Simple Interest = Principal × Rate × Time P = 1500 R = 15 T = 2 Interest = ((P * R)/100) *T Total = P + Interest
Actually instead of creating separate Subs for each Button, you can just use the AddHandler statement at the startup of the Form. I mean like using a For loop to go through each Control in the Controls property of the form, then checking whether it's a Button, then using the AddHandler statement like this: AddHandler CurrentControl.Click ActionSub And ActionSub is a Sub with "sender As Object" and "e as EventArgs" as parameters. Then in the ActionSub, you can check the sender's surrounding... wait now that's a problem. Or use the TableLayoutPanel control. It's easier.
That's right, it would be better to just select all the buttons, go to the event section in properties, and click on the onclick event twice, and use a sender statement in a select case situation to check the buttons, like case button1.text, checkbutton 2, 5, etc. If you want to check the sender's surrounding, you have to know where the empty button (the button that does not contain the text) is, and you may need to use the empty button location, and check the clicked button location + the size of it, and if there are gaps between one button and the next, you need to add the gap number as well (not too sure if I am right or not), I don't know how to make the program work like this.
Hola Itsaji, tengo un problema en la subrutina para mostrar los botones al azar, en la sentencia: RN = CInt(Int((15 * Rdn()) + 1)), no he logrado comprender dónde está declarado Rdn, ojalá pudieras ayudarme. Saludos.
Well if you do the counting with a label like me ... and a shuffle button then just type that into the shuffle button: Label1.text = "" Form1.count = 0
Hey I made the game, but when I click the play button it says "There were build errors. Would you like to continue and run the last successful build?" ...Can anyone help me with that??
Look at the code I posted, you need to make sure flag = true and flag = false are in the correct place, and you should see no repeats.. Besides, here is another way to random, and this should work (you need to use at least VB 2017 or else it may not work) Dim Random as New Random Dim Numbers = Enumerable.Range(1, 15).ToList For I = 1 to 15 If Numbers.Count = 0 Then Exit For Dim index = Random.Next(Numbers.Count) Controls("Button" & i).Text = Numbers(index) Numbers.RemoveAt(index) Next Button16.text = ""
Made some changes to this so count won't count if there's not an empty button next to it and it won't count if you're clicking on an empty box. added a reset to count in shuffle aswell. you can find the code for that here pastebin dot com/0sz7EThf
Nice video but it would have been better had you either added comments to the code to explain what you were doing or added a voice track instead of music. The most critical point in the code was the shuffle and yet it was the part with the littlest amount of time on it. I had to stop the video and copy what you had done. See my code below Sub Shuffle() Dim a(15), i, j, RN As Integer Dim flag As Boolean flag = False i = 1 a(j) = 1 Do While i 14 Then Exit For 'exit here as we will have apiiled the text to buttons 0 to 14 ctrl.Text = a(i) i += 1 End If Next 'set the bottom right button (16th Tile) to no text Form1.Button16.Text = "" End Sub I reset the Click counter at the bottom of the CheckSolved sub in the if statement that checked if the puzzle had been solved.
Just use this code under loop in the shuffle event, it will work (I've tested it). For I = 1 to 15 controls("Button" & i).text = a(i) Next Button16.text = "" If the random code is done in a Module, use the following code instead (though it is similar to the previous one) Form1.controls("Button" & i).text = a(i) Next Form1.Button16.text = ""
The buttons don't move, just the number moving into the button that has nothing when you click on a button that has a number and is adjacent to (next to) the button that has nothing
Further to my previous comment, the following code will make a message box appear when the user clicks shuffle after the game is already started. Private Sub tsShuffle_Click(sender As Object, e As EventArgs) Handles tsShuffle.Click If finished = True Then Shuffle() If start = False Then Shuffle() If start = True Then If vbYes = MsgBox("This puzzle is in progress." + Environment.NewLine + "Are you sure you want to shuffle?", MsgBoxStyle.YesNo, "Puzzle is in progress") Then Shuffle() Else End If End If End Sub
No shuffle games are unsolvable, it is just the way you solve it can make it harder to solve in the end. The point is to get the number 1 to 8 first, then get 9 and 13 into the right place, and then get 10 and 14 into the right place, and the rest should be quite straightforward. Also, it would be a good idea to put the number you are going to move behind the number that is 1 number greater than it, for example, if you want to solve 3, put 4 on top, 3 on the bottom of 4, this way, when you move 4 into the place where 3 is supposed to be, and then move 4 to the right, then you will be able to insert 3 into where it is supposed to be. I once found that shuffle game was not easy to solve, but it turns out to be very easy as soon as I watched videos on how to solve slider puzzles. You may want to check out how to solve number shuffle puzzle game on youtube for more details.
The above solution may sometimes cause you to stuck, but you could try and figure out a fix for that. Again, search for guides on how to solve number shuffle puzzle game for solutions.
After investigating this further, I found that there are indeed unsolvable puzzles in this case, maybe there need to be a code to deal with the parity issues.
While I don't have any way to make the game always solvable every time it resets, there is a way around it. When the movecount (or clicks) reaches a certain number there will be a message box warning you saying that the game may not be solvable, and ask you if you want to reset the game or not. In the checkbutton subroutine, under movecount += 1, or click +=1 (depends on what you use), put this code in. If movecount = 200 or movecount = 250 then if vbyes = msgbox("There is a chance that this puzzle is unsolvable, do you want to reset the puzzle?", vbYesNo, "Possibly Unsolvable") then shuffle() Else End if End if
there's a error in my program, it says that "HAndles Clause requires a WithEvents variable defined in the containing type or one of its base types Help me Please!
Further to my comment below I found a bug in my code below is the revised code Dim a(15), i, j, RN As Integer Dim flag As Boolean flag = False i = 0 a(j) = 0 Do While i
one of the best tutorial out there!
What a music! very pleasing
Nice tut
Thank you for all info i finish my program now :) Im so thankful those people giving me information :)
thank you very much for the person who made this code. it helps me a lot for my final project. really don't know what to do, if you didn't made this. thank you very very much
Thank you so much for this amazing video.
It's a really easy tutorial and I didn't feel any difficulty/error while making it. 🙏
This is so simple. I made this puzzle with the ability to move more than one button at once, just like the one in Windows Vista/7
cool^^
and i love the music you're usingin your vids:)
When i Click na Button it didn't move to a black button.. help please . :/
@MrBejta
There is No straight function in VB to find Percentage.
Try this :
Dim Amt, P, R, T, I as Double
P = val(Textbox1.Text)
R = val(Textbox2.Text)
T = val(Textbox3.Text)
I = (P*R)/100 *T
Amt = P + I
Label1.Text = “Interest :” & I
Label2.Text = “Total :” & Amt
great...Love it love it love it
man you are the best !
but can you explain the code of the shuffle in the module cuz i don't understand it at all.
please answer me see you !
I try to do this in visual studio 2012, ¿why it doesn´t work?
Sir how about the looping in 3x3?
How might I add pictures to move with the numbers? More like a picture puzzle game.
hi Sir!. Thanks to this Vid!. It really helped me in my project in GameDev!. Super Thanks!. :)
The numbers are not moving from one box to another box why
me podrias decir el nombre de la cancion ? jejeje tocar guitarra es mi otra pasion aparte de programar :D buenisimo tuto por cierto va para mis favoritos!
Great vid, really helpful
Can u explain the shuffle subroutine
can you tell me code button9 and button10
good job ! i like it ☺
@MrBejta
Eg: 15 % on 1500 € for 2 year
Formula for Simple Interest = Principal × Rate × Time
P = 1500
R = 15
T = 2
Interest = ((P * R)/100) *T
Total = P + Interest
muy buen video tutorial muy completo
can u do this in 2008 version?
Overall good and the video helpful fr me. I found u hd a mistake tat u declared wrong buttons for button number 5..
Actually instead of creating separate Subs for each Button, you can just use the AddHandler statement at the startup of the Form. I mean like using a For loop to go through each Control in the Controls property of the form, then checking whether it's a Button, then using the AddHandler statement like this: AddHandler CurrentControl.Click ActionSub
And ActionSub is a Sub with "sender As Object" and "e as EventArgs" as parameters.
Then in the ActionSub, you can check the sender's surrounding... wait now that's a problem.
Or use the TableLayoutPanel control. It's easier.
That's right, it would be better to just select all the buttons, go to the event section in properties, and click on the onclick event twice, and use a sender statement in a select case situation to check the buttons, like case button1.text, checkbutton 2, 5, etc.
If you want to check the sender's surrounding, you have to know where the empty button (the button that does not contain the text) is, and you may need to use the empty button location, and check the clicked button location + the size of it, and if there are gaps between one button and the next, you need to add the gap number as well (not too sure if I am right or not), I don't know how to make the program work like this.
Now I know how to check the sender's surrounding, there's really no need to use a tablelayoutpanel at all for this.
Good Job!
hello sir i am using vb.net 2008 and i follow all your steps in the checkbutton module but it doesn't work....please help sir?
wht song is this pls tell
Hey! I Added The Shuffle Code But when i played it, the app was not visible at all and the mesagebox also dint worked!
Can I use pictureboxes instead?
Hola Itsaji, tengo un problema en la subrutina para mostrar los botones al azar, en la sentencia: RN = CInt(Int((15 * Rdn()) + 1)), no he logrado comprender dónde está declarado Rdn, ojalá pudieras ayudarme. Saludos.
plz tell me why my some numbers are missing and some are repeated
thank you for this tutorial.. i made it work.
Question: how can i reset the click counts?
You only need to put Form1.count = 0 at the last line of the shuffle event.
Well if you do the counting with a label like me ... and a shuffle button then just type that into the shuffle button: Label1.text = "" Form1.count = 0
all button are working except button 9 it didn't move to button 5 only but it's move to button 10 and 13 so plss help me.
of course
Does This Work on Vb 2008 profi.
Gracias y buena suerte con su programación vb
Can you plese tell me the code for 9,10,11 and 12.
what code for button 9 ? its not working
Thanks for your information sir,
CAn you tell me code Button9 and Button10.
Now when i create a new windows form is it C#
Hey I made the game, but when I click the play button it says "There were build errors. Would you like to continue and run the last successful build?" ...Can anyone help me with that??
Thank you
Hey... Can u send me a code i can't understand in button 9,10,11 and 12 plz
What is the name of the song? :)
BGM = Peace.........!
THX so much : )
goot tut, but can you tell me the musik name of this video ??!!
MFG DerKaptain1
HEY! MINE WAS NOT COUNTING ITS CLICKS AND THE SHUFFLE's NOT WORKING.
Thanks Bro! :)
@TheEpicNewb
Thanks ..!
9 and 16?
if i shuffle the buttons the score doesn't reset
what do i have to do to reset the clicks i made?
Can you please tell me the codes of button 9 and 10....
Gyhhu
This program is a little bit flowchart request
How to make it restart the counting in the top left when you click shuffle... i mean it still counts from before you shuffle
Put count = 0 at the end of the shuffle event
Me too! When I started to debug it, the app was not visible.
good day.. can you help me with my problem about the coding? i'm having a multiple number in my number box.. what could be the problem?
Look at the code I posted, you need to make sure flag = true and flag = false are in the correct place, and you should see no repeats..
Besides, here is another way to random, and this should work (you need to use at least VB 2017 or else it may not work)
Dim Random as New Random
Dim Numbers = Enumerable.Range(1, 15).ToList
For I = 1 to 15
If Numbers.Count = 0 Then Exit For
Dim index = Random.Next(Numbers.Count)
Controls("Button" & i).Text = Numbers(index)
Numbers.RemoveAt(index)
Next
Button16.text = ""
bro can yuo give the code plz?:)
Thanks!!!
Fuckin' thanks U homie
U damn it save me
It's not letting me play the game
source code?
thank you sir :)
Thanks :D
muy bueno-
Hello can you email me the codes pls? it's not very clear on here
does anyone know the coding for 9,10,11 and 12
hello! the code please
Control arrays would have made this so much simpler.
+kevnar hi, do u have tutorial like this? can u please teach me.. thanks
Control arrays were a VB 6 thing. I don't think you can do them in VB.net. Not directly, anyway.
ahh..ok, thanks for the info.
Made some changes to this so count won't count if there's not an empty button next to it and it won't count if you're clicking on an empty box. added a reset to count in shuffle aswell. you can find the code for that here pastebin dot com/0sz7EThf
Nice video but it would have been better had you either added comments to the code to explain what you were doing or added a voice track instead of music. The most critical point in the code was the shuffle and yet it was the part with the littlest amount of time on it. I had to stop the video and copy what you had done. See my code below
Sub Shuffle()
Dim a(15), i, j, RN As Integer
Dim flag As Boolean
flag = False
i = 1
a(j) = 1
Do While i 14 Then Exit For 'exit here as we will have apiiled the text to buttons 0 to 14
ctrl.Text = a(i)
i += 1
End If
Next
'set the bottom right button (16th Tile) to no text
Form1.Button16.Text = ""
End Sub
I reset the Click counter at the bottom of the CheckSolved sub in the if statement that checked if the puzzle had been solved.
thanks for the code
Just use this code under loop in the shuffle event, it will work (I've tested it).
For I = 1 to 15
controls("Button" & i).text = a(i)
Next
Button16.text = ""
If the random code is done in a Module, use the following code instead (though it is similar to the previous one)
Form1.controls("Button" & i).text = a(i)
Next
Form1.Button16.text = ""
I need to code ples
clicks doesn't count on me please help
oh! nvm.. :)
someone please post this project here
Please see my comment.
it doesnt work on me . wen i click a number it doesnt move :(( pls help me
same
Please see my comment on this, I got all the codes there.
i wont show up the msgbox
You may want to use a status strip to show that the game is completed, as well as the move count, maybe even the amount of time taken to play the game
the buttons don't move
The buttons don't move, just the number moving into the button that has nothing when you click on a button that has a number and is adjacent to (next to) the button that has nothing
Further to my previous comment, the following code will make a message box appear when the user clicks shuffle after the game is already started.
Private Sub tsShuffle_Click(sender As Object, e As EventArgs) Handles tsShuffle.Click
If finished = True Then Shuffle()
If start = False Then Shuffle()
If start = True Then
If vbYes = MsgBox("This puzzle is in progress." + Environment.NewLine + "Are you sure you want to shuffle?", MsgBoxStyle.YesNo, "Puzzle is in progress") Then
Shuffle()
Else
End If
End If
End Sub
Можно код игры
I created a web browser with visual basic 2010.
how
@DerKaptain1
I don't have any info on the music .. I picked it from some old .. random music files.
awesome vid, but muted
where is source code
can you send me
and your awsome
@@godhandgaming4480 Just use my code. Sort by Newest first, and see my comment, all the codes are there.
@@godhandgaming4480 Actually I have two comments, which make the game more complete.
a mi me interesa amigo
haha manage to do thay in visual basic 6.0, it is much easier
somebody else who can help me plsss, help me
This code creates Insolvable shuffle from time to time. Needs a better shuffle code
agreed would be useful to not have unsolvable puzzles
No shuffle games are unsolvable, it is just the way you solve it can make it harder to solve in the end.
The point is to get the number 1 to 8 first, then get 9 and 13 into the right place, and then get 10 and 14 into the right place, and the rest should be quite straightforward. Also, it would be a good idea to put the number you are going to move behind the number that is 1 number greater than it, for example, if you want to solve 3, put 4 on top, 3 on the bottom of 4, this way, when you move 4 into the place where 3 is supposed to be, and then move 4 to the right, then you will be able to insert 3 into where it is supposed to be.
I once found that shuffle game was not easy to solve, but it turns out to be very easy as soon as I watched videos on how to solve slider puzzles.
You may want to check out how to solve number shuffle puzzle game on youtube for more details.
The above solution may sometimes cause you to stuck, but you could try and figure out a fix for that. Again, search for guides on how to solve number shuffle puzzle game for solutions.
After investigating this further, I found that there are indeed unsolvable puzzles in this case, maybe there need to be a code to deal with the parity issues.
While I don't have any way to make the game always solvable every time it resets, there is a way around it.
When the movecount (or clicks) reaches a certain number there will be a message box warning you saying that the game may not be solvable, and ask you if you want to reset the game or not.
In the checkbutton subroutine, under movecount += 1, or click +=1 (depends on what you use), put this code in.
If movecount = 200 or movecount = 250 then
if vbyes = msgbox("There is a chance that this puzzle is unsolvable, do you want to reset the puzzle?", vbYesNo, "Possibly Unsolvable") then
shuffle()
Else
End if
End if
there's a error in my program, it says that "HAndles Clause requires a WithEvents variable defined in the containing type or one of its base types
Help me Please!
Tell me what makes each of these things?
Dim a(15), i, j, RN As Integer
Dim Flag As Boolean
Flag = False
i = 1
a(j) = 1
Do While i
This is simply a code that prevent random numbers from repeating.
Do while I
Further to my comment below I found a bug in my code below is the revised code
Dim a(15), i, j, RN As Integer
Dim flag As Boolean
flag = False
i = 0
a(j) = 0
Do While i
+Peter Cook You should do another tutorial.. I'm actually doing this as a project so I kinda need help on certain things
failure
Same here :(
basic is one ulgy language
good tutrial but bad video and ex planes
bahez hawlery Baad spealing two
+VSHelper & +bahez hawlery you both have bad spelling
u r right:d
i dont even remember when i commented on this video
don't work ! :D