11 Replies - 654 Views - Last Post: 15 March 2012 - 06:51 PM Rate Topic: -----

#1 NessValdez  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 70
  • Joined: 12-March 12

Concentration game - how to use the multiple timers

Posted 12 March 2012 - 07:58 PM

In my class, we are designing a concentration game. The game will give you and output of numbers and you will have a specified time to memorize the numbers. Then, you will enter your guess to see if you were right or not. User will have the option to specify if they want a 3, 6, 12, or 24 digit number. Then they will be able to specify their own timer of 30 seconds, 15 seconds, 3 seconds, or 1 second. The options are done using radiobuttons. Groupbox 1 categorizes the number of digits long. Groupbox 2 is for the timer. So far, I have the whole game layed out except for the timer. Everything works.

How would I go about assigning timers to radiobuttons? If you need the rest of my coding that I have so far, I can paste the coding here tomorrow. I used if and then statements for the radiobuttons in groupbox1...

Is This A Good Question/Topic? 1
  • +

Replies To: Concentration game - how to use the multiple timers

#2 Toadill  Icon User is offline

  • D.I.C Regular

Reputation: 45
  • View blog
  • Posts: 401
  • Joined: 08-January 12

Re: Concentration game - how to use the multiple timers

Posted 12 March 2012 - 08:39 PM

Seriously you need to go read your book also our rules state that you must post your code to receive help. I know just from what you described that you have not read about groupboxes and how they relate to radio buttons. Also when you said that you plan to use the other groupbox for a timer that makes no sense. You are only hurting your self by not learning....
Btw this is the basics, how far do you think you will make it if you don't read your assignments, when you get to harder code.

The timers are used to decide how long the memory numbers should be displayed.
One timer may display the other may turn it off.

When you post your code make sure to use code tags

This post has been edited by Toadill: 12 March 2012 - 08:46 PM

Was This Post Helpful? 0
  • +
  • -

#3 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 300
  • View blog
  • Posts: 1,776
  • Joined: 26-March 09

Re: Concentration game - how to use the multiple timers

Posted 13 March 2012 - 01:13 AM

NessValdez, please appreciate that not everyone's first language here is English and that what you have written could be misinterpreted, especially where you state about using Groupbox 2 for timers, so it is a little ambiguous. The reason Toadill has a reputation of 24 is because they're an active member of the community and provided valuable help to many people. So please, just chill out, as abusing people isn't the right way to go about getting some help.

Right, that aside.....

If you're putting radio buttons in groupbox 2 for timers, then I would just use the value you have assigned to the radiobutton and use that as the timer interval (you will probably need to do a calculation as the timer works in milliseconds), alternatively, store the actual calculated number in the Tag property of the radiobutton.

Doing it that way, will mean you only need one timer.

Hope that gives you some pointers.

This post has been edited by maj3091: 13 March 2012 - 01:25 AM

Was This Post Helpful? 0
  • +
  • -

#4 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: Concentration game - how to use the multiple timers

Posted 13 March 2012 - 07:01 AM

Valdez, you get a red card. I've also hidden your post, otherwise you would probably get a few more red cards. You have no business being rude to anyone who is trying to help you. Please refrain from this sort of childishness in future.

As for you, Toadill, you can be a little slower to criticize. Please show me documentation about your "group box" concept, for example. Notice also that the OP did offer to post his code. Perhaps in future you can give a person the benefit of the doubt until it's clear that they are out of line.

Now, to answer your question, or to begin to, you only need one timer, not one for each radio box. Your idea is analogous to saying that you need a different stopwatch for each runner at a meet. You don't, of course. Chew on that and post back if you need to.

This post has been edited by BobRodes: 13 March 2012 - 07:06 AM

Was This Post Helpful? 0
  • +
  • -

#5 NessValdez  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 70
  • Joined: 12-March 12

Re: Concentration game - how to use the multiple timers

Posted 14 March 2012 - 01:59 PM

Here is my code thus far:

Public Class Form1


 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Randomize()
        If RadioButton1.Checked = True Then
            TextBox1.Text = CStr(Int(Rnd() * 901) + 99)
        ElseIf RadioButton2.Checked = True Then
            TextBox1.Text = CStr(Int(Rnd() * 900001) + 99999)
        ElseIf RadioButton3.Checked = True Then
            TextBox1.Text = CStr(Int(Rnd() * 900001) + 99999) + CStr(Int(Rnd() * 900001) + 99999)
        ElseIf RadioButton4.Checked = True Then
            TextBox1.Text = CStr(Int(Rnd() * 900001) + 99999) + CStr(Int(Rnd() * 900001) + 99999) + CStr(Int(Rnd() * 900001) + 99999) + CStr(Int(Rnd() * 900001) + 99999)
        End If

    End Sub


 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim Msg As String
       

        If (TextBox2.Text = TextBox1.Text) Then
            Msg = "You are correct! "
        Else
            Msg = "Sorry. Wrong answer. "
        End If
        MsgBox(Msg)
    End Sub


Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

        If RadioButton5.Checked = True Then
            SetTimer(30)
        ElseIf RadioButton6.Checked = True Then
            SetTimer(15)
        ElseIf RadioButton7.Checked = True Then
            SetTimer(5)
        ElseIf RadioButton8.Checked = True Then
            SetTimer(1)
    End Sub]


Sorry. Not sure what happened to the coding in the last post, but here is where I really need help on:

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

        If RadioButton5.Checked = True Then
            SetTimer(30)
        ElseIf RadioButton6.Checked = True Then
            SetTimer(15)
        ElseIf RadioButton7.Checked = True Then
            SetTimer(5)
        ElseIf RadioButton8.Checked = True Then
            SetTimer(1)
    End Sub


If I only need 1 timer, then this should be a good start. But I dont know where to go from here. And no, my textbook only shows how to use timers set to a password. So this to me is going above and beyond what we have learned.
Was This Post Helpful? -1
  • +
  • -

#6 MaherD  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 17
  • Joined: 14-March 12

Re: Concentration game - how to use the multiple timers

Posted 15 March 2012 - 12:26 AM

just you can set the timer interval to set the time.
you can use something like that

If RadioButton5.Checked = True Then
timer1.interval = 30000
If RadioButton6.Checked = True Then
timer1.interval = 15000
'etc



private sub timer1_timer()
'hide the textbox or do watever you like
end sub


Was This Post Helpful? 0
  • +
  • -

#7 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6063
  • View blog
  • Posts: 23,515
  • Joined: 23-August 08

Re: Concentration game - how to use the multiple timers

Posted 15 March 2012 - 04:34 AM

Some nerve giving our helpful readers crap when you can't even post in the right forum (guess you can't read, huh?).

Now that you've bothered to POST your code, we can all see this is VB.NET, which is NOT VB6.

Moved to VB.NET.
Was This Post Helpful? 0
  • +
  • -

#8 NessValdez  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 70
  • Joined: 12-March 12

Re: Concentration game - how to use the multiple timers

Posted 15 March 2012 - 04:34 PM

I appreciate everyone for your helpful advice. Sorry for making a rude comment earlier. Toadill's comment had no basis and it made me a little angry. He should have just messaged me if he had a question. He made assumptions and to me, it seemed very rude and not a polite way to greet someone new to a forum. But that is old news. Again, thank you for your helpful feedback. And Jack of All Trades, you shouldnt be rude either, especially as a moderator. But thank you kindly for putting my post in the right forum.
Was This Post Helpful? -1
  • +
  • -

#9 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2262
  • View blog
  • Posts: 9,464
  • Joined: 29-May 08

Re: Concentration game - how to use the multiple timers

Posted 15 March 2012 - 04:54 PM

NessValdez: Welcome the real world, where most don't give a flying fork about you.

Be the way I also think what you wrote is rude to all of the members that have taken time out of their free-time to write a post. All you do is slap them in the face. Do you think that will ingratiate them into help you further? If it where me I think twice about assisting you further or make up wait a lot longer. We can always find other members that are more appreciative of the help.

And if you think this is rude, then you have a lot to learn about the internet and some of the people it attracts. The relative anonymity of black text on a white black background, is very appealing and can open up peoples true feelings on a subject.

By the way.

Hello, I'm Adam and welcome to Dream.In.Code.

This post has been edited by AdamSpeight2008: 15 March 2012 - 05:13 PM

Was This Post Helpful? 0
  • +
  • -

#10 Shane Hudson  Icon User is offline

  • D.I.C Technophile
  • member icon

Reputation: 343
  • View blog
  • Posts: 1,286
  • Joined: 06-December 09

Re: Concentration game - how to use the multiple timers

Posted 15 March 2012 - 06:07 PM

View PostNessValdez, on 15 March 2012 - 11:34 PM, said:

I appreciate everyone for your helpful advice. Sorry for making a rude comment earlier. Toadill's comment had no basis and it made me a little angry. He should have just messaged me if he had a question. He made assumptions and to me, it seemed very rude and not a polite way to greet someone new to a forum. But that is old news. Again, thank you for your helpful feedback. And Jack of All Trades, you shouldnt be rude either, especially as a moderator. But thank you kindly for putting my post in the right forum.


They were not being rude, you should read the massive big yellow and red boxes at the top of the reply page before posting.
Was This Post Helpful? 0
  • +
  • -

#11 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,505
  • Joined: 16-March 11

Re: Concentration game - how to use the multiple timers

Posted 15 March 2012 - 06:14 PM

Well hello there sir/ma'am. Let's start from the beginning shall we? What is the very first thing you want to learn to accomplish for your concentration game(be specific, there is plenty to go over I assure you)?

This post has been edited by trevster344: 15 March 2012 - 06:15 PM

Was This Post Helpful? 1
  • +
  • -

#12 NessValdez  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 70
  • Joined: 12-March 12

Re: Concentration game - how to use the multiple timers

Posted 15 March 2012 - 06:51 PM

Ive read everything before I posted. But thank you Shane, I did read those massive red and yellow boxes. And I clicked on VB6 purposely. If you couldnt tell, I am new to computer programming. I don't know the difference from VB6 to VB.net because I am still learning. And thats ok. Its only my first semester programming. But I would have to kindly disagree. I think they were being a little rude. And yes, thank you adam. I am aware of the kind of people the internet attracts. Who knew apologizing would make more controversy. Thank you BobRodes for looking at the post fairly. Like I said, I should have commented in a better way. But now I think you guys are taking this too far. It shouldnt have been dragged out. You can delete this forum. Thank you everyone who did take the time to help me.
Was This Post Helpful? -1
  • +
  • -

Page 1 of 1