SQL

Thursday, 26 February 2015

Array and memory location

/*!
 * file ArrayReference.cpp
 * author Hasan
 * date 20 June 2014 14:41:04 
 * This exercise shows that even the array get sorted
 * but Memory  location is the same
 */
#include <iostream>
#include <iomanip>
#include <ctime>
 
using namespace std;
 
void printArray2(int[]);
const int SIZE = 5;
 
int main(){
 int array[SIZE] = { 3,1,4,6,5};
 
 cout << "Array & Memory Reference\n";
 printArray2(array);
 printArray2(array);
 cin.get();
 return 0;
}
void printArray2(int a[SIZE]){
 for (int i = 0; i < SIZE; i++){
  cout << setw(10) << a[i];
 
 }
 cout << endl;
 for (int i = 0; i < SIZE; i++){
  cout << setw(10) << &a[i];
  for (int j = 1; j < SIZE-i; j++){
   if (a[i]>a[i+1]){
    int temp = a[i];
    a[i] = a[i+1];
    a[i+1] = temp;
    
   }
  }
 }
 cout << endl;
}

output:
Array & Memory Reference
         3         1         4         6         5
  00F7FE90  00F7FE94  00F7FE98  00F7FE9C  00F7FEA0
         1         3         4         5         6
  00F7FE90  00F7FE94  00F7FE98  00F7FE9C  00F7FEA0

Bucket Sort in C++

/* Bucket Sort
Created by using MS2013
Coded by M. Hasan
(Bucket Sort) A bucket sort begins with a single-subscripted array of positive integers to be sorted and a double-subscripted
array of integers with rows subscripted from 0 to 9 and columns subscripted from 0 to n - 1, where n is the number of values in the
array to be sorted. Each row of the double-subscripted array is referred to as a bucket. Write a function bucketSort that takes an
integer array and the array size as arguments and performs as follows:
a) Place each value of the single-subscripted array into a row of the bucket array based on the value’s ones digit. For example,
97 is placed in row 7, 3 is placed in row 3 and 100 is placed in row 0. This is called a “distribution pass.”
b) Loop through the bucket array row by row, and copy the values back to the original array. This is called a “gathering
pass.” The new order of the preceding values in the single-subscripted array is 100, 3 and 97.
c) Repeat this process for each subsequent digit position (tens, hundreds, thousands, etc.).
On the second pass, 100 is placed in row 0, 3 is placed in row 0 (because 3 has no tens digit) and 97 is placed in row 9. After the
gathering pass, the order of the values in the single-subscripted array is 100, 3 and 97. On the third pass, 100 is placed in row 1, 3
is placed in row zero and 97 is placed in row zero (after the 3). After the last gathering pass, the original array is now in sorted
order.
Note that the double-subscripted array of buckets is 10 times the size of the integer array being sorted. This sorting technique
provides better performance than a bubble sort, but requires much more memory. The bubble sort requires space for only one additional
element of data. This is an example of the space–time trade-off: The bucket sort uses more memory than the bubble sort, b ut
performs better. This version of the bucket sort requires copying all the data back to the original array on each pass. Another possibility
is to create a second double-subscripted bucket array and repeatedly swap the data between the two bucket arrays.
*/
#include <iostream>
#include <iomanip>
using namespace std;
 
const int SIZE = 12;
int array[SIZE] = { 21, 43, 75, 23, 12, 5, 7, 28, 34, 65, 3, 82 };
 
void bucketSort(int[]);
int numberOfDigits(int[], int);
void distributeElements(int[], int[][SIZE], int);
void collectElements(int[], int[][SIZE]);
void zeroBucket(int[][SIZE]);
void printArray(int[]);
 
int main(){
 cout << "Array in actual order" << endl;
 printArray(array);
 bucketSort(array);
 printArray(array);
 return 0;
}
void printArray(int a[SIZE]){
 for (int i = 0; i < SIZE; i++)
  cout << setw(4) << a[i];
 cout << endl;
}
void bucketSort(int a[]){
 int totalDigits, bucket[10][SIZE] = { 0 };
 totalDigits = numberOfDigits(a, SIZE);
 
 for (int i = 1; i <= totalDigits; i++){
 
  distributeElements(a, bucket, i);
  collectElements(a, bucket);
  if (i != totalDigits)
   zeroBucket(bucket);
 }
}
//Determine the number of digits in the largest number
int numberOfDigits(int a[], int arraySize){
 int digit = 0;
 int largest = a[0];
 for (int i = 1; i < arraySize; i++)
  if (a[i] > largest)
   largest = a[i];
 
 while (largest != 0){
  digit++;
  largest = largest / 10;
 }
 return digit;
}
void distributeElements(int a[], int bucket[][SIZE], int digit){
 int divisor = 10;
 int bucketNumber, elementNumber;
 
 for (int i = 1; i < digit; i++)//determine the divisor
  divisor *= 10;    //get the specific digit
 
 for (int i = 0; i < SIZE; i++){
  //bucketNumber Example for 100 digits:
  //(1234 % 1000 - 1234 % (1000 / 10)) / (1000/10)
  //(234-34)/100 =2
  bucketNumber = (a[i] % divisor - a[i] % (divisor / 10)) / (divisor / 10);
  //Retrieve value in bucket[bucketNumber][0] to determine 
  //which element of the row to store a[i] in
  elementNumber = ++bucket[bucketNumber][0];
  bucket[bucketNumber][elementNumber] = a[i];
  cout << setw(4) << a[i]; //for debug perpose
  if (i == 11)
   cout << endl << endl;//for debug perpose
 }
}
void collectElements(int a[], int bucket[][SIZE]){
 int subscript = 0;
 for (int i = 0; i < 10; i++)
  for (int j = 1; j <= bucket[i][0]; j++)//j cannot start from 0 why?
   a[subscript++] = bucket[i][j];
 printArray(array);//for debug perpose
}
void zeroBucket(int bucket[][SIZE]){
 for (int i = 0; i < 10; i++)
  for (int j = 0; j < SIZE; j++)
   bucket[i][j] = 0;
}
output:
Array in actual order
  21  43  75  23  12   5   7  28  34  65   3  82
  21  43  75  23  12   5   7  28  34  65   3  82

  21  12  82  43  23   3  34  75   5  65   7  28
  21  12  82  43  23   3  34  75   5  65   7  28

   3   5   7  12  21  23  28  34  43  65  75  82
   3   5   7  12  21  23  28  34  43  65  75  82

Wednesday, 25 February 2015

Eight Queens puzzle C++

#include <iostream>
#include <iomanip>
#include <ctime>
using namespace std;
const int S = 8;
bool validMove1(intintchar[][S]);
bool isEmpty(char[][S]);
int counter1 = 0;
void printBoard1(char[8][8]);
char board1[8][8] = { '\0' };
int r1, c1;
int m1 = 0;
bool done1 = false;
int main(){
 srand(time(0));
 int row = rand() % 8;
 int column = rand() % 8;
 while (isEmpty(board1))
 {
  if (validMove1(row, column, board1))
  {
   // Y axis
   for (int i = 0; i < S; ++i){
    board1[i][column] = '*';
 
   }
   //X axis
   for (int j = 0; j < S; ++j){
    board1[row][j] = '*';
 
   }
   //diagonal right top
   for (int j = 1; j < 8 - column; j++)
   {
    board1[row - j][column + j] = '*';
 
   }
   //diagonal left bottom
   for (int j = 1; j <= column; j++){
    board1[row + j][column - j] = '*';
 
   }
   //diagonal right bottom
   for (int j = 1; j < 8 - column; j++){
    board1[row + j][column + j] = '*';
 
   }
   //diagonal left top
   for (int j = 1; j <= column; j++){
    board1[row - j][column - j] = '*';
 
 
   }
   board1[row][column] = 'Q'; 
  }
  row = rand() % 8;
  column = rand() % 8;
  counter1++;
 }
 
 printBoard1(board1);
 printf("\n\n\n Total loop = %d",counter1);
 cin.get();
 return 0;
}
 
void printBoard1(char board1[8][8]){
 for (int row = 0; row < S; ++row){
  for (int col = 0; col < S; ++col)
  {
   cout << setw(3) << board1[row][col];
   
  }
  cout << '\n';
 }
}
 
bool validMove1(int r2int c2char board2[][S])
{
 // NOTE: This test stops as soon as it becomes false
 return (r2 >= 0 && r2 < S && c2 >= 0 && c2 < S
  && board2[r2][c2] == '\0'&& board2[r2][c2] != '*');
}
bool isEmpty(char board[][8])
 
{
 for (int r3 = 0; r3 < 8; ++r3)
  for (int c3 = 0; c3 < 8; ++c3)
   if (board[r3][c3] == '\0')
    return true// at least one open square is available
 
 return false// no available squares
}



Output:

  *  *  *  *  *  Q  *  *
  *  *  *  Q  *  *  *  *
  *  *  *  *  *  *  Q  *
  Q  *  *  *  *  *  *  *
  *  *  *  *  *  *  *  Q
  *  *  *  *  Q  *  *  *
  *  Q  *  *  *  *  *  *
  *  *  *  *  *  *  *  *



 Total loop = 707406462

Monday, 23 February 2015

Create asterisk of asterisk in C++

#include <iostream>
#include <iomanip>
#include <ctime>
using namespace std;
const int S = 8;
int counter1 = 0;
void printBoard1(char[8][8]);
char board1[8][8] = { '\0' };
 

int main(){
 
 int row = 3;
 int column = 4;
 
  for (int i = 0; i < S; ++i){
   board1[i][column] = '*';
 
  }
  for (int j = 0; j < S; ++j){
   board1[row][j] = '*';
 
  }
 
  //diagonal right top
  for (int j = 1; j < 8 - column; j++)
  {
 
   board1[row - j][column + j] = '*';
 
  }
 
  //diagonal left bottom
  for (int j = 1; j < column; j++){
   board1[row + j][column - j] = '*';
 
 
  }
  //diagonal right bottom
  for (int j = 1; j < 8 - column; j++){
   board1[row + j][column + j] = '*';
 
  }
  //diagonal left top
  for (int j = 1; j <= column; j++){
   board1[row - j][column - j] = '*';
 
 
  }
 
 
 
 
 printBoard1(board1);
 cin.get();
 return 0;
}
 
void printBoard1(char board1[8][8])
{
 for (int row = 0; row < S; ++row)
 {
  for (int col = 0; col < S; ++col)
   {
   cout << setw(3) << board1[row][col];
 
   }
  cout << '\n';
 }
}
 





output:

     *        *        *
        *     *     *
           *  *  *
  *  *  *  *  *  *  *  *
           *  *  *
        *     *     *
     *        *        *
              *

Tuesday, 17 February 2015

knight's tour Maximum Access

// Exercise 4.24 Part C Solution
// Knight's Tour - access version
// runs one tour
/*
 Now write a version of the Knight’s Tour program using the accessibility heuristic. At any time, the knight should
move to the square with the lowest accessibility number. In case of a tie, the knight may move to any of the tied
squares. Therefore, the tour may begin in any of the four corners. (Note: As the knight moves around the chessboard,
your program should reduce the accessibility numbers as more and more squares become occupied. In this way, at any
given time during the tour, each available square’s accessibility number will remain equal to precisely the number of
squares from which that square may be reached.) Run this version of your program. Did you get a full tour? Now modify
the program to run 64 tours, one starting from each square of the chessboard. How many full tours did you get?
*/



#include <iostream>
#include <cstdlib>
#include <ctime>
#include <iomanip>
using namespace std;
 
const int SIZE = 8;
void clearBoard(int[][SIZE]);
void printBoard(const int[][SIZE]);
void printAccess(const int[][SIZE]);
bool validMove(intintconst int[][SIZE]);
 
int main()
{
 int board[SIZE][SIZE], currentRow, currentColumn, moveNumber = 0,
 
  access[SIZE][SIZE] = { 2, 3, 4, 4, 4, 4, 3, 2,
          3, 4, 6, 6, 6, 6, 4, 3,
          4, 6, 8, 8, 8, 8, 6, 4,
          4, 6, 8, 8, 8, 8, 6, 4,
          4, 6, 8, 8, 8, 8, 6, 4,
          4, 6, 8, 8, 8, 8, 6, 4,
          3, 4, 6, 6, 6, 6, 4, 3,
          2, 3, 4, 4, 4, 4, 3, 2 },
 
  testRow, testColumn, minRow, minColumn,
  minAccess = 9, accessNumber,
  horizontal[SIZE] = { 2, 1, -1, -2, -2, -1, 1, 2 },
  vertical[SIZE] = { -1, -2, -2, -1, 1, 2, 2, 1 };
 bool done;
 
 srand(time(0));
 
 clearBoard(board); // initialize array board
 currentRow = rand() % 8;
 currentColumn = rand() % 8;
 board[currentRow][currentColumn] = ++moveNumber;
 done = false;
 
 while (!done) {
  accessNumber = minAccess;
 
  for (int moveType = 0; moveType < SIZE; ++moveType) {
  testRow = currentRow + vertical[moveType];
  testColumn = currentColumn + horizontal[moveType];
  
  if (validMove(testRow, testColumn, board)) {
 
  if (access[testRow][testColumn] < accessNumber) {
   accessNumber = access[testRow][testColumn];
     
     minRow = testRow;
     minColumn = testColumn;
 
    }
 
    --access[testRow][testColumn];
 
   }
 
  }
 
  if (accessNumber == minAccess)
  {
   done = true;
   printf("minAccess =  %d",minAccess);
   printf("\n\n");
   printf("\n*********************************\n");
   printAccess(access);
 
   printf("\n*********************************\n");
  }
  else {
   currentRow = minRow;
   currentColumn = minColumn;
   board[currentRow][currentColumn] = ++moveNumber;
   printf("\n\n");
   printBoard(board);
   printf("\n\n");
   printAccess(access);
 
  }
 
 }
 
 cout << "The tour ended with " << moveNumber << " moves.\n";
 
 if (moveNumber == 64)
  cout << "This was a full tour!\n\n";
 else
  cout << "This was not a full tour.\n\n";
 cout << "The board for this test is:\n\n";
 printBoard(board);
 printf("\n\n");
 printAccess(access);
 cin.get();
 return 0;
 
}
 
void clearBoard(int workBoard[][SIZE])
{
 for (int row = 0; row < SIZE; ++row)
  for (int col = 0; col < SIZE; ++col)
   workBoard[row][col] = 0;
}
void printBoard(const int workBoard[][SIZE])
{
 //cout << " 0 1 2 3 4 5 6 7\n";
 
 for (int row = 0; row < SIZE; ++row) {
  //cout << row;
 
  for (int col = 0; col < SIZE; ++col)
   cout << setw(3) << workBoard[row][col];
 
  cout << '\n';
 
 }
 
 cout << endl;
}
 
void printAccess(const int workAccess[][SIZE])
{
 //cout << " 0 1 2 3 4 5 6 7\n";
 
 for (int row = 0; row < SIZE; ++row) {
  //cout << row;
 
  for (int col = 0; col < SIZE; ++col)
   cout << setw(3) << workAccess[row][col];
 
  cout << '\n';
 
 }
 
 cout << endl;
}
 
 
bool validMove(int rowint columnconst int workBoard[][SIZE])
{
 // NOTE: This test stops as soon as it becomes false
 return (row >= 0 && row < SIZE && column >= 0 && column < SIZE
  && workBoard[row][column] == 0);
}

Sunday, 15 February 2015

Eular's Knight Tour in C++


                                                          Eular's Knight Tour

This is the start to understanding the board.There is not much to describe here unless you are new to array
#include <iostream>
#include <iomanip>
#include <time.h>
using namespace std;
int chessBoard1[8][8] = { 0 };
 
int counter = 0;
int main(void){
 chessBoard1[2][6] = 1;
 chessBoard1[2][2] = 2;
 for (int i = 0; i < 8; i++) 
 {
  for (int j = 0; j < 8; j++)
  {
   printf("%2d ",  chessBoard1[i][j]);
   
  }
 cout << "\n";
 }
 cin.get();
}
The out put is:
 0  0  0  0  0  0  0  0
 0  0  0  0  0  0  0  0
 0  0  2  0  0  0  1  0
 0  0  0  0  0  0  0  0
 0  0  0  0  0  0  0  0
 0  0  0  0  0  0  0  0
 0  0  0  0  0  0  0  0
 0  0  0  0  0  0  0  0

As we understand the board array now we can proceed..

/*


Author: M Hasan
Date: 16/2/2015 11:51:08 AM
Description:
(Knight’s Tour) One of the more interesting puzzlers for chess buffs is the Knight's Tour problem, originally proposed by
the mathematician Euler. The question is this: Can the chess piece called the knight move around an empty chessboard and touch
each of the 64 squares once and only once? We study this intriguing problem in depth here.
The knight makes L-shaped moves (over two in one direction and then over one in a perpendicular direction). Thus, from a
square in the middle of an empty chessboard, the knight can make eight different moves (numbered 0 through 7) as shown in
Fig. 6.25.
a) Draw an 8-by-8 chessboard on a sheet of paper and attempt a Knight's Tour by hand. Put a 1 in the first square you
move to, a 2 in the second square, a 3 in the third, etc. Before starting the tour, estimate how far you think you will get,
remembering that a full tour consists of 64 moves. How far did you get? Were you close to the estimate?

b) Now let us develop a program that will move the knight around a chessboard. The board itself is represented by an 8-
by-8 double-subscripted array board. Each of the squares is initialized to zero. We describe each of the eight possible
moves in terms of both their horizontal and vertical components. For example, a move of type 0 as shown in Fig. 6.25
consists of moving two squares horizontally to the right and one square vertically upward. Move 2 consists of moving
one square horizontally to the left and two squares vertically upward. Horizontal moves to the left and vertical moves
upward are indicated with negative numbers. The eight moves may be described by two single-subscripted arrays, horizontal
and vertical, as follows:

horizontal[ 0 ] = 2
horizontal[ 1 ] = 1
horizontal[ 2 ] = -1
horizontal[ 3 ] = -2
horizontal[ 4 ] = -2
horizontal[ 5 ] = -1
horizontal[ 6 ] = 1
horizontal[ 7 ] = 2

vertical[ 0 ] = -1
vertical[ 1 ] = -2
vertical[ 2 ] = -2
vertical[ 3 ] = -1
vertical[ 4 ] = 1
vertical[ 5 ] = 2
vertical[ 6 ] = 2
vertical[ 7 ] = 1

Let the variables currentRow and currentColumn indicate the row and column of the knight's current position on
the board. To make a move of type moveNumber, where moveNumber is between 0 and 7, your program uses the
statements

currentRow += vertical[ moveNumber ];
currentColumn += horizontal[ moveNumber ];

Keep a counter that varies from 1 to 64. Record the latest count in each square the knight moves to. Remember to test
each potential move to see if the knight has already visited that square. And, of course, test every potential move to
make sure that the knight does not land off the chessboard. Now write a program to move the knight around the chessboard.
Run the program. How many moves did the knight make?
*/
//To make it simple we will end the run when Best move is over 55

/*****************header.h*****************************
****************************************************/
int totalGame = 0;
int counter = 0;
//the array which holds the biggest record
int recordHolder[8][8] = { 0 };
int flag = 0;
int moveNumber = 0;// moveNumberB1=0, moveNumberB2=0, moveNumberB3=0;
int m = 1;
//These two single subscript arrays will be used to move the knight as L shape according to array subscript
int horizontal[8];
int vertical[8];
//Knight's valid movement
 
//declare currrent position
int currentRow;
int currentColumn;
//8x8 Chessboard
int chessBoard[8][8] = { 0 };

/**********************************************************************/
/*****************************function.h**************************/

#include "header.h"
 
void clearChessBoard(void){
 
 int i, j;
 
 for (i = 0; i < 8; i++)
 {
  for (j = 0; j < 8; j++)
  {
   chessBoard[i][j] = 0;
  }
 }
 
}
 
void initialize(){
 
 flag = 0;
 clearChessBoard();
 currentColumn = rand() % 8;
 currentRow = rand() % 8;
 chessBoard[currentRow][currentColumn] = 1;
 counter = 1, m = 0;
 
}
 
int randomiseMovement(void){
 
 return rand() % 8;
 
}
int validOrNot(int mn){
 
 return (
  chessBoard[currentRow + vertical[mn]][currentColumn + horizontal[mn]] == 0
  &&
  (currentRow + vertical[mn]) >= 0
  &&
  (currentRow + vertical[mn])<8
  &&
  (currentColumn + horizontal[mn]) >= 0
  &&
  (currentColumn + horizontal[mn]) <8);
 
}
void moveKnight(int moveno){
 
 currentRow += vertical[moveno];
 currentColumn += horizontal[moveno];
 //printf("Knight has moved to chessBoard[%d][%d].\n", currentRow, currentColumn);
 counter++;
 //printf("Move count is %d.\n", counter);
 chessBoard[currentRow][currentColumn] = counter;
 
}
int isThereEmptyLocationAround(){
 int i;
 for (i = 0; i < 8; i++)
 {
  if (validOrNot(i))
   return 1;
 }
 return 0;
}
 
 
void printRecordArray(int b[][8]){
 
 int i, j;
 printf("\n BIGGEST RECORDED ARRAY IS: \n");
 printf("\n");
 for (i = 0; i < 8; i++)
 {
  printf("\n");
  for (j = 0; j < 8; j++)
  {
   printf("%2d "b[i][j]);
 
  }
 }
 
 printf("\n");
}
 
void copyRecordArray(int b[][8]){
 
 int i, j;
 
 for (i = 0; i < 8; i++)
 {
  for (j = 0; j < 8; j++)
  {
   recordHolder[i][j] = b[i][j];
  }
 }
 
}
int printBoard(void){
 totalGame++;
 int i, j, onesCount = 0;
 printf("\n");
 for (i = 0; i < 8; i++)
 {
  printf("\n");
  for (j = 0; j < 8; j++)
  {
   printf("%2d ", chessBoard[i][j]);
   if (chessBoard[i][j]>0)
    onesCount++;
  }
 }
 return onesCount;
 
}
/**************************main.cpp**********************************/
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <time.h>
#include "function.h";
using namespace std;
 
 
int main(void){
 initialize();
 int biggestCoverage = 0;
 
 //initialize horizontal move of knight
 horizontal[0] = 2;
 horizontal[1] = 1;
 horizontal[2] = -1;
 horizontal[3] = -2;
 horizontal[4] = -2;
 horizontal[5] = -1;
 horizontal[6] = 1;
 horizontal[7] = 2;
 
 //intialize vertical move of the knight
 vertical[0] = -1;
 vertical[1] = -2;
 vertical[2] = -2;
 vertical[3] = -1;
 vertical[4] = 1;
 vertical[5] = 2;
 vertical[6] = 2;
 vertical[7] = 1;
 
 srand(time(NULL));
 
 printf("================================================================================\n");
 
 
 while (biggestCoverage <= 55)
 {
 
  initialize();
 
  moveNumber = randomiseMovement();
  printf("Move randomised to: %d\n", moveNumber);
 
  printf("============================================================================\n");
  printf("STARTING POS IS: [%d][%d]\n", currentRow, currentColumn);
 
  do {
 
   //First check if moveNumber position is available 
   //Then move the knight accordingly
   if (validOrNot(moveNumber))
    moveKnight(moveNumber);
   else if (isThereEmptyLocationAround())
   {
    moveNumber = randomiseMovement();
   }
   else
   {
    flag = -1;
   }
  } while (flag != -1);
 
  m = printBoard();
  printf("\n\nTotal move = %d",m);
  printf("\n\nTotal Game Board = %d", totalGame);
  if (m>biggestCoverage){
   biggestCoverage = m;
   copyRecordArray(chessBoard);
 
  }
  printf("\n\nBest Move: %d\n", biggestCoverage);
  printRecordArray(recordHolder);
  
 }
 
 printf("\n");
  cin.get();
 
}
/*****************************output***********************************/
......................
......................
0  0  0 19  8  0  0 37

Total move = 37

Total Game Board = 10

Best Move: 46

 BIGGEST RECORDED ARRAY IS:


 0 29 34  0 26 31  0  0
 0  4 27 30 33  0 25 12
28 35  0  3 38 13 32  0
 5  0 37 14  0  2 11 24
36 15  6 39 18 23  0  1
 0 42 17 22  7 10 45  0
16 21 40  0 44 19  8  0
41  0 43 20  9  0  0 46
Move randomised to: 3
============================================================================
STARTING POS IS: [5][3]


 0  0 43 26 47  6 21  0
44 25 46  0  0 27 48  7
 0 42  0 24  5 20  0 22
14 45  0  0 28 23  8 33
41  2 13  4 19 34 29  0
 0 15 18  1 12  9 32 37
17 40  3  0 35 38 11 30
 0  0 16 39 10 31 36  0

Total move = 48

Total Game Board = 11

Best Move: 48

 BIGGEST RECORDED ARRAY IS:


 0  0 43 26 47  6 21  0
44 25 46  0  0 27 48  7
 0 42  0 24  5 20  0 22
14 45  0  0 28 23  8 33
41  2 13  4 19 34 29  0
 0 15 18  1 12  9 32 37
17 40  3  0 35 38 11 30
 0  0 16 39 10 31 36  0
Move randomised to: 3
============================================================================
STARTING POS IS: [0][6]


 0  0  0 10  0  0  1 32
 0 11  0  0  2 29  0  0
 0  0  3 12  9  0 31  0
 4  0 22  0 30 13 28  0
23  0  5  0  0  8  0 14
18  0 24 21  6 15  0 27
 0  0 19 16 25  0  7  0
 0 17  0  0 20  0 26  0

Total move = 32

Total Game Board = 12

Best Move: 48

 BIGGEST RECORDED ARRAY IS:


 0  0 43 26 47  6 21  0
44 25 46  0  0 27 48  7
 0 42  0 24  5 20  0 22
14 45  0  0 28 23  8 33
41  2 13  4 19 34 29  0
 0 15 18  1 12  9 32 37
17 40  3  0 35 38 11 30
 0  0 16 39 10 31 36  0
Move randomised to: 2
============================================================================
STARTING POS IS: [4][1]


 0  0 12  0  4  0  0  0
11  0  3  0  0 20 23  0
 2 13  0 31  0  5  0 21
 0 10  0  0  0 22 19 24
14  1 32  9 30 25  6  0
33  0 15 26  0  8 37 18
 0 27  0 35 16 29  0  7
 0 34  0 28  0 36 17 38

Total move = 38

Total Game Board = 13

Best Move: 48

 BIGGEST RECORDED ARRAY IS:


 0  0 43 26 47  6 21  0
44 25 46  0  0 27 48  7
 0 42  0 24  5 20  0 22
14 45  0  0 28 23  8 33
41  2 13  4 19 34 29  0
 0 15 18  1 12  9 32 37
17 40  3  0 35 38 11 30
 0  0 16 39 10 31 36  0
Move randomised to: 5
============================================================================
STARTING POS IS: [0][5]


 0 15  0  0  0  1 12  0
 0  0  0 14 11  0  0  0
 6  0 16  0  2 13  0  0
 0  0  7  0 17 10  0  0
 0  5  0  3  8  0 18  0
 0  0  0  0  0  0  9  0
 0  0  4  0  0 19  0  0
 0  0  0  0  0  0  0 20

Total move = 20

Total Game Board = 14

Best Move: 48

 BIGGEST RECORDED ARRAY IS:


 0  0 43 26 47  6 21  0
44 25 46  0  0 27 48  7
 0 42  0 24  5 20  0 22
14 45  0  0 28 23  8 33
41  2 13  4 19 34 29  0
 0 15 18  1 12  9 32 37
17 40  3  0 35 38 11 30
 0  0 16 39 10 31 36  0
Move randomised to: 0
============================================================================
STARTING POS IS: [5][3]


 0  6 15  0  0  0  0 32
 0  0  0  5 14 31 22  0
 7  0  0 16 23  4 13  0
 0  0 24  0 12 21 30  3
25  8 11  0 17  2  0  0
10  0 26  1  0  0 20 29
 0  0  9  0 27 18  0  0
 0  0  0  0  0  0 28 19

Total move = 32

Total Game Board = 15

Best Move: 48

 BIGGEST RECORDED ARRAY IS:


 0  0 43 26 47  6 21  0
44 25 46  0  0 27 48  7
 0 42  0 24  5 20  0 22
14 45  0  0 28 23  8 33
41  2 13  4 19 34 29  0
 0 15 18  1 12  9 32 37
17 40  3  0 35 38 11 30
 0  0 16 39 10 31 36  0
Move randomised to: 2
============================================================================
STARTING POS IS: [4][7]


42  0  0  0  0  3 32  0
 0  0 41  4 33  0  9 18
 0  5 34  0  8 17  2 31
35  0  7 40  0 10 19 16
 6 39  0  0 26 15 30  1
23 36  0 14 11 20 27  0
38 13 22 25  0  0  0 29
 0 24 37 12 21 28  0  0

Total move = 42

Total Game Board = 16

Best Move: 48

 BIGGEST RECORDED ARRAY IS:


 0  0 43 26 47  6 21  0
44 25 46  0  0 27 48  7
 0 42  0 24  5 20  0 22
14 45  0  0 28 23  8 33
41  2 13  4 19 34 29  0
 0 15 18  1 12  9 32 37
17 40  3  0 35 38 11 30
 0  0 16 39 10 31 36  0
Move randomised to: 3
============================================================================
STARTING POS IS: [4][7]


 0  0 14  0 24 11  0  0
15  4 25 12  0  0  0 10
26 13 16  3 32 23  0  0
37  0  5  0 17  2  9 22
 0 27 36 31  0 33 18  1
 0 30  0  6 35  8 21  0
 0  0 28  0  0  0 34 19
29  0  0  0  7 20  0  0

Total move = 37

Total Game Board = 17

Best Move: 48

 BIGGEST RECORDED ARRAY IS:


 0  0 43 26 47  6 21  0
44 25 46  0  0 27 48  7
 0 42  0 24  5 20  0 22
14 45  0  0 28 23  8 33
41  2 13  4 19 34 29  0
 0 15 18  1 12  9 32 37
17 40  3  0 35 38 11 30
 0  0 16 39 10 31 36  0
Move randomised to: 2
============================================================================
STARTING POS IS: [5][0]


 0  0  0  0  0 19  0  0
 0  0  3 18  0  0  0  0
 4  0  0  0 20  0  0  0
 0  2  5  0 17  0  0  8
12  0  0 21  6  9 24  0
 1 28 13 10 23 16  7  0
 0 11 22 27 14  0  0 25
29  0  0  0  0 26 15  0

Total move = 29

Total Game Board = 18

Best Move: 48

 BIGGEST RECORDED ARRAY IS:


 0  0 43 26 47  6 21  0
44 25 46  0  0 27 48  7
 0 42  0 24  5 20  0 22
14 45  0  0 28 23  8 33
41  2 13  4 19 34 29  0
 0 15 18  1 12  9 32 37
17 40  3  0 35 38 11 30
 0  0 16 39 10 31 36  0
Move randomised to: 0
============================================================================
STARTING POS IS: [3][0]


36 33  0  0 14 55  4  0
 0  0 35 32  3 24 15 56
34 37  2 25 16 13 54  5
 1 26 17 50 31  6 23 44
18 49 38  7 42 45 12 53
27  8 19 46 51 30 43 22
48 39 28  9 20 41 52 11
 0  0 47 40 29 10 21  0

Total move = 56

Total Game Board = 19

Best Move: 56

 BIGGEST RECORDED ARRAY IS:


36 33  0  0 14 55  4  0
 0  0 35 32  3 24 15 56
34 37  2 25 16 13 54  5
 1 26 17 50 31  6 23 44
18 49 38  7 42 45 12 53
27  8 19 46 51 30 43 22
48 39 28  9 20 41 52 11
 0  0 47 40 29 10 21  0