Ashish Schottky wrote:
Can any one pleas explain me why did the author of this program choose numbers like 156,13 and what is so special in number'13' as field column is incremented by 13
The 2 dimensional board is simply being stored within a 1 dimensional array.
The edges of the board are just marked with a border value.
Doing this is a good idea and I remember suggesting that you do this to (my post on 5 Apr)
Imagine this is the array holding the board below.
The # is part of the border.
The O and X are pieces played.
To look at a square above another square just add 13.
To hold the whole array requires an array of size 156.
I have no idea why the borders 3 pieces deep as this is very inefficient.
Ashish Schottky wrote:
Also then I found this confusing, I know this is related to directions but then I could only get 9.
These are variables to hold the number of squares to move in each direction when looking for possible lines.
He's using separate checks to look in each direction instead of just having one simple loop.
This results in much duplication in his code and again it's an inefficient method.
The field array just holds the next available move on any column.
Ashish Schottky wrote:
I am unable to understand the language that is used to comment.
That's because it's German - you can translate it using babel fish if you need to.
Ashish Schottky wrote:
But program by itself is just too good...
Really? it lost quite easily to me on the first game though it did play better on it's second game but it offers no facilities to change the level or take back moves or let the computer play first. Perhaps you'd do better copying all the code and just adding these features to it?