How to set up HTML files to describe a bridge hand
last update 4/19/97 email
to pcheung
General :-
My applet which provides GUI interface to
generate the hand, bidding sequence and record hand play
is coming soon. In the mean time you have to use a text
editor to create your data file.
There are now about 80 parameters inside the
applet and about 60 are described in this document. For
most people you will only use less than 10. A typical
hand will use three to input the hands(applet will
complete the fourth), one to input the bidding sequence ,
one to input recorded card play and one to specify the
dealer. This is all you need to have a complete hand
Most errors are made in recording the play of
the hand. The order of play in a round is critical and
must be correct. (If the correct order is HAQ79, HQ79A is
not acceptable). The program is going to play it like you
define it. As a result it may have wrong calculations
(like tricks won).
I am providing two templates of HTML files
for you to start out with. One with all parameters
(template.htm) and one with a few less (templete1.htm or
cex7.htm) ( save this from the how to demo) to make it
easier to see in your editor.
You do not have to change or delete any
parameter you are not using. Parameter names are case
sensitive.
The parameter text looks like this in the
HTML file:-
<param NAME="Nhand"
VALUE=""> . You enter the value between the
"" of VALUE="".
All input will take both upper and lower
case. You can use either one for things like S or s for
spade etc. File names and comments are case sensitive.
Please try something simple first before you
attempt a complicated hand description. Most hands are
simple and can be done in 1 to 5 minutes. For very
complicated hands you should try to put it in two to
three steps and test out the data file in each step. This
makes it easier to find errors.
Description of parameters :-
Each hand is enter separately. If
you enter 13 cards for three hand the fourth one will be
computed by the applet. The parameter name is Nhand for
north,Ehand for east etc. You must enter your cards in
the order of AKQJT98765432 and SHDC for the suit. ( e.g.
<param NAME="Nhand"
VALUE="s3haqjt94dt854cq7"> )
All small and unimportant cards can be entered as x. x
cannot be a card higher than any card specify in any
hand. (e.g. for the club suit lets say there are 5 cards
specify as x. then 2,3,4,5,6 of club cannot be used in
any hand because the 5 card represented by x is assign
the 5 lowerest card which is 2,3,4,5,6)
Parameter name is bidding for the bidding sequence.
One of a suit is enter as 1s, 1h, 1d, 1c and 1n. P for
pass D for double R for redouble. You must end with three
passes for a complete sequence if you want the applet to
calculate who's the leader. (e.g. <param
NAME="bidding"
VALUE="1cp1hp1np4hppp"> .
Parameter name is cardplay for the recorded card
playing sequence.(e.g. for a complete 52 card
sequence<param NAME="cardplay" VALUE=
"c26k74q38h4d2hk2ca5s3cjct9h9d3d4a6s2d7kh3d5s4has87
hqs6h65hjsjh78dt9qs5stkhtsad8jsq9">) Notice if
you do not enter a suit it is assume the card has the
same suit as last card play.
Each name is entered separately. (e.g. <param
NAME="Sname" VALUE="Peter Cheung">
will assign Peter Cheung to south)
Parameter name is dealer for the dealer of the hand .
(e.g. <param NAME="dealer"
VALUE="s"> ). Default is north.
Parameter name is vul for the vulnerability of the
hand . (e.g.<param NAME="vul"
VALUE="NE">). default is none. It can take
NS EW both and none.
You can use claim and score to be display at end of
the recorded card play only. (e.g. <param
NAME="claim" VALUE="9"><param
NAME="score" VALUE="+400">).
You can use nexthand and nexttable to link to other
data files to be play by the applet. (e.g. <param
NAME="nexthand"
VALUE="ccomp11.htm"><param
NAME="nexttable"
VALUE="ocomp10.htm">).
There are 8 user define windows to display text for.
They are question, yes, no, one, two, three, four and
bidinfo. Each has six long lines of buffer. If you want
to use them you must store some text in the first line.
The parameter for the question window is question,
question1 ,question2 , question3 ,question4, question5.
You must enter some text for the parameter question if
you want to use it. (e.g.<param
NAME="question" VALUE="This is the first
line in question "><param
NAME="question1" VALUE="1st extra
line"><param NAME="question2"
VALUE="2nd extra line"><param
NAME="question3" VALUE="third extra
line"><param NAME="question4"
VALUE="4th extra line"><param
NAME="question5" VALUE="5th extra
line">
You can hide each individual hand by setting
hidenorth to "yes" for north hand. (e.g.
<param NAME=hidenorth VALUE="yes">).
If there is no bidding sequence you can use the
parameter trump to set the suit for the hand. It is use
for playing the hand.(e.g. <param NAME=trump
VALUE="s"> for spade be the trump). Default
is no trump.
If there is no bidding sequence you can use the
parameter leader to set the leader for the hand. It is
use for playing the hand.(e.g. <param NAME=leader
VALUE="s"> for south to lead).
Advance feature for displaying bidding sequence. You
can put one * after any bid. The applet will display the
bidding sequence up and including that bid when it first
start running. You can put the * at the end of the
bidding sequence and all the bidding will be shown at the
beginning of the show.
Advance feature for displaying bidding sequence. You
can put a # after any bid. When the applet play to that
bid it will look for a poundx parameter to display the
text at the status line. The first # will correspond to
the parameter pound1 etc. (e.g. the bidding is
"2C2H#P6H#D#PPP" and <param NAME=pound1
VALUE="aggressive defensive bid"><param
NAME=pound2 VALUE="great bid"><param
NAME=pound3 VALUE="what can I do?">. When
the bid is 2H the text "aggressive defensive
bid" will be display at the status line.)
Error detection:-
The current version of the applet is not
commercial grade on checking and trying to recover from
user data errors. Please be careful with your data input.
Some of the error checking will not be needed
when I provide you with better tools to input the data.