
formula
Usage: set formula <formulaexpression>
The formula variable filters out match requests, as well as seek ads (the
'sought' display). If you have a formula set, then any match request not
satisfying your formula is automatically declined; you will be notified that
the offer was made and rejected by your formula. If you make an offer that
fails a player's formula, you will be given similar feedback. A user's
formula and fvariable settings are displayed using the "variables" command.
You disable (turn off) your formula by typing "set formula". This will, in
essence, erase your current formula setting.
Here are some simple examples, with descriptions in [] brackets:
blitz [match must be blitz]
!wild [match must be nonwild]
inc >= 10 [match must have an increment of 10 or higher]
Create or modify a formula by using the "set" command. For example, "set
formula blitz". Special variables (f1f9) can also be established using the
"set" command; these variables make it easier to modify your formula
depending upon your mood.
CREATING A FORMULA

1. Decide whether you will be changing your formula often. If so, think
about using fvariables to make these changes easier.
2. Decide exactly what kinds of filters you want to have, such as type of
game, time controls, and kinds of opponents.
3. Review the available formula operators and predefined variables (listed
below) to see which ones fit your needs.
4. Write out your formula and fvariables on paper to make sure that their
"logic" works.
5. Enter the logical expressions for the fvariables and formula using the
"set" command.
Changing your fvariables and formula follows the same procedures.
FORMULA VARIABLES

Several variables are allowed in formula settings. Some of these variables
hold numerical information while others are Boolean (true/false, 1/0). Here
is a list of allowed variables, where Boolean variables are denoted by "(B)":
The following variables are allowed in formulas:
Variable Description
 
abuser 1 if opponent is on the abuser list; 0 otherwise (B)
assessdraw How many rating points you will gain/lose by drawing a
chess match
assessloss How many rating points you will lose by losing a chess
match (these are negative values; see 'help assess')
assesswin How many rating points you will gain by winning a chess
match
black 1 if opponent asks for Black; 0 otherwise (B)
blitz 1 if match is blitz in type; 0 otherwise (B)
bughouse 1 if match is bughouse in type; 0 otherwise (B)
computer 1 if opponent is a computer; 0 otherwise (B)
crazyhouse 1 if match is crazyhouse in type; 0 otherwise (B)
inc Increment time for each player (in seconds)
lightning 1 if match is lightning in type; 0 otherwise (B)
maxtime(n) The maximum time n moves will take for BOTH players
(in seconds) [you must supply the 'n' value]
mymaxtime(n) The maximum time n moves will take YOU (in seconds)
[you must supply the 'n' value]
myrating Your rating
nocolor 1 if opponent does not ask for a specific color; 0
otherwise (B)
nonstandard 1 if the game will have different time controls for the
two players, _or_ if the game will begin from a
nonstandard position; 0 otherwise (B)
private 1 if game will be private; 0 otherwise (B)
rated 1 if game will be rated; 0 otherwise (B)
rating Opponent's rating
ratingdiff The difference between opponent's rating and your
rating [rating  myrating]
registered 1 if opponent is a registered user; 0 otherwise (B)
standard 1 if game will be standard in type; 0 otherwise (B)
suicide 1 if game will be suicide chess in type; 0 otherwise
(B)
timeseal 1 if opponent has timeseal; 0 otherwise (B)
time Start time for each player (in minutes)
unrated 1 if the game will be unrated; 0 otherwise (B)
untimed 1 if game will not involve the clock; 0 otherwise (B)
white 1 if opponent asks for White; 0 otherwise (B)
wild 1 if game will be wild in type; 0 otherwise (B)
Also, the word "minutes" is allowed after a number that is not enclosed in
parentheses (but right now, you must use "1 minutes"; the singular is not
recognized). The word has the effect of multiplying the previous number by
60, thus turning minutevalues into secondsvalues  important for the
maxtime and mymaxtime variables. For example, "2 minutes" would yield the
value of "120" (2 * 60).
FORMULA OPERATORS

The following formula operators are allowed; their order of precedence in the
calculations and evaluations is listed. Sometimes more than one set of
symbols leads to the same result. When functions in the formula have equal
precedence, the precedence is from left to right.
Symbol Function Precedence
  
! not; negation 1
 minus [as in 20 or variable] 1
* multiplication 2
/ division 2
+ addition 3
 subtraction 3
< less than 4
<= less than or equal to [ =< also works] 4
> greater than 4
>= greater than or equal to [ => also works] 4
= equals [ == also works] 5
!= not equals [ <> also works] 6
& and [ && also works as does 'and'] 7
 or [  also works as does 'or'] 8
Parentheses () are allowed in formulas and function as they do in numerical
equations: expressions within parentheses are evaluated first. You can use
the pound sign '#' after your settings to provide comments and reminders to
yourself. NOTE: The program divides by a fudge factor of .001 instead of
dividing by 0.
USERDEFINED FORMULA VARIABLES (FVARS)

F1 through f9 are userdefined formula variables changed by using the "set"
command. These variables can return either numerical or Boolean results. They
make it easy to change one part of your formula without retying the whole
thing, or to adjust your formula depending on your mood. For example, if your
various fvariables were ...
f1 rated & time=5 & inc=0 # rated 5 minute games
f2 ratingdiff
f3 maxtime(40) >= 2*8minutes # at least 8 mins each for 40 moves
f4 f2>400 # I want a REAL fight
f5 !abuser
f6 standard  (ratingdiff<200 & blitz)
... then, depending on your mood, you could type one of the following:
set formula f1 & f5 # rated 5 min. games only
set formula f2 > 100 # long games, decent competition
set formula f1 & !f4
or set formula f2 >= 0  blitz
You define an fvariable using the "set" command. With respect to the above
examples, you would type such lines as ...
set f2 ratingdiff
set f4 f2>400 # I want a REAL fight
set f5 !abuser
Be careful how you write the fvariables. Make sure they have the proper
sequence. For example, f5 can refer to f2 but f5 cannot refer to f8.
MAXTIME EXAMPLE

Using maxtime sets the expected total time for the game. If your formula (or
fvariable) included the following expression ...
o maxtime(30) <= 10 minutes
... this would allow no more than 10 minutes total time for the first 30
moves of the game (5 minutes for each player, or any other combination). The
maxtime expression is calculated by (Time + n*Inc/60) * 2 where 'n' is the
number of moves you want to calculate. By the way, the equation for "mytime"
is (Time + n*Inc/60).
CREDITS

Formula program for FICS written by Dave Herscovici (hersco)
SPECIAL NOTES

o Computer accounts that want to be open to challenges for suicide chess
matches must do the following: have the 'f1' formula variable set to
"suicide" (with no extra spaces of any kind); you need not use 'f1' as
part of the 'formula' setting. Computer accounts without 'f1' set to
"suicide" will have challenges for suicide chess declined automatically. A
similar consideration holds for crazyhouse challenges as well. The
relevant f# variable is f2 in this case, and it should be set to
"crazyhouse".
o The formula setting will not apply to match challenges among users in
mamer tournaments.
SEE ALSO

abuser assess blitz bughouse computers
crazyhouse lightning mamer match private
ratings sought standard suicide_chess timeseal
v_formula variables wild
AUTHORS

Created: 9 March 1999 pgv
Last Modified: 28 February 2008 mhill
