POOLS PREDICTOR FOR THE ATARI ST.
---------------------------------
Version 1.04 - February 1992
Author : Paul J. Newbery
Placed in Public Domain
********************** IMPORTANT **********************
*** ***
*** This program works in MONO (Hires) only ***
*** ***
*******************************************************
This program has been placed in public domain and as such you are
entitled to do with it what you will.
However, the distribution of this program must be accompanied by the
following files :
POOLSPRD.PRG - The program, hard to distribute a working
copy without this !!
POOLSPRD.RSC - The resource file.
POOLSPRD.TXT - This text file.
This program may have been supplied with another file, POOLSPRD.DAT,
which originally contained the 1991/92 football league data as
25/2/92. If not present, don't worry, the program will function
correctly without this file.
Enhancements from V1.03
-----------------------
For those of you who have seen / used V1.03, this version has the
following enhancements :-
i) Allow results analysis if any games entered (used to be if at
least 20 games entered).
ii) Bug Corrected - team preselection on enter games dialogue was
duplicated in not enough teams were left to fill selection
boxes.
iii) Bug Corrected - loading customize data used to reset no. of
teams in each division.
iv) Bug Corrected - results analysis did not handle pools panel
results correctly.
v) When calculating performance points for a team, if less than
the number of games entered, use an average value for the
remainder of games.
vi) Use GEM sliding windows for division, games and result
prediction displays.
vii) Bug Corrected - team sort routine did not sort completely.
viii) Bug Corrected - addressing error when searching for an
nonexistent team.
ix) Customize prediction factors made into a single dialogue box.
x) Floating point numbers used to increase accuracy on team
performance points.
xi) Printer Setup dialogue box added, strings stored as part of
customize data.
xii) Display actual total number of score draws, homes and aways in
analyse results dialogue box.
xiii) Percentage complete box added for loading and saving files.
1. GENERAL
-------
This program can be used to try and win a fortune on the pools.
However, this is not just a pools predictor program and can be
used to maintain any league structure.
So if you want to be rich or you run your own league (football,
rugby, hockey, basketball etc..) then this program could be for
you !
As with all prediction programs, the more data the better the
results. So, admittedly tedious, you are advised to enter all
league and cup games, mid-week included, to get the best results.
I know there are other pools predictors around, but I found their
methods in predicting the results very limiting. In this program
the factors used to predict the most likely score draws, home
wins and away wins can be altered by the user, there are more
than one million different combinations for each !!! So if you
hit the best combination, you may beat the system.
Happy punting !
2. CAPACITY
--------
This program can be used to maintain a league with up to ten
divisions, the number of teams is limited only by memory, as is
the number of games. However as each team can only play one game
at one time then the maximum number of games that can be entered
is one half the number of teams.
More than one league can be maintained by having data files with
different filenames or by running this program from a different
directory.
3. GETTING STARTED
---------------
This program is run from the desktop by 'double clicking' on the
program file, POOLSPRD.PRG.
Before running a sub-directory from the directory in which the
program resides should be created and called 'GAMES', in this
directory the data for all the games entered will be stored.
On running up the program looks for two filenames, in the same
directory as the program :
POOLSPRD.DAT - The file containing data to generate the
league tables, if this file does not exist then a
warning will be generated and no data is loaded.
POOLSPRD.CUS - The customize data for this program, i.e names
of divisions, prediction factors and printer setup
strings. If this file does not exist then a
warning is given and defaults (football league,
EPSON compatible printer) are used.
After loading these files then the initial dialogue box is shown
giving my name and the current version, 1.04. Click on 'OK' or
press return to remove this box.
The following text will go through each of the menu items in turn
describing the function it performs.
4. DESK MENU
---------
Selecting Pools Predictor displays the initial dialogue box.
5. FILE MENU
---------
5.1 LOAD TEAM DATA - This option allows you to load the team data
from disk, using the file selector.
The default filename is the last one used or
'POOLSPRD.DAT', the default file is expected to be
in the same directory as the program. The data is
loaded on start-up so this option is not required
on starting the program as long as your data has
the default filename.
On loading new data a warning is given if the old
data, about to be overwritten, has changed and not
been saved to disk.
5.2 SAVE TEAM DATA - This option allows you to save the team data to
disk, using the file selector and is disabled if
no teams have been entered.
The name given as the default filename is the last
one used or 'POOLSPRD.DAT' if no data was loaded
from disk.
5.3 LOAD GAME DATA - This option loads the game data from disk, using
the file selector.
The default filename is the last one used or
'POddmmyyy.GAM' where dd, mm, and yy are the
current day, month and year (at least they are if
your internal clock is correct !!). The default
file is expected to be in a sub-directory of the
one in which the program is in called 'GAMES'. It
is advised that the day, month and year part of
the filename are set to the day on which the games
are to be played, this date is used when printing
the games.
On loading new games a warning is given if the old
games, about to be overwritten, have been changed
and not saved to disk.
5.4 SAVE GAME DATA - This option allows you to save the game data to
disk, using the file selector and will only be
enabled if at least one game has been entered.
The default filename is the last one used or
'POddmmyy.GAM' in the 'GAMES' sub-directory (see
LOAD GAME DATA for details of the filename).
5.5 LOAD CUSTOMIZE DATA - This option allows you to load a customized
data file from disk, using the file selector.
The default filename is the last one used or
'POOLSPRD.CUS' and is expected to be in the same
directory as the program. The customized data is
loaded on start-up so this option is not required
on starting the program as long as your customize
data has the default filename.
On loading new data a warning is given if the old
customized data, about to be overwritten, has
changed and not been saved to disk.
The customize data file contains the names of all
the divisions, the factors used in predicting the
home wins, away wins and score draws (see
CUSTOMIZE option under DATA MENU) and the printer
setup strings (see PRINTER SETUP option under
PRINTER MENU).
5.6 SAVE CUSTOMIZE DATA -This option allows you to save the customize
data to disk, using the file selector. The
default filename is the last one used or
'POOLSPRD.CUS', and will be saved in the same
directory as the program.
6. DATA MENU
---------
6.1 EDIT TEAM DATA - This option allows you to edit the data on each
team or enter new team data.
On taking this option you are asked to 'Enter
Start Team Name:', press return to edit the first
team, or enter the name or part of the name of the
team you wish to edit. On pressing return, or
clicking on 'OK', a form entry page is displayed
allowing you to edit all the data stored about a
team. Most of the data is self-explanatory.
It should be noted that when editing team data the
teams are arranged in division order and
alphabetically within each division.
The codes used for the last ten games played at
home or away are :-
W - Win
S - Score Draw e.g. 1-1, 2-2 etc
D - No Score Draw i.e. 0-0
L - Loss
The entry for points deducted will normally be
zero but is included for when a league committee
imposes point penalties on teams e.g. for fielding
illegal players or for violence.
The exit buttons are on the bottom of the form,
their meanings are as follows :-
Cancel - Any changes made to this teams
data are discarded and the
program returns to the menu
bar.
Delete - Delete this team, the form
entry selects the next team,
if none then the previous team
is selected.
Previous - Any changes made to this teams
data are stored and the form
entry selects the previous
team.
Next - Any changes made to this teams
data are stored and the form
entry selects the next team.
OK - Any changes made to this teams
data are stored and the
program returns to the menu
bar.
The default exit button changes depending on which
team you are editing, if you are editing the last
team then the 'OK' button is the default,
otherwise the 'NEXT' button is the default.
To add new teams simply select the last team
currently entered and click on the 'NEXT' button,
a blank form will be presented on which the new
teams data should be entered.
6.2 CLEAR TEAM DATA - This option deletes all the teams i.e. you are
left with zero teams, ready to enter new data and
is only enabled if at least one team has been
entered.
A warning is given asking you to confirm your
selection before all the teams are deleted.
6.3 ENTER GAMES - This option allows you to edit the data on each
game or enter new game data and is only enabled if
at least two teams have been entered.
On taking this option you are asked to 'Enter
Start Game Number:', press return to edit/enter
the first game, or enter the number of the game
you wish to edit. If an illegal game number is
entered then editing will begin with the first
game. On pressing return, or clicking on 'OK',
the game entry form is displayed allowing you to
enter/edit game data.
Each game must be designated as a league or cup
game. In a league game the points from the result
are used in constructing the league tables, in a
cup game then the result is only used in the
previous home or away results.
The home and away teams can be selected from the
teams displayed, the teams are shown in division
order and alphabetically within each division. To
display the rest of the teams the up and down
arrows should be used, the arrows move the teams
up and down one page and the 'v's move the teams
up and down one position.
When a team has already been entered for a game it
is not displayed in the selectors for any other
games.
The exit buttons are on the bottom of the form,
their meanings are similar to those at the bottom
of the team edit form and are as follows :-
Cancel - Any changes made to this game
are discarded and the program
returns to the menu bar.
Delete - Delete this game, the form
entry selects the next game,
if there is none then the
previous game is selected.
Previous - Any changes made to this game
are stored and the form entry
selects the previous game.
Next - Any changes made to this game
are stored and the form entry
selects the next game.
OK - Any changes made to this game
are stored and the program
returns to the menu bar.
The default exit button changes depending on which
game you are editing, if there are no more teams
to enter into games then the 'OK' button is the
default, otherwise the 'NEXT' button is the
default.
To construct games with non-consecutive numbers
enter the first group of consecutive games, return
to the menu bar (click on 'OK'), chose 'EDIT
GAMES' again and start from the first number in
the next group of games. Continue entering games
in this manner until all the games to be played on
a particular date have been entered.
6.4 DISPLAY GAMES - This option displays all the games entered in a
window on the screen and is only enabled when at
least one game has been entered and less than four
windows are open.
The display of each game may take several
different formats which may be as follows :
A v B - Game has not been played yet
A x-y B - Game has been played A had x
points/goals, B had y
points/goals.
A P-P B - Game postponed, no pools panel
result.
A Ab-Ab B - Game abandoned, no pools panel
result.
A H-H B - Game postponed or abandoned,
pools panel result home win.
A A-A B - Game postponed or abandoned,
pools panel result away win.
A S-S B - Game postponed or abandoned,
pools panel result score draw.
A D-D B - Game postponed or abandoned,
pools panel result no score
draw.
6.5 CLEAR GAMES - This option deletes all entered games i.e. you are
left with no games, ready to enter new data, and
is only enabled if at least one game has been
entered.
A warning is given asking you to confirm your
selection before all the games are deleted.
6.6 CUSTOMIZE - This option allows one to customize the division
names and information along with the pools
prediction factors.
Two form entry pages are shown, the first allows
the names of the divisions and all the information
about each division to be entered. The entries
for number of teams to promote, relegate and play
off determine where the lines are drawn when one
displays/prints a league table (set the relevant
entry to zero to inhibit the drawing of a line).
The other entries for win, draw and loss points
are used when calculating the number of points a
team has and hence its position in the table.
On each of these forms the return button will
enter the data you have entered and cancel will
disregard the entered data before moving onto the
next form.
The second form contains the pools prediction
factors for score draws, home wins and away wins.
When predicting a result this program calculates
the previous 'form' points for the home and away
teams, these points are then used to determine the
result. If the home and away teams' points are
equal then a draw is assumed, if the home team's
points are much greater than the away team's then
a home win is predicted and if the away team's are
much greater than the home team's an away win is
predicted.
These form points are shown in brackets when
displaying the games using the 'Predict....' menu
selections in the 'RESULTS' menu (see section
8.4).
These prediction factors determine how the
previous 'form' points are calculated and are used
as follows :
Number of Last Results to use - this indicates the
number of last home and away results to
use for the calculation. E.g. if this
number is 8 the last 8 home games are
used for the home team and the last 8
away games for the away team.
This number can only be between 1 and
10, only the last 10 results are stored.
Points for Last Results - these values determine
the number of 'form' points to award for
the results of previous games and may
take a number between 0 and 9.
For example if the number of last
results to use is 5 and the points for
last results are 5, 3, 2, and 0 for a
win, score draw, no score draw and lose
respectively, if the last 5 home results
of a team is WSDLW then it's number of
form points will be 15 (5+3+2+0+5).
Last Result Weighting - this indicates whether to
put more emphasis on the most recent
previous result. If this is 100% then
all the last results are treated
equally. If set to 50% then the last
but one result is only taken 50% into
account, the last but two only 25% (50%
x 50%) etc.
For example, taking our previous example
of last 5 results of WSDLW and taking a
last result weighting of 50% the number
of form points would be 7 (actually
7.3125).
Calculated from :-
5+(3*50%)+(2*50%*50%)+(0*50%*50%*50%)+(5
*50%*50%*50%*50%) ).
Or, for any mathematicians amongst you :
5 + 3*50% + 2*(50%^2) + 0*(50%^3) +
5*(50%^4).
Other Last Results Inclusion - this percentage
figure indicates whether to include the
teams most recent away results when the
team is playing a home game and vice
versa. If set to 0% then the other
results are not taken into account and
if set to 100% then the other results
have an equal rating as the same
location results.
Note setting this factor to any value
other than zero will utilize all the
previously mentioned factors for the
other results as well as the same
location results.
For example, a team's last 5 home
results were WSDLW and away results
SSDLL, then taking a last result
weighting of 100% and all the other
prediction factors as used in previous
examples the number of home form points
would be 15 and the number of away form
points would be 8. Now if the other
last results inclusion was 50% then the
teams total form points would be 19 (15
+ 8*50%).
Percentage Weighting Across Divisions - this
factor is used to compensate for cup
games when one team might be playing a
team in another division. The form
points in the lower division are reduced
by this percentage value.
For example, a team in the 1st
division's form points were 15 and a
team in the 3rd division's form points
were 23, if the percentage weighting
across divisions was 60% then the 3rd
division team's form points would be
reduced to 8 (actually 8.28, 23 * 60% *
60%). Note the 60% is used twice as the
teams are two divisions apart, if the
second team was in the 2nd division then
it's points would only be reduced to 13
(actually 13.8, 23 * 60%).
The initial values set in these prediction factor
forms were 10, 5, 3, 2, 0, 100%, 25% and 75% (in
descending order), these were found to give fairly
consistent predictions for score draws, although I
am sure they could be optimized !!
The same factors were given for ten homes and five
aways predictions, no analysis of the predictions
achieved for these categories has been carried
out to indicate if improvements could be made.
6.7 NEW SEASON - This option clears all the league tables to zero,
i.e. no games played and should be used at the
start of a new season.
Only the last results are retained for use in the
pools predictions for the start of the next
season.
A warning is given asking you to confirm your
selection before all the tables are cleared.
6.8 STATUS - This option displays the number of teams and games
loaded along with the number of teams in each
division.
7. TABLES MENU
-----------
This menu shows all ten divisions with their names as entered in
the 'CUSTOMIZE' form entry pages. Any divisions that have no
teams in them are disabled so cannot be selected, the menu items
are also disabled if four windows are already open. Selection of
any other division will display the table in a window with the
teams arranged in league order, i.e. sorted by points, goal
difference, then goals scored and finally alphabetically.
To remove the table from the screen close the GEM window, click
on the top left close window icon.
8. RESULTS MENU
------------
8.1 ENTER RESULTS - This menu option is enabled when at least one
game has been entered, and enables one to enter
the results of the games.
On selecting this option one is asked for the
start game number, this will normally be the
default, 1. If changing results already entered
then it will be advisable to start at the game
that requires changing.
After pressing return, or clicking on 'OK', for
the start game number, a dialogue box will be
generated displaying the names of the teams and
allowing the input of the result.
The non-exit selectable boxes on this form are for
use if the game is not played, 'Postponed' or
'Abandoned' will ignore any result entered above.
If the result was predicted by the pools panel
then this should also be indicated by clicking the
appropriate box, the pools panel result is ignored
if the game was played.
The four exit boxes 'Cancel', 'Previous', 'Next'
and 'OK' are self-explanatory.
After entering the last result for all the games a
separate dialogue box will appear asking whether
the data should be processed. Clicking on 'Yes',
or pressing return, will enter all the results
into the teams data and adjust the league
positions accordingly. However, when this data
has been processed the predictions will change as
these games will be taken as the last ones played,
if any further analysis of how accurate the
predictions were is to be undertaken then the 'No'
box should be selected.
8.2 PROCESS RESULTS - The menu option is enabled when all the results
have been entered but not processed yet, or if the
games have been processed and subsequently
modified. See the previous paragraph for the
details on the action the program carries out in
processing results.
8.3 ANALYSE RESULTS - This menu option is enabled when all the
results have been entered. This should be
selected when all the results have been entered
and NOT processed.
A dialogue box is displayed showing various items
predicted and the actual number achieved along
with the number actual numbers. In the case of
score draws the number of actual score draws
achieved and maximum points obtained are displayed
for selections of 8 from 10 to 8 from 16.
This dialogue box gives an indication of how
accurate the pools predictions were and gives the
opportunity to optimize the prediction factors by
changing them and re-displaying this dialogue box.
8.4 PREDICT SCORE DRAWS, PREDICT HOME WINS and PREDICT AWAY WINS -
These menu options displays, in order, the most
likely games for each of these categories (using
the prediction factors supplied).
This menu option should be using when filling in a
pools coupon for the games to be played. The
numbers shown in brackets next to the teams
indicate the number of 'form' points awarded to
each team, thereby indicating how the program
arrived at these predictions.
These menu options are only available when some
games have been entered.
9. PRINTER MENU
------------
9.1 PRINT TABLES - This prints all the league tables using the
formats set in the Printer Setup dialogue box, see
9.3.
9.2 PRINT GAMES - This menu option prints all the games entered
using the formats set in the Printer Setup
dialogue box, see 9.3.
9.3 PRINTER SETUP - This menu options allows one to set up the
printer formats used in the print tables and print
games options.
Print Tables -
Init. String - the first string that is
printed when print tables option is chosen.
Heading - the string printed after the init.
string.
Sub-Heading - the string printed at the start
of each division table.
End String - the final string that is
printed when print tables option is chosen.
Print Games -
Init. String - the first string that is
printed when print games option is chosen.
Heading - the string printed after the init.
string.
Sub-Heading - the string printed at the start
of each group of games, cup or division.
End String - the final string that is
printed when print games option is chosen.
The '\' character is used to indicate a
hexidecimal number or special code. I.E.
\n or \nn - print hexidecimal number (max two
digits) where n = 0-9, A-F. The number is
assumed to be two digits long unless the
second digit is invalid in which case it is
considered a single digit. This allows
escape codes to be sent to the printer.
\g - prints current date e.g. 25th Feb 1992
(assuming your ST's internal clock is correct
!!).
\h - prints date part of current games filename as
ddth MONTH YYYY (see section 5.3 for details
of games filename).
\i - prints current division name or cup game.
\\ - prints \.
If \ is followed by an invalid special code then
the \ is ignored.
10. FUTURE ENHANCEMENTS
-------------------
I hope, in the near future to add the following features to this
program.
a) Support for medium resolution.
b) Downloading of games results from teletext using the
Microtext adapter.
c) Exporting of various predictions factors and the
corresponding actual results for spreadsheet analysis.
d) Add a self-tuning option for the prediction factors to
enhance performance.
11. ACKNOWLEDGEMENTS
----------------
Firstly, to my wife for being patient in waiting for this program
to win a million !!
This program was written in Lattice C V5, thanks to Hisoft for
such a quality product.
The resource file was created using K-Resource, thanks to Kuma
Computers.
All trademarks are acknowledged.
Finally, if you have any suggestions to improve this program, any
extra features you would like, or just to let me know that you
have won a million (or not) then please drop me a line.
Paul Newbery