im new to programming im in programming one. i have my code for a card shuffling program. bUT our teacher wants us to modify the programs we coded and make it deal 5 cards and then determine what kind of hand it is. I believe i have to change my function. I normally wont ask for help so bluntly because this is how u learn but my teacher doesnt teach us or even help a little bit she answers our questions with questions and she makes us feel dumb which for wht im payin and every1 else is crap.i've had my head in my text book for 5 hours now.. no lie and i still dont understand.. i need to leave the library cause its about to close i dont have internet at my house and i need to have this done by tomorrow morning cause i have to use it to do my final(lord alone knows what that may bring).. im gonna paste my code in here if anyone can help me please!! i even think somthin is wrong with my card dealing program because some of it prints null of jacks instead of what it really is
//shuffle cards in deck
void shuffle( int wDeck[][ 13 ] )
{
int row;//row number
int column;//column number
int card;//countre
//for each of the 52 cards, choose slot of deck randomly
for ( card = 1; card <= 52; card++ )
{
//choose new random location until unoccupied slot found
do {
row = rand() % 4;
column = rand() % 13;
} while( wDeck[ row ][ column ] != 0 );//end do... while
//place card number in chosen slot of deck
wDeck[ row ][ column ] = card;
}//end for
}//end function shuffle
//deal cards in deck
void deal( const int wDeck[][ 13 ], const char *wFace[],
const char *wSuit[] )
{
int card;//card counter
int row;//row counter
int column;//column counter
//deal each of the 52 cards
for ( card = 1; card <= 52; card++ )
{//loop through rows of wDeck
for ( row = 0; row <= 3; row++ )
{//loop through columns of wDeck for current row
for ( column = 0; column <= 12; column++ )
{//if slot contains current card, display card
if( wDeck[ row ][ column ] == card ) {
printf( "\n\n%5s of \n%-8s%c", wFace[ column ], wSuit[ row ],
card % 2 == 0? '\n' : 't');
}//end if
}//end for
}//end for
}//end for
}//end function deal