Val10
Technical User
- Feb 20, 2010
- 1
I truly hope someone can help me with this!
I'm making a simple playing card game, setting up the database is simple, the script is simple but there is one thing that baffles me....
Here's the card layout
Once the person picks their court card(s) and clicks the button - the card game will be laid out like this...
*****card 1*******
*****card 2*******
*****card 3*******
*****card 4*******
*****card 5*******
*****card 6*******
*****card 7*******
*****card 8*******
*****card 9*******
*****card 10******
Here's is what's racking my brain and baffles me - I want to keep 'one card' appearing randomly in one of these 10 positions per ONCLICK?
Here's an example...
*****card 1 position*******King of Hearts******
*****card 2 position*******Ace of Spade******
*****card 3 position*******Two of Hearts*****
*****card 4 position*******Three of Diamonds*
*****card 5 position*******Five of Clubs*****
*****card 6 position*******Nine of Hearts****
*****card 7 position*******Eight of Clubs****
*****card 8 position*******Seven of Spades***
*****card 9 position*******Four of Clubs*****
*****card 10 position******Ten of Diamonds***
The King of Hearts is the card I want to keep repeating randomly in one of the 10 positions.
Here's more detail on this - Lets say I clicked the button and now the King of Hearts is in position 9 instead of 1. Next time the King of Hearts is in position 3 instead of 9 however, all the other cards listed above are being executed by a cgi database at random, appearing in one of those 10 position WITH the King of Hearts. (K-of-H will always been in one of those position each time the person clicks the button.)
I hope I explained this well without confusion.
So I was wondering can I use random javascript for the King of Hearts and have the ONCLICK execute the cgi database for ace-ten? Can this be done? If so, can someone explain how I can do this or provide a simple script source...I'll be forever thankful!
Or is there a simple way to execute two databases on one ()ONCLICK? If so, can someone please explain how?
If anyone has any questions or needs more info from me please let me know.
Thanks in advance for your help!
Just in case- here is a copy of the cgi script that executes the database...
<FORM NAME="CardForm" ACTION="/cgi/card.cgi"
METHOD="POST">
<P>Layout:
<SELECT NAME="spreadpath" SIZE="1">
<OPTION
VALUE="../card/layout/10card.html">Layout</OPTION>
</SELECT></P>
<P>Location:
<SELECT NAME="deckpath" SIZE="1">
<OPTION
VALUE="../cards/databases/cards.cgi">Card Location</OPTION>
</SELECT></P>
<P><INPUT TYPE="SUBMIT" NAME="Submit1"
VALUE="Get Cards"
ONCLICK="var forever=new Date('October 17, 2030 03:24:00')var forever=new Date('October 17, 2030 03:24:00');setCookie('spreadpath', document.cardForm.spreadpath.value , forever , '', '', '');setCookie('deckpath', document.cardForm.deckpath.value , forever , '', '', '');"></P></FORM>
</TR>
</TABLE></TD>
</TR>
</TABLE> <SCRIPT>
document.cardForm.spreadpath.value = getCookie('spreadpath') || '../card/layout/10card.html';
document.cardForm.deckpath.value = getCookie('deckpath') || '../cards/databases/cards.cgi';
</SCRIPT> </BODY>
</HTML>
I'm making a simple playing card game, setting up the database is simple, the script is simple but there is one thing that baffles me....
Here's the card layout
Once the person picks their court card(s) and clicks the button - the card game will be laid out like this...
*****card 1*******
*****card 2*******
*****card 3*******
*****card 4*******
*****card 5*******
*****card 6*******
*****card 7*******
*****card 8*******
*****card 9*******
*****card 10******
Here's is what's racking my brain and baffles me - I want to keep 'one card' appearing randomly in one of these 10 positions per ONCLICK?
Here's an example...
*****card 1 position*******King of Hearts******
*****card 2 position*******Ace of Spade******
*****card 3 position*******Two of Hearts*****
*****card 4 position*******Three of Diamonds*
*****card 5 position*******Five of Clubs*****
*****card 6 position*******Nine of Hearts****
*****card 7 position*******Eight of Clubs****
*****card 8 position*******Seven of Spades***
*****card 9 position*******Four of Clubs*****
*****card 10 position******Ten of Diamonds***
The King of Hearts is the card I want to keep repeating randomly in one of the 10 positions.
Here's more detail on this - Lets say I clicked the button and now the King of Hearts is in position 9 instead of 1. Next time the King of Hearts is in position 3 instead of 9 however, all the other cards listed above are being executed by a cgi database at random, appearing in one of those 10 position WITH the King of Hearts. (K-of-H will always been in one of those position each time the person clicks the button.)
I hope I explained this well without confusion.
So I was wondering can I use random javascript for the King of Hearts and have the ONCLICK execute the cgi database for ace-ten? Can this be done? If so, can someone explain how I can do this or provide a simple script source...I'll be forever thankful!
Or is there a simple way to execute two databases on one ()ONCLICK? If so, can someone please explain how?
If anyone has any questions or needs more info from me please let me know.
Thanks in advance for your help!
Just in case- here is a copy of the cgi script that executes the database...
<FORM NAME="CardForm" ACTION="/cgi/card.cgi"
METHOD="POST">
<P>Layout:
<SELECT NAME="spreadpath" SIZE="1">
<OPTION
VALUE="../card/layout/10card.html">Layout</OPTION>
</SELECT></P>
<P>Location:
<SELECT NAME="deckpath" SIZE="1">
<OPTION
VALUE="../cards/databases/cards.cgi">Card Location</OPTION>
</SELECT></P>
<P><INPUT TYPE="SUBMIT" NAME="Submit1"
VALUE="Get Cards"
ONCLICK="var forever=new Date('October 17, 2030 03:24:00')var forever=new Date('October 17, 2030 03:24:00');setCookie('spreadpath', document.cardForm.spreadpath.value , forever , '', '', '');setCookie('deckpath', document.cardForm.deckpath.value , forever , '', '', '');"></P></FORM>
</TR>
</TABLE></TD>
</TR>
</TABLE> <SCRIPT>
document.cardForm.spreadpath.value = getCookie('spreadpath') || '../card/layout/10card.html';
document.cardForm.deckpath.value = getCookie('deckpath') || '../cards/databases/cards.cgi';
</SCRIPT> </BODY>
</HTML>