If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Need of Assistance :)

First things first. I go to New England Institute of Technology for Software Engineering and Cyber Security. I'm currently in my second quarter (15th week) and I'm starting to do a little more intermediate stuff. So, I made this program that deals random cards. The code is set to make it stop at 52 cards, but if you type anything over 52, it still deals the cards randomly. Firstly, I wanted to know if I had a fault in my code that should be stopping the cards but isn't or if it's not there at all........ I'll post the source for anyone to look at it.

Secondly, I' required to make a Texas Hold Em' program and my instructor explained that it's similar to the code that I will provide to you, but I honestly don't know where to begin. My teacher isn't very good at explaining code than what he does when he's not at school teaching us kids. So I was hoping to come to a place where people are more serious to teach and explain things that might help me understand all this more.

Re: Need of Assistance :)

But the code that I added to my draw_a_card function isn't doing what it's supposed to do.

Which is? Have you used the debugger to see where the code is deviating from what you expected? When code isn't doing what it should then tracing the code through with the debugger helps to track down the issue.

All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

Re: Need of Assistance :)

Originally Posted by 2kaud

Which is? Have you used the debugger to see where the code is deviating from what you expected? When code isn't doing what it should then tracing the code through with the debugger helps to track down the issue.

Re: Need of Assistance :)

I' required to make a Texas Hold Em' program and my instructor explained that it's similar to the code that I will provide to you, but I honestly don't know where to begin.

I would suggest that the first thing you want is for draw_a_card() to actually return the card drawn.

For the Texas Hold Em' program, first you need to know the rules. Then you need to design an algorithm for the rules. Then you produce a program design, then you code the program from the design and then test/debug the code.

You have a function that gets a card. So from the rules, in English, produce the design so that someone who doesn't know anything about cards can follow these (like a computer would with a program) using this.

All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

Re: Need of Assistance :)

Originally Posted by 2kaud

I would suggest that the first thing you want is for draw_a_card() to actually return the card drawn.

For the Texas Hold Em' program, first you need to know the rules. Then you need to design an algorithm for the rules. Then you produce a program design, then you code the program from the design and then test/debug the code.

You have a function that gets a card. So from the rules, in English, produce the design so that someone who doesn't know anything about cards can follow these (like a computer would with a program) using this.

Re: Need of Assistance :)

My instructor never went into detail about how to use the debugger. I only know how to write very simple programs and how to fix simple mistakes to a degree.

Then now's a good time to learn to use the debugger. You need to become totally familiar with it. What os/compiler are you using?

Take your current card program and use the debugger to single step through the code, examine variables, set breakpoints etc and become familiar with it using a program you know. Then when you are trying to find a problem in another program that doesn't work as expected you will be familiar with the debugger and can then just use it to help find problems in the code. That's what we do. A program is seldom 'correct' the first time it is coded. So we use the debugger to determine what's happening and where what the program is doing is at variance with the design from which it was coded.

All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

Re: Need of Assistance :)

Originally Posted by 2kaud

Then now's a good time to learn to use the debugger. You need to become totally familiar with it. What os/compiler are you using?

Take your current card program and use the debugger to single step through the code, examine variables, set breakpoints etc and become familiar with it using a program you know. Then when you are trying to find a problem in another program that doesn't work as expected you will be familiar with the debugger and can then just use it to help find problems in the code. That's what we do. A program is seldom 'correct' the first time it is coded. So we use the debugger to determine what's happening and where what the program is doing is at variance with the design from which it was coded.