Page 8 of 10 FirstFirst ... 5678910 LastLast
Results 281 to 320 of 366

Thread: Flickering Buttons: How Do I Get Rid Of Them?

  1. #281
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    "isn't it okay to take my suggestion and at least try it? (not saying it to be rude or anything)." ==> Of course it is Jon and I don't think you are being rude. You can do anything you want with your program and I won't be mad or hurt if you ignore my advice.

    "NameCard may not be working properly" ==> It is working properly


    "and the ShuffleRedCards (and Blue) may only work with games such as Blackjack, Poker, Solitaire, etc. It may not be necessary for Card Sharks, as the cards would normally be selected at random for this game." ==> the shuffle routines that we have DO generate a random sequence of cards dealt one at a time which is exactly the same as choosing one at random from a list.

    Okay now when I forced the 1st 4 cards to be the 4c, 7s, 6s and 2d by doing this at the end of ShuffleBlueCards...

    Code:
    BlueCards(0) = 15 '4c
    BlueCards(1) = 5 '7s
    BlueCards(2) = 4 '6s
    BlueCards(3) = 39 ' 2d
    ...it worked perfectly for me. . Note that I am still using the code you sent me on Feb 10.

    I had a 4 of clubs as the first card. Called it higher.

    Result was a 7 of Spades, called it higher.

    Result was a 6 of Spades. HigherWrongCards was run which is what should happen.

  2. #282
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    I just modified your 3/1 code with my changes (look for 'new and you'll find them) and sent it to you. The 1st 4 cards are hard-coded like I mentioned above and it still works.

  3. #283

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Apparently, I am using the code I did revamp after Feb. 10. I guess I should go back to the Feb. 10 folder and try it out.

    EDIT: I'm downloading the files you sent me.

  4. #284

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    I just did a test run, and when I finished the third question, my blue player started with a 4 (not sure what the suit was), and I called it higher. It was a 6 (not sure what the suit was), but the same error prevails.

    Yep, it may look as if the code you provided has some flaws. It looks like tomorrow morning, I may have to look back at the Blockbusters code and find out how to use what I had with the strLetters(#) and use the strCards(#) the same way. That may be the only way the code will possibly work. It appears that reading the old card values as 1 to 52 doesn't seem to work.

    I will save the current files as a backup, though, just in case. But I will certainly save the updated form file as a different form file. And when I finish some test runs on the updated form, and it works properly, I will send you the updated file and you may see optimum results.
    Last edited by JonSea31; Mar 2nd, 2010 at 08:32 PM.

  5. #285
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    In the code I sent you I left out one important change and that was changing DealBlueCard = Ctrl.Tag Mod 13 to DealBlueCard = Ctrl.Tag. However let me ask you an important question that unfortunaterly I think I know the answer to.

    Do the suit count when comparing two cards? In other words for example is the 2s higher than the 10c?

    If it's not (because 2 is not higher than 10) then my FillCardRank is wrong.

    Please let me know.

  6. #286
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    I went ahead and assumed that the suit doesn't matter when determining higher and lower.

    I also found a bug in the FreeShot routine.

    I've sent to the link to the updated code.

    It seems to work but you of course need to verify that.

    The code I attached deals 6s, 4s, 2s, 7s, 8s and 8c to the blue player and 10h, 3h, 2h, 10d, 8s and 8d to the red player. If you guess higher, higher, higher and higher for the blue player, and lower, higher and higher for the red player you'll run the same test I did.

  7. #287

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    I just did a test, and I manipulated the code a few times to see if I get results.

    I used this combination:

    Code:
    BlueCards(0) = 4 '6s
    BlueCards(1) = 2 '4s
    BlueCards(2) = 0 '2s
    BlueCards(3) = 5 ' 7s
    BlueCards(4) = 47 ' TenDiamonds
    BlueCards(5) = 19 ' 8c
    It seems to work with a ten card no problem. But when I use a face card in place of the ten card:

    Code:
    BlueCards(0) = 4 '6s
    BlueCards(1) = 2 '4s
    BlueCards(2) = 0 '2s
    BlueCards(3) = 5 ' 7s
    BlueCards(4) = 48 ' JackDiamonds
    BlueCards(5) = 19 ' 8c
    It just doesn't seem to read the value of the Jack card and I get the wrong sub set off. Same for Queen, King, or Ace. Maybe it has to do with the way the image filenames are labeled and randomized, perhaps? And I cannot see why the Jack, Queen, King, or Ace cannot work properly, whereas any card from deuce to ten works no problem. Is there any way to fix this?

    Maybe the card values for Jack, Queen, King, and Ace in the NameCard public function in the GameEssentials module may have to be replaced with the numbers 11, 12, 13, and 14 to register the right card values, perhaps? Or is there a way to run the cards smoothly without having to use NameCard? Because I believe the NameCard is only meant to give the card value in a caption if necessary (two to Ace, not 2 to 14). And as I said before, the suit is not a vital element in this game when using it in a caption. It's not necessary to say "It's a 4 of Hearts" when the caption could show "It's a Four!" If you saw the links to the videos I provided, you may have noticed that Bob Eubanks never mentioned anything about the suit of the card.

    BTW, the primary purpose of the NameCard is to fill the captions, but instead it's doing more than that by retrieving the card value as well. It is possible that NameCard may not be necessary at all, when the cards in the deck (1 to 52) can be chosen at random, and then the corresponding numeric card value (2 for deuce to 14 for Ace) determine the oldRedCardValue or oldBlueCardValue.
    Last edited by JonSea31; Mar 4th, 2010 at 10:07 AM.

  8. #288
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Quote Originally Posted by JonSea31 View Post
    I just did a test, and I manipulated the code a few times to see if I get results.

    I used this combination:

    Code:
    BlueCards(0) = 4 '6s
    BlueCards(1) = 2 '4s
    BlueCards(2) = 0 '2s
    BlueCards(3) = 5 ' 7s
    BlueCards(4) = 47 ' TenDiamonds
    BlueCards(5) = 19 ' 8c
    It seems to work with a ten card no problem. But when I use a face card in place of the ten card:

    Code:
    BlueCards(0) = 4 '6s
    BlueCards(1) = 2 '4s
    BlueCards(2) = 0 '2s
    BlueCards(3) = 5 ' 7s
    BlueCards(4) = 48 ' JackDiamonds
    BlueCards(5) = 19 ' 8c
    It just doesn't seem to read the value of the Jack card and I get the wrong sub set off. Same for Queen, King, or Ace. Maybe it has to do with the way the image filenames are labeled and randomized, perhaps? And I cannot see why the Jack, Queen, King, or Ace cannot work properly, whereas any card from deuce to ten works no problem. Is there any way to fix this?

    Maybe the card values for Jack, Queen, King, and Ace in the NameCard public function in the GameEssentials module may have to be replaced with the numbers 11, 12, 13, and 14 to register the right card values, perhaps? Or is there a way to run the cards smoothly without having to use NameCard? Because I believe the NameCard is only meant to give the card value in a caption if necessary (two to Ace, not 2 to 14). And as I said before, the suit is not a vital element in this game when using it in a caption. It's not necessary to say "It's a 4 of Hearts" when the caption could show "It's a Four!" If you saw the links to the videos I provided, you may have noticed that Bob Eubanks never mentioned anything about the suit of the card.

    BTW, the primary purpose of the NameCard is to fill the captions, but instead it's doing more than that by retrieving the card value as well. It is possible that NameCard may not be necessary at all, when the cards in the deck (1 to 52) can be chosen at random, and then the corresponding numeric card value (2 for deuce to 14 for Ace) determine the oldRedCardValue or oldBlueCardValue.
    I will look into this problem but let me talk about something else for a minute.

    Several times you have said things like "It is possible that NameCard may not be necessary at all, when the cards in the deck (1 to 52) can be chosen at random". That implies to me that you don't think that the choices are random, when actually they are.

    I'm sure you'll agree that if I take a real deck of cards and select three cards from different places in it that that is a random selection. Now let's say I take those same three cards and put them on top of the deck and deal them one at a time. While that dealing is not random by itself, the cards were put there as a result of a random process, so the result is still the same - a random deal. That is exactly what is happening now.

  9. #289
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Did you do your test in MY latest code? Here is what happens when I do it:

    First blue card is 6 of spades
    I guess higher
    Second blue card is 4 of spades
    HigherWrongCards is executed - code is correct so far

    Cards are cleared
    First blue card becomes the 2 of spades
    I guess higher
    Next blue card is the 10 of diamonds
    HigherRightCards is executed - code is correct so far

    I guess higher
    Next blue card is the 8 of spades
    HigherWrongCards is executed - code is correct.

  10. #290

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Actually, before you posted, I tested to see if the face cards would work properly.

    First blue card is 6 of spades

    I guess lower
    Second blue card is 4 of spades
    LowerRightCards is executed - code is correct so far

    I guess lower
    First blue card becomes the 2 of spades
    LowerRightCards is executed - code is correct so far

    I guess higher
    Next blue card is the 7 of Spades
    HigherRightCards is executed - code is correct so far

    I guess higher
    Next blue card is the 10 of diamonds
    HigherRightCards is executed - code is correct.

    Now if I do the same thing but with the Jack of diamonds instead of the 10 of diamonds:

    First blue card is 6 of spades

    I guess lower
    Second blue card is 4 of spades
    LowerRightCards is executed - code is correct so far

    I guess lower
    First blue card becomes the 2 of spades
    LowerRightCards is executed - code is correct so far

    I guess higher
    Next blue card is the 7 of Spades
    HigherRightCards is executed - code is correct so far

    I guess higher
    Next blue card is the Jack of diamonds
    HigherWrongCards is executed - should not be executed.

    The problem this time around is due to the face cards. And maybe removing NameCard is not necessary, as like you said (correct me if I'm wrong), without it the cards would not be chosen at random. There just has to be a way to allow the face cards to function as a normal numbered card, even if it takes a bit of tweaking of maybe the NameCard function.

  11. #291
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Sorry, my mistake. The keys in the CardRank collection are strings so "10" (Jack of diamonds) is less than "2" (2 of spades). Replace FillCardRank with this and you'll be happy

    Code:
    Public Sub FillCardRank()
    
        Set CardRank = New Collection
        CardRank.Add "13", "Ace of spades"
        CardRank.Add "12", "King of spades"
        CardRank.Add "11", "Queen of spades"
        CardRank.Add "10", "Jack of spades"
        CardRank.Add "09", "10 of spades"
        CardRank.Add "08", "9 of spades"
        CardRank.Add "07", "8 of spades"
        CardRank.Add "06", "7 of spades"
        CardRank.Add "05", "6 of spades"
        CardRank.Add "04", "5 of spades"
        CardRank.Add "03", "4 of spades"
        CardRank.Add "02", "3 of spades"
        CardRank.Add "01", "2 of spades" '<- NOTE "02" NOT "01"
        CardRank.Add "13", "Ace of hearts"
        CardRank.Add "12", "King of hearts"
        CardRank.Add "11", "Queen of hearts"
        CardRank.Add "10", "Jack of hearts"
        CardRank.Add "09", "10 of hearts"
        CardRank.Add "08", "9 of hearts"
        CardRank.Add "07", "8 of hearts"
        CardRank.Add "06", "7 of hearts"
        CardRank.Add "05", "6 of hearts"
        CardRank.Add "04", "5 of hearts"
        CardRank.Add "03", "4 of hearts"
        CardRank.Add "02", "3 of hearts"
        CardRank.Add "01", "2 of hearts"
        CardRank.Add "13", "Ace of diamonds"
        CardRank.Add "12", "King of diamonds"
        CardRank.Add "11", "Queen of diamonds"
        CardRank.Add "10", "Jack of diamonds"
        CardRank.Add "09", "10 of diamonds"
        CardRank.Add "08", "9 of diamonds"
        CardRank.Add "07", "8 of diamonds"
        CardRank.Add "06", "7 of diamonds"
        CardRank.Add "05", "6 of diamonds"
        CardRank.Add "04", "5 of diamonds"
        CardRank.Add "03", "4 of diamonds"
        CardRank.Add "02", "3 of diamonds"
        CardRank.Add "01", "2 of diamonds"
        CardRank.Add "13", "Ace of clubs"
        CardRank.Add "12", "King of clubs"
        CardRank.Add "11", "Queen of clubs"
        CardRank.Add "10", "Jack of clubs"
        CardRank.Add "09", "10 of clubs"
        CardRank.Add "08", "9 of clubs"
        CardRank.Add "07", "8 of clubs"
        CardRank.Add "06", "7 of clubs"
        CardRank.Add "05", "6 of clubs"
        CardRank.Add "04", "5 of clubs"
        CardRank.Add "03", "4 of clubs"
        CardRank.Add "02", "3 of clubs"
        CardRank.Add "01", "2 of clubs"
    End Sub

  12. #292

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    I did test it out, and it works perfectly.

    Now, another problem (yet again)...

    I saved the updated form as another file name and on that updated form I deleted the "BlueCards(#) = #" series from the ShuffleBlueCards area (and the ShuffleRedCards too), and when I did a new test run, I had a 7 (not sure what suit) to start, but I changed the 7 to a King (not sure what suit). When I called it lower than the King, while the result was a 7, the LowerWrongCards sub was executed.

    So by having fixed cards did seem to work no problem, but maybe this latest problem is a randomizing issue, perhaps?

  13. #293

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    I did another test run, and I had an 8 (not sure what suit) to start, then I changed it to a 4, and then called higher, and the result was a 7, but the HigherWrongCards sub was executed.

    Maybe this "BlueCards(#) = #" only works with a fixed sequence of cards, but not cards randomly chosen. Or the problem may be when the card is changed, perhaps?

    THIS JUST IN: I'm highly confident it is a change card issue. I just tested the code several times, in hopes that my first base card (unchanged) would be a face card, and on the most recent test run (which is underway) my first base card is an Ace of Spades. I called it lower (needless to say), and it was a 4 of Diamonds, the LowerRightCards sub was executed like it should.
    Last edited by JonSea31; Mar 4th, 2010 at 07:13 PM.

  14. #294
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    I haven't fully tested it but I think I've found the problem. You have two variables called intBlueCardValue and intRedCardValue. You assign values to them in ChangeCard but you don't do anything else with them there or anyplace else. Since that is the case you don't need them and should delete them. Once you've done that you should change the two lines in ChangeCard as follows.

    Code:
        'intRedCardValue = DealRedCard(CurImage, 0)
        oldRedCardValue = DealRedCard(CurImage, 0)
    
        'intBlueCardValue = DealRedCard(CurImage, 0)
        oldBlueCardValue = DealRedCard(CurImage, 0)

  15. #295

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    ^ I actually discovered the problem myself before you posted. I don't know why I did this in the first place. But thanks for the information!

    I'll be doing a series of test runs over the course of Friday and Saturday. I have optimism that the problems I had will finally have been solved this time!

    Looks like what's left to do in the game so far:
    • Adding (an) Artificial Intelligence player(s)

    • Adding a public variable to allow for score to carry over to Money Cards and other forms.

    • Adding contestant avatars for the user to choose in the CSInfo form.

  16. #296
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    I've sent you a new set of files that include a couple of bug fixes and some other changes including requiring the entry of player names to start the game. The names will be remembered the next time the game is played.

    All the changes are marked with 'new2 and documented.

    If you don't like some of the changes (like disabling cmdEnterQ until a player enters his/her guess) please feel free to not include them.

  17. #297

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Just realized something else:

    When a player guesses the card to be higher or lower, and the contestant is wrong, in the RemoveCards sub, the oldRedCardValue (or oldBlueCardValue) has to reset back to the base card value (the base card being where the freeze bar is located). I discovered that there is no line anywhere in the RemoveCards sub where the oldRedCardValue (or Blue) is reset to the base card.

    If the original base card was to be a 4 of Spades (denoted #2 in the sequence and 03 in the FillCardRank), and a player called it lower than the 4, and the result was to be a King of Diamonds (denoted #50 in the sequence and 12 in the FillCardRank). Because of the player being wrong, the old(Blue or Red)CardValue should be reset at the base card rank value being 03, and not 12).

    The FreezeCard(WhosTurn) is the position where the contestant's base card presently is (it is numbered 0 to 4). For example, if a contestant freezes on the second card on the row, that FreezeCard(WhosTurn) = 1.

    If you have any further questions, feel free to ask.

  18. #298
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    I'm going to assume you can fix that problem. If you can't then let me know.

    I found another bug in addition to the two in my Marty2 files.

    In Removecards there is this line at the end.

    Code:
    WhosTurn = WhosTurn Xor 1
    As you may know, that changes the value of WhosTurn from Blue to red or red to blue. Let's assume it was blue's turn and so that would cchange it to red's turn. But then in both LowerWrongCards and HigerWrongCards you have the following which changes WhosTurn right back to Blue again. You should remove this code.

    Code:
    If intTurn = 1 Then
        If WhosTurn = RedPlayer Then
            WhosTurn = BluePlayer
        Else
            WhosTurn = RedPlayer
        End If

  19. #299

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Actually, I took a stab at resetting the oldRedCardValue (plus the oldBlueCardValue) in the RemoveCards sub.

    Code:
    Private Sub RemoveCards()
    Dim i As Integer
    If WhosTurn = RedPlayer Then
        For i = CurrentSlot(red) To (FreezeCard(WhosTurn) + 1) Step -1
            CurrentSlot(red) = i
            Picture1.AutoRedraw = True
            If (CurrentSlot(red) = 1 And FreezeCard(WhosTurn) = 0) Then
                CurrentSlot(red) = CurrentSlot(red) - 1
                oldRedCardValue = FreezeCard(WhosTurn)
                Picture1.Picture = LoadPicture(App.Path & "\cards\bkgd-redlit.bmp")
                RCard(1).Visible = False
                Wait 250
                Set RCard(1).Picture = RedCrd
                RCard(1).Visible = True
    Using the code in bold, I tested the code, and still nothing. I think I know why this is the case - the FreezeCard(WhosTurn) doesn't backtrack to the card value in the base card position.

    I used the following in ShuffleBlueCards:

    Code:
    BlueCards(0) = 24 ' King of Clubs
    BlueCards(1) = 13 ' 2 of Clubs
    BlueCards(2) = 29 ' 5 of hearts
    BlueCards(3) = 21 ' 10 of clubs
    BlueCards(4) = 12 ' Ace of Spades
    BlueCards(5) = 39 ' 2 of Diamonds
    Got the King of Clubs for the base card. Called it higher on purpose, and the result was a 2 of Clubs. HigherWrongCards sub was executed.

    When the blue player won the second question, she was supposed to start from the King of Clubs. She called it lower, and while the result was lower (5 of Hearts), the LowerWrongCards sub was wrongfully executed.

    I can see a possible reason why. The oldBlueCardValue (in this case) is supposed to read the CardRank (as in the FillCardRank) and not the card sequence values (24, 13, 29, 21, etc.). But is there a way to allow this resetting of the oldBlueCardValue (and vice versa for the red player), and the next time that same player has control of the cards, they can reveal the next card from where it left off in the sequence?

    Here is some pseudocode to give you an idea:

    oldBlueCardValue = Rank (1 To 13) of Freeze Card (0 to 4)

  20. #300
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    You say

    "Got the King of Clubs for the base card. Called it higher on purpose, and the result was a 2 of Clubs. HigherWrongCards sub was executed.

    When the blue player won the second question, she was supposed to start from the King of Clubs".

    That doesn't happen now. If that is what should happen shouldn't we fix that problem first?

  21. #301
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    You also say "The oldBlueCardValue (in this case) is supposed to read the CardRank (as in the FillCardRank) and not the card sequence values (24, 13, 29, 21, etc.)".

    In all other cases oldBlueCardValue is the 24, 13, 29, 21, etc., so why is this case different?

  22. #302

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Quote Originally Posted by MartinLiss View Post
    That doesn't happen now. If that is what should happen shouldn't we fix that problem first?
    Yes, we should fix this problem.

    Quote Originally Posted by MartinLiss View Post
    In all other cases oldBlueCardValue is the 24, 13, 29, 21, etc., so why is this case different?
    I shall explain more clearly:

    It's possible that when the King of Clubs was the original base card, and called it higher, the result was the 2 of Clubs.

    When the blue player won the next question, the contestant was supposed to start from the King of Clubs. But instead, it actually continued from where it left off with the last card revealed, being the 2 of Clubs. That is why, despite starting from the King of Clubs, and despite the fact that it was called lower, and it was a 5 of Hearts, it actually set off the LowerWrongCards sub as if it read that 5 of Hearts is higher than 2 of Clubs, and not 5 of Hearts being lower than the King of Clubs.

  23. #303
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Okay let's fix the "king of clubs" problem. I want to make sure I understand how it should work.

    Let's say that after the shuffles are done that the first blue cards in the deck are
    King of Clubs
    2 of Clubs
    5 of hearts
    10 of clubs


    and the first red cards are the
    10 of hearts
    3 of hearts
    2 of hearts
    king of clubs
    6 of diamonds


    So after the king of clubs shows up for the blue player and he guesses higher and the 2 of clubs shows up which makes his guess wrong, if I understand you correctly the 1st red card dealt to the red player should be the king of clubs.

    Here's my question. If we show the king of clubs, what do we do with the order of the cards in the red deck? Note that in my example decks above the red king of clubs is meant to be dealt as the 4th red card and not the first. Do we
    1) Swap the red 10 of hearts with the red king of clubs, or
    2) Replace the blue deck with the red deck and sometime later reshuffle the blue cards, or
    3) Skip to the 4th card in the red deck so that the next red card after the king of clubs should be the 6 of diamonds, or
    3) Something else?

  24. #304

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Quote Originally Posted by MartinLiss View Post
    Here's my question. If we show the king of clubs, what do we do with the order of the cards in the red deck? Note that in my example decks above the red king of clubs is meant to be dealt as the 4th red card and not the first. Do we
    1) Swap the red 10 of hearts with the red king of clubs, or
    2) Replace the blue deck with the red deck and sometime later reshuffle the blue cards, or
    3) Skip to the 4th card in the red deck so that the next red card after the king of clubs should be the 6 of diamonds, or
    3) Something else?
    There really is no problem with the King of Clubs. That problem is fixed. But to answer your question, the deck starting with the King of Clubs is only for testing purposes. The same first few blue cards (starting with the King of Clubs) should be used as RedCards(#) also.

    Quote Originally Posted by MartinLiss
    So after the king of clubs shows up for the blue player and he guesses higher and the 2 of clubs shows up which makes his guess wrong, if I understand you correctly the 1st red card dealt to the red player should be the king of clubs.
    That is correct. Again, it's for testing purposes.

  25. #305
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    I understand about the king of clubs. The cards I talked about were only an example. Just to be sure that I understand, let me try another example.

    First 3 cards in the blue deck
    7 of spades
    8 of spades
    9 of spades


    First 3 cards in the red deck
    10 of hearts
    jack of hearts
    queen of hearts


    When the 7 of spades comes up the blue player guesses lower and is wrong.

    Question #1: Is the following what should happen next?

    The red card deck is replaced by the blue card deck and so the red card deck becomes
    7 of spades
    8 of spades
    9 of spades


    The blue card deck is shuffled so the first few cards could be anything, for example
    2 of spades
    3 of spades
    4 of spades


    Question #2:

    The Red player whose turn it is now has seen the fact that the card after the 7 of spades is the 8 of spades. So if we give the red player the 7 of spades to start with, isn't he/she going to know that the next card is higher?

  26. #306

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Here are the answers:

    Question #1: Is the following what should happen next?

    The red card deck is replaced by the blue card deck and so the red card deck becomes
    7 of spades <== oldRedCardValue should be recorded as 06
    8 of spades <== oldRedCardValue should be recorded as 07, but only briefly. As the card is removed, the oldRedCardValue should be reset to 06.
    9 of spades <== When the contestant wins his next question (or the next question he wins), he starts from the 7 of Spades (oldRedCardValue should be 06 at this point, until the player guesses higher, then the oldRedCardValue should become 08 (for 9 of Spades); but if the player guesses lower than the 7 of Spades, the oldRedCardValue is set at 08 but for only a very brief period, then the 9 of Spades is removed, leaving only the 7 of spades with the oldRedCardValue being reset to 06 (as in the card rank)
    And I think this task should be done with random cards eventually. The card sequence value (0 to 51) is not the primary element in determining the oldRedCardValue or the oldBlueCardValue. It is the value in the Card Rank (01 to 13) that is the primary key.

    Question #2:

    The Red player whose turn it is now has seen the fact that the card after the 7 of spades is the 8 of spades. So if we give the red player the 7 of spades to start with, isn't he/she going to know that the next card is higher?
    Because the fact being the 7 of Spades vs. the 8 of Spades, we only call the card lower just for testing purposes. Of course we know it's going to be higher. But after a successful testing of the cards, the cards should be done randomly once shuffled.

    And the oldRedCardValue (and the blue) should be reset, and should be fixed in the RemoveCards sub. You might want to check it out.

  27. #307
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    I'm sorry but you didn't answr my questions in post #305.

    Let's forget about old card values for now. Let's just assume that the 2 of spades shows up for the blue player and he stupidly guesses lower and so it becomes the red players turn. What should the red player see for the first two of his cards?

  28. #308

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Quote Originally Posted by MartinLiss View Post
    I'm sorry but you didn't answr my questions in post #305.

    Let's forget about old card values for now. Let's just assume that the 2 of spades shows up for the blue player and he stupidly guesses lower and so it becomes the red players turn. What should the red player see for the first two of his cards?
    I'm sorry, but I don't understand the questions clearly, and I don't think it has anything to do with the problem I am trying to fix.

    But to answer Question #1 to the best of my knowledge, the red deck does is not supposed to be replaced with the blue deck, or vice versa. The same red deck is used for each individual round.

    Quote Originally Posted by MartinLiss
    Let's forget about old card values for now. Let's just assume that the 2 of spades shows up for the blue player and he stupidly guesses lower and so it becomes the red players turn. What should the red player see for the first two of his cards?
    For testing purposes, the same sequence as the blue player's deck of cards. To sum it up, the 2 of Spades should be the first (base) card for the red player.

    Did I answer Question #2 in this post? If I didn't, I apologize. I just couldn't understand the question well.

  29. #309
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Let me try to explain visually what I am asking one more time.

    In the following the two rows are the cards that we see in the game. Also in the following something like "7s" means that a player can see the seven of spades and "(8s)" means that the 8 of spades is one of the next few cards in the deck that are set up to be shown.

    1) The guessing starts and it is blue's turn
    (10h) (Jh) (Qh) (2c) (Qd)
    7s (8s) (9s) (Kh) (4d) (Jc)

    2) The blue player sees the 7 of spades and he/she guesses lower
    (10h) (Jh) (Qh) (2c) (Qd)
    7s 8s (9s) (Kh) (4d) (Jc)

    Since the 7 of spades is not lower than the 8 of spades it becomes the red player's turn.

    Can you show me what the two rows of cards should look like when the red player takes over both before and after the red player's first guess?

  30. #310

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    The answer to your question (and thanks for providing a visual example):

    1) The blue player finishes his/her turn, and the red player guessing starts as it is red's turn
    10h (Jh) (Qh) (2c) (Qd)
    7s (8s) (9s) (Kh) (4d) (Jc)

    2) The red player sees the 10 of hearts and he/she guesses lower
    10h Jh (Qh) (2c) (Qd)
    7s 8s (9s) (Kh) (4d) (Jc)

    Since the Jack of hearts is not lower than the 10 of hearts the game goes to the next question (Question #2 in this case).

    The red player can still win the first question. If a red player guesses the numeric answer in the first survey question (like, 3, for example), the blue player guesses, say, higher, and the result is 2, which means the answer would be lower, and the red player wins control of the first play of the cards.

    1) The guessing starts and it is red's turn
    10h (Jh) (Qh) (2c) (Qd)
    (7s) (8s) (9s) (Kh) (4d) (Jc)

    2) The red player sees the 10 of hearts and he/she guesses lower
    10h Jh (Qh) (2c) (Qd)
    (7s) (8s) (9s) (Kh) (4d) (Jc)

    Since the Jack of Hearts is not lower than the 10 of Hearts, the blue player has a free turn at the cards.

    1) The blue guessing starts as it is blue's turn
    10h (Jh) (Qh) (2c) (Qd)
    7s (8s) (9s) (Kh) (4d) (Jc)

    2) The blue player sees the 7 of Spades and he/she guesses lower
    10h Jh (Qh) (2c) (Qd)
    7s 8s (9s) (Kh) (4d) (Jc)

    Since the 8 of spades is not lower than the 7 of spades, both players have had their turn at the cards with no success, and the game moves on to Question #2.

    I hope this clears things up a bit.

  31. #311
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Thanks for bearing with me. I understand now how it should work.

    I got confused somewhere along the way and thought that if, say, the blue player sees the Kc, guesses higher, and he/she loses his/her turn, that the the Kc should be come the card that the red player starts with.

    I understand now that no cards get switched that way.

  32. #312

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Well, at least there's some progress now.

    I look forward to getting the updated code in the hopefully near future.

  33. #313
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    I found 2 more bugs. In both HigherRightCards and LowerRightCards we were always using the name of the red player so change those subs like below.

    If you run the code after making this change is what you described in post #299 is still a problem? If so send me your code so that I can compare it with mine.

    Code:
    Private Sub LowerRightCards()
        SetDialog lblDialog(1).Caption & vbCrLf & "Yes!  It is lower!"
        Me.Refresh
        PlaySound App.Path & "\sounds\ding.wav", ByVal 0&, SND_SYNC Or SND_FILENAME
        'new4 bug
    '    SetDialog RName & ", Higher or Lower?"
        If WhosTurn = RedPlayer Then
            SetDialog RName & ", Higher or Lower?"
        Else
            SetDialog BName & ", Higher or Lower?"
        End If
    
        cmdChangeCd.Visible = False
        cmdChangeCd.Enabled = False
        cmdHigherCds.Visible = True
        cmdHigherCds.Enabled = True
        cmdLowerCds.Visible = True
        cmdLowerCds.Enabled = True
        ' This is where the freeze button stays only briefly after the second card on the row is revealed.  The Freeze button stays fixed when or after the third card on the row is revealed.
        cmdFreezeRCd.Visible = True
        cmdFreezeRCd.Enabled = True
    End Sub
    
    Private Sub HigherRightCards()
        SetDialog lblDialog(1).Caption & vbCrLf & "Yes!  It is higher!"
        Me.Refresh
        PlaySound App.Path & "\sounds\ding.wav", ByVal 0&, SND_SYNC Or SND_FILENAME
        'new4 bug
    '    SetDialog RName & ", Higher or Lower?"
        If WhosTurn = RedPlayer Then
            SetDialog RName & ", Higher or Lower?"
        Else
            SetDialog BName & ", Higher or Lower?"
        End If
    
        cmdChangeCd.Visible = False
        cmdChangeCd.Enabled = False
        cmdHigherCds.Visible = True
        cmdHigherCds.Enabled = True
        cmdLowerCds.Visible = True
        cmdLowerCds.Enabled = True
        ' This is where the freeze button stays only briefly after the second card on the row is revealed.  The Freeze button stays fixed when or after the third card on the row is revealed.
        cmdFreezeRCd.Visible = True
        cmdFreezeRCd.Enabled = True
    End Sub

  34. #314
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    I went ahead and added most of the code necessary to have the computer be the blue player. This computer player makes random higher/lower guesses for the questions and odds-based guesses for the higher/lower cards.

    The computer player could be made a lot smarter (by cheating) since the answers to the questions are in the files we read and of course we know the next card that's going to come up.

    I don't think it would be fun to play against the computer if the computer was 100% right all the time but we could set it's "smartness" to someplace between it's current 50% and 100%.

  35. #315

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    And not only did you do a good job with adding the AI player, but also I am impressed with how you were able to successfully fix the oldRedCardValue (and maybe oldBlueCardValue) problem with regards to executing the appropriate subs.

    I will try a few more test runs tomorrow, and I will give a definite progress report hopefully by tomorrow night.

    Oh, and I am considering adding avatar players for the contestant podiums. I am using images of avatars I have retrieved from Second Life for the game. I am also considering using a series of names for a certain gender (in this case, female). I do prefer to have the program select a female name from a random set of 14 female names. Here is the code I have thus far:

    Code:
    Private Sub BComputer_Click()
    Dim CPUName As Integer
    Randomize
    'ai
    Select Case CPUName
        Case Peggy
            BName.Text = "Peggy"
        Case Rachelle
            BName.Text = "Rachelle"
        Case Deborah
            BName.Text = "Jessica"
        Case Shannon
            BName.Text = "Shannon"
        Case Stacy
            BName.Text = "Stacy"
        Case Jasmine
            BName.Text = "Jasmine"
        Case Kelly
            BName.Text = "Kelly"
        Case Ciara
            BName.Text = "Ciara"
        Case Erika
            BName.Text = "Erika"
        Case Danielle
            BName.Text = "Danielle"
        Case Lindsay
            BName.Text = "Lindsay"
        Case Misty
            BName.Text = "Misty"
        Case Nikki
            BName.Text = "Nikki"
        Case Robyn
            BName.Text = "Robyn"
    End Select
    BName.Enabled = False
    gbComputerPlaying = True
    
    End Sub
    How do I allow the program to select from the 14 female names at random?

  36. #316
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Thanks

    Code:
    Private Sub BComputer_Click()
    'ai
    Dim CPUName As String ' Note String
    Dim strNames(12) As String
    
    strNames(0) = "Peggy"
    strNames(1) = "Rachelle"
    strNames(2) = "Jessica"
    strNames(3) = "Shannon"
    strNames(4) = "Stacy"
    strNames(5) = "Jasmine"
    strNames(6) = "Ciara"
    strNames(7) = "Erika"
    strNames(8) = "Danielle"
    strNames(9) = "Lindsay"
    strNames(10) = "Misty"
    strNames(11) = "Nikki"
    strNames(12) = "Robyn"
    
    'Randomize You don't need this because there is already one in the program
    
    CPUName = strNames(Int((UBound(strNames) - 1) * Rnd))
    
    BName.Enabled = False
    gbComputerPlaying = True
    
    End Sub

  37. #317

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    I tried the code, and it doesn't seem to work. I click the Computer Plays option for the blue player, and I cannot randomly choose a name, as I get the default name (in my case, "Peggy") all the time.

    Also, I don't think it's necessary to have the RName and BName text boxes set to SetFocus, as I believe doing so may cause the blue player name to not be selected at random.

    I'll send you the files and see what can be done about it.

  38. #318
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Code:
    Private Sub BComputer_Click()
    
    'ai
    Dim strNames(12) As String
    
    strNames(0) = "Peggy"
    strNames(1) = "Rachelle"
    strNames(2) = "Jessica"
    strNames(3) = "Shannon"
    strNames(4) = "Stacy"
    strNames(5) = "Jasmine"
    strNames(6) = "Ciara"
    strNames(7) = "Erika"
    strNames(8) = "Danielle"
    strNames(9) = "Lindsay"
    strNames(10) = "Misty"
    strNames(11) = "Nikki"
    strNames(12) = "Robyn"
    
    BName.Text = strNames(Int((UBound(strNames) - 1) * Rnd))
    BName.Enabled = False
    gbComputerPlaying = True
    
    End Sub

  39. #319
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    BTW why only women's names for the blue player? I know the avatar is currently a woman but won't that eventually be changed?

    In any case my thoughts about the computer player are these. As I said above, the current ai gets things right about 50&#37; of the time. I thought it would be fun to implement giving the human player a choice of several computer opponents of varying intelligence like the following

    HAL 9000 - 80%
    Deep Blue - 60%
    MAC CPU - 40%
    PC CPU - 20%
    Coin Flip -0%

    where the percent is the percentage of the time where the computer cheats by looking at the answer or looking at the next card before it is shown.

    In case you don't know HAL 9000 was the name of the evil ai in the movie 2001: A Space Odyssey and Deep Blue is the name of an IBM computer that was the first one to defeat a reigning chess world champion.

  40. #320

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Quote Originally Posted by MartinLiss View Post
    In case you don't know HAL 9000 was the name of the evil ai in the movie 2001: A Space Odyssey and Deep Blue is the name of an IBM computer that was the first one to defeat a reigning chess world champion.
    I knew about the 2001: A Space Odyssey computer, as I remember learning that on a certain game show, or most likely a clue in a crossword puzzle. And I remember learning about Deep Blue on the game show Where In The World is Carmen Sandiego? back in 1991 (the first season of the series, to be exact).

    I will be using Male names/avatars eventually. It's just building them in one step at a time.

    Also, I do need some more help, though...

    I need to know how to use public integers in a global module - so that I could carry information from form to form. It turns out that I may need to use separate forms for each round after all. I have the Round 1, Round2B, and Round2R forms thus far (Round2B means the last question in Round 1 was answered by the red player and the blue player would start off Round 2. Vice versa for Round2R form).

    The integers whose corresponding information I would like to carry from form to form are:
    • RWin

    • BWin

    • RDScore

    • BLScore


    Quote Originally Posted by MartinLiss
    In any case my thoughts about the computer player are these. As I said above, the current ai gets things right about 50&#37; of the time. I thought it would be fun to implement giving the human player a choice of several computer opponents of varying intelligence like the following

    HAL 9000 - 80%
    Deep Blue - 60%
    MAC CPU - 40%
    PC CPU - 20%
    Coin Flip -0%
    That would be a great idea, Martin! Allow for varying percentages so that sometimes an AI player will be wrong, have a low probability of being right, or be very highly right.

Page 8 of 10 FirstFirst ... 5678910 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width