HIARCS Chess Software for PC Windows, Apple Mac and iPhone/iPad Now Walking
World Championship winning computer chess software program & downloads for chess database, analysis & play on PC, Mac and iPhone

HIARCS Home Up Early Games 1983 1983: Source Code

horizontal rule


1982-1983: HIARCS 5

Following the 'O' level project which became the HIARCS chess program, my mind was made up on what my 'A' level (for those outside the UK this is the exams done at age 17/18) Computer Science project was going to be - HIARCS 5! Henceforth I will call it 0.5 to avoid confusion with commercial versions over a decade later.


According to the project documentation which I guess is a lot more accurate than my memory, version 0.5 was started in September 1982 and finished 24th March 1983.

The program was written in the BASIC+ (interpreted) programming language and ran on a PDP 11/70 located in Hatfield Polytechnic campus. This was before University, but I was allowed remote access via teletype to produce the project. Earlier while at school I had worked on a similar system to produce the first HIARCS program so I was familiar with this system. I believe the program was initially submitted through punch cards and later edited online by teletype via modem. Certainly I did this for the previous HIARCS versions in 1980/81.


The board was represented as an array (one dimensional for performance!?) with the square A1 as location 11, A8 as 18, H1 as 81 and H8 as 88.  The pieces were represented as Pawn=1, Knight=2, Bishop=3, Rook=4, Queen=5, King=6, positive numbers for computer pieces, negative for player pieces.

An offset method of move generation was used and En passant captures were computed by temporarily inserting a pawn on the En Passant square before move generation began!


The inspiration for the new HIARCS search was sought from the book Chess Skill in Man and Machine and in particular the article "The heuristic search: An alternative to the alpha-beta minimax procedure" by Larry Harris from Dartmouth College. HIARCS was still written in the relatively primitive BASIC programming language and being interpreted it meant the program was rather slow. To compensate for this I developed some heuristics to help guide the search and evaluation in a more targeted way.

The search was based on plausible (mainly tactical) moves generated and searched at plies 1, 2 and 3 with a swap-off evaluation at ply 4 giving some level of tactical security in its play. According to the documentation on its top level searching up to 4 plies HIARCS 0.5 would typically search about 350 positions/moves. Considering the average time spent per move seems to of been about 50 seconds I conclude HIARCS 0.5 was searching a massive 7 nodes (positions/moves) per second (watch out Deep Blue!? ;-) )

Ok, so how did it search to such great depths by only searching 350 positions?

HIARCS 0.5 used the following heuristics to decide which moves to search at each ply depth:

Ply 1: Generated all moves and scored them based on its position evaluation function (more later). The moves were then ordered. Interesting moves such as Checks and Captures were examined earlier than their score might otherwise indicate. It limited the moves selected even at ply 1 based on plausibility! Basically it limited the moves to analyse deeper to 2 positional moves and a selection of high interest tactical moves. If the positional moves proved to be tactically unsound within the 4 ply search horizon, HIARCS was able to reselect another positional move for further analysis.

Ply 2: Examined all check evasions, checks, captures, forks(!) and pawn promotions.

Ply 3: Examined all check evasions, captures, forks and pawn promotions.

Ply 4: Examined all threatened captures to determine swap off values to see if any material was threatened with loss.

Tactical Evaluation

Material Balance

HIARCS used the following values for the material:

Pawn = 100, Knight = 335, Bishop = 350, Rook = 500, Queen = 900, King = 15000

A material balance exchange adjustment was used which encouraged exchanging pieces when ahead in material and discouraged it when behind.

The exchange function was: value of capture = ((totalComputerMaterial / totalPlayerMaterial * valuePieceTaken) - valuePieceTaken) * 4 + valuePieceTaken

For example when a Rook up, exchanging Knights would receive a 37 point bonus.

Swap offs

Pieces attacking and guarding other pieces and squares were evaluated for exchanges which might lead to some win of material. This included the ability for HIARCS to see forks without actually searching the moves. Often the tactical conditions spotted were not guaranteed outcomes so were evaluated lower than actually winning material but enough to make HIARCS aware of tactical issues and play accordingly.

Amazingly HIARCS seems to have some code to spot pins and include this information in its tactical analysis. I am actually surprised how sophisticated it was in some respects. Please forgive me, this was a long time ago and my memory is not what it might be and despite being written in BASIC it is nice to see some concepts already included.

Check and Mate!

HIARCS had special subroutines (Gosub - remember that?) that could compute check evasions based on:

bulletCapture Checking Piece
bulletMove King
bulletTry interposing check

HIARCS used this routine to also spot checkmate much earlier than it could based on its normal search.

Position Evaluation


Advancing bonus: (rank - 2) * file bonus    where file bonus is {1, 0, 4, 6, 7, 3, 0, 0}

Some other limited evaluation but nothing one could call a pawn structure eval!


Evaluated for Centre closeness: (8 - abs(4.5 - rank) *2 - abs(4.5-file)) * 2

For example a knight move Ng1f3 received a bonus of 10.

Evaluated for enemy King closenesss: 5 - sum of rank and file distance to enemy king

There were further development bonuses for vacating the back rank and a special fork bonus to encourage forking pieces (even if the search could no resolve the outcome).


Bishops were penalised for being on the back rank similar to knights.

Bishop mobility was computed as: number of moves * 2 - 7


Rooks received many bonuses and penalties covering:

bulletSquare control/mobility
bulletEnemy king closeness
bulletOpen and semi-open files
bulletRook on kings rank -1 bonus - e.g. rook on the 7th
bulletAttack bonus for attacking enemy pawns and pieces


Queens were evaluated for:

bulletEnemy king closeness
bulletAttack bonus


The King received rewards for

bulletCloseness to edge or centre or target pawns!


Source Code!

I hope to make the full BASIC source code to HIARCS 3 and 5 (0.3 and 0.5) available on the website in the near future. I also want to offer a prize to the first person to get these very old HIARCS versions working again on PC. The listings will be complete and they certainly worked in 1981 and 1983 (although there may of been the odd bug in there of course) so it should be possible to make them work again on PC.

I believe the source code is about 600 lines long and used to fit in 16Kb if my memory serves. I will try and scan the source code in this week and upload it for all to view. Don't expect a well structured modular source code, its quite tangled but does have some comments which is more than can be said for some of my other software! ;-)


Games played in early 1983

You can play through some of the games played by the HIARCS 0.5 version in early 1983 here. In these games HIARCS was running on a PDP11/70 located in Hatfield Polytechnic while I was operating the program via teletype in Welwyn Garden City College Campus in February/March 1983.


horizontal rule

"generally I use HIARCS." - Five time World Chess Champion Vishy Anand, in a recent interview when asked what chess program he uses to analyse with
"HIARCS is much better positionally than Deep Blue." - Garry Kasparov 1997 (after game 5 of the rematch)

World Chess Champion, Vishy Anand, used "Powerful" HIARCS machine in preparations for his 2010 & 2012 world title matches

"This level of service is one other big reason to buy HIARCS." - John Jackson

Highest performance reached depends on computer used. Computer Chess Software with world class chess engine playing strength.
HIARCS is designed and developed by Mark Uniacke in England.

*VAT and local sales tax may be applicable. Prices given in GBP, USD and EUR and subject to change without notice.
Other currencies are subject to conversion rates from GBP.

HIARCS is a trademark of Applied Computer Concepts Ltd. All other product trademarks acknowledged.
Copyright 1991-2019 Applied Computer Concepts Ltd. All rights reserved. Last modified: Tuesday November 19, 2019.
Email the HIARCS Team: . Please read our
Privacy Policy here