This makes NO SENSE at all:
Code:
randomCard = Deal();
a = randomCard;
player [0] = randomC();
You get a
randomCard. Fine. Then, for some weird reason, you assign it to the variable
a
Why didn't you simply code
a = Deal();?
But then you set
player[0] to the result of calling the function
randomC()!
WHY???
*APPARENTLY* you have a
Deal( ) function that returns one random card. That's great. But then why do you have *ANOTHER* function
randomC() that does the same thing????
On top of that, you get the score for the player by adding player[0] and player[1]. But why in the world would *THAT* score match the sum of the values of
a and
b??? Except by the wildest coincidence?
*********
In your second post, you show this:
Code:
document.write('<img alt="random image" src="' + playerC[a] + '"/>');
Now, all of a sudden, you have introduced the array
playerC[].
Where did *THAT* come from?
In the prior code, you had
player[0] and
player[1], but you certainly didn't have any
playerC[ ].
On top of everything else,
document.write is badly obsolete and you should *NOT* be using it.