
-----------------------------------
zaindapain
Thu Jan 21, 2010 4:12 pm

Black Jack Game loop problem in GUI - help greatly appreciated
-----------------------------------
What is it you are trying to achieve?
I have made a blackjack game using procedures
However, the main program is not working like a "blackjack game" because the looping and exiting the loop at the right time is not working.


What is the problem you are having?
The program deals 2 cards to the user and the CPU at the beginning
Then the user has a chance to hit or stay. When a result is finally acheived, instead of starting the dealing all over from the beginning, the program allows the user to continue hitting and staying even if they lose or win
I need someone to read the loop and the exit when statements in the "Hit" and "Stay" commands from the GUI buttons and see what is wrong with the logic there.
Thank you very much as it'd mean a lot to me  :( 


Describe what you have tried to solve this problem
I have tried many different loops however, none of them seem to exit at the right time
IF someone could read up on my program and offer some help i'd greatly appreciate it. Thank you.

-----------------------------------
zaindapain
Fri Jan 22, 2010 8:01 pm

RE:Black Jack Game loop problem in GUI - help greatly appreciated
-----------------------------------
no help ? :'(

-----------------------------------
zaindapain
Mon Jan 25, 2010 12:57 pm

RE:Black Jack Game loop problem in GUI - help greatly appreciated
-----------------------------------
bump..

-----------------------------------
TheGuardian001
Mon Jan 25, 2010 1:58 pm

Re: Black Jack Game loop problem in GUI - help greatly appreciated
-----------------------------------
Well, for one thing, at the end of your program, you have this:
[code]
loop
        exit when uchips = 0 or GUI.ProcessEvent
end loop
[/code]

This loop will never exit until the user has 0 chips left. So once the dealer wins, it just keeps letting the user play until they have no chips left.

You're going to need 2 loops for this to work properly. 1 that starts where the user places their bet (so they can play again after one round), and another one inside of the first loop that only goes around the checking for a win/bust (as well as the GUI.ProcessEven/chips = 0 line). This second loop will ensure that they keep playing a single round until somebody wins/is bust.

-----------------------------------
zaindapain
Thu Jan 28, 2010 10:12 am

RE:Black Jack Game loop problem in GUI - help greatly appreciated
-----------------------------------
o
thnk you
but i already new that
can you fix it for me
caz when i do that it still wont work right :(

-----------------------------------
ProgrammingFun
Thu Jan 28, 2010 1:19 pm

Re: RE:Black Jack Game loop problem in GUI - help greatly appreciated
-----------------------------------
o
thnk you
but i already new that
can you fix it for me
caz when i do that it still wont work right :(

I'm sorry but no one will do your code for you
You could tell us what you are having trouble with and we can GUIDE you.

-----------------------------------
zaindapain
Mon Feb 01, 2010 6:45 pm

RE:Black Jack Game loop problem in GUI - help greatly appreciated
-----------------------------------
but thas what my problem is
what he told me to do is jus basically saying
"solve it your self.. and just repeated the problem again in different words.. "

-----------------------------------
TheGuardian001
Mon Feb 01, 2010 7:32 pm

Re: Black Jack Game loop problem in GUI - help greatly appreciated
-----------------------------------

solve it your self


Yes, you actually have to do your own work. What a surprise. We can tell you how to solve a problem (and I did, I told you exactly where to put your loops), but it's your work and you have to do it.

-----------------------------------
Velocity
Wed Jan 18, 2012 6:10 pm

RE:Black Jack Game loop problem in GUI - help greatly appreciated
-----------------------------------
lol whatta lazy bum

-----------------------------------
Insectoid
Wed Jan 18, 2012 6:13 pm

RE:Black Jack Game loop problem in GUI - help greatly appreciated
-----------------------------------
lol whatta freakin' necro.
