PDA

View Full Version : swapping random images


lohuta
10-28-2002, 11:10 PM
Hi every one
I'm pretty new to the coding field so any and all help would be most aprreciated;
I'm at the end of an assignment which I'm suppose to insert images into a blackjack table.
I'm having a hard time figuring out how to code the buttons to except the images the pickacard and the pickasuit function have chosen.
I have five blank cards facing down and want to swap the images with the random cards picked.
What am I doing wrong??

Thanks in advance

joh6nn
10-29-2002, 11:51 AM
this is part of your problem:

function PickACard(strwho) {
cards = shuffle(12);
return cardvalue(cards,strwho);

suit = shuffle(4);
return picksuit(suit);
}

you can only return one value in a function. after you return something, the function stops. so, that second bit, with suit = shuff... , that never gets done. you have to figure out a way to get that information together with the first bit.

lohuta
10-29-2002, 07:31 PM
thanks joh6nn

I'll work on it.

anything else?

joh6nn
10-29-2002, 07:44 PM
that was the only thing that i saw, that would cause you a problem.