diff -rupN tscp181/defs.h tscp181-mod/defs.h
--- tscp181/defs.h	2003-01-30 00:11:00.000000000 +0100
+++ tscp181-mod/defs.h	2013-05-25 16:37:12.807116519 +0200
@@ -12,7 +12,8 @@
 
 #define GEN_STACK		1120
 #define MAX_PLY			32
-#define HIST_STACK		400
+//#define HIST_STACK		400
+#define HIST_STACK		0x100000
 
 #define LIGHT			0
 #define DARK			1
diff -rupN tscp181/main.c tscp181-mod/main.c
--- tscp181/main.c	2003-02-05 01:02:40.000000000 +0100
+++ tscp181-mod/main.c	2013-05-25 16:37:12.803116448 +0200
@@ -29,7 +29,7 @@ int get_ms()
 	return (timebuffer.time * 1000) + timebuffer.millitm;
 }
 
-
+#if 0
 /* main() is basically an infinite loop that either calls
    think() when it's the computer's turn to move or prompts
    the user for a command (and deciphers it). */
@@ -155,6 +155,7 @@ int main()
 	close_book();
 	return 0;
 }
+#endif
 
 
 /* parse the move s (in coordinate notation) and return the move's
diff -rupN tscp181/patch.c tscp181-mod/patch.c
--- tscp181/patch.c	1970-01-01 01:00:00.000000000 +0100
+++ tscp181-mod/patch.c	2013-05-25 16:48:36.855279665 +0200
@@ -0,0 +1,151 @@
+// This is a quick and dirty hack on Tom Kerrigan's chess program.
+//
+// You can find Tom Kerrigan's original program on:
+//   * http://www.tckerrigan.com/Chess/TSCP
+//   
+// The modification let the program play again itself, wherby each move
+// is randomly chosen. There was a discussion in the mikrocontroller
+// forum about the results of such random chess games. So here it is. 
+//
+// Please read the forum thread for more information:
+//   * http://www.mikrocontroller.net/topic/297388#new
+//
+// The program was compiled and tested on Debian Squeeze with GCC 4.4.5.
+//
+// Make:
+//   > gcc -Wall -O2 -o tscp *.c
+//
+// Synopsis:
+//   1: tscp
+//   2: tscp seed
+//   
+// The first command let the program play again itself in an endless 
+// loop. The result of each game is logged as one line to the console:
+//   * plies result hash seed [type]
+//
+//   * The number of half-moves (plies).
+//   * The result is 1 (white wins), D (draw), 0 (black wins).
+//   * The final postition is reflected by the given hash code.
+//   * Each game is started with a unique random seed.
+//   * If the game ends in a draw, the type is given here.
+//
+// The second command prints all moves for the game with the given seed 
+// to the console, including the final position.
+//
+// The single thread throughput on a Celeron G530 is about 100,000 
+// games per second. Stats about 4 mio games: white won 7.70%, black won 
+// 7.57% and 84.73% ended in a draw.
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "defs.h"
+#include "data.h"
+#include "protos.h"
+
+// linear pseudo random generator, see:
+// http://en.wikipedia.org/wiki/Linear_congruential_generator
+static uint32_t nextRandom(uint32_t v)
+{
+  return 1664525 * v + 1013904223 ;
+}
+
+static uint32_t doMove(uint32_t rvalue)
+{
+  while (first_move[1] > 0) {
+    int m = rvalue % first_move[1] ;
+    rvalue = nextRandom(rvalue) ;
+    if (makemove(gen_dat[m].m.b)) {
+      break;
+    }
+    else {
+      memcpy(&gen_dat[m],
+	     &gen_dat[first_move[1]-1],
+	     sizeof(gen_dat[0])) ;
+      --first_move[1] ;
+    }
+  }
+  return rvalue ;
+}
+
+static char const* isCompleted(char const** type)
+{
+  char const* result = NULL ;
+  if (type)
+    (*type) = "" ;
+  if (0 == first_move[1]) {
+    if (in_check(side)) {
+      if (side == LIGHT)
+	result = "0" ;
+      else
+	result = "1" ;
+    }
+    else {
+      result = "D" ;
+      if (type)
+	(*type) = "Stalemate" ;
+    }
+  }
+  else if (reps() == 3) {
+    result = "D" ;
+    if (type)
+      (*type) = "Repetition" ;
+  }
+  else if (fifty >= 100) {
+    result = "D" ;
+    if (type)
+      (*type) = "Fifty-Moves" ;
+  }
+  return result ;
+}
+
+static void play(uint32_t rvalue)
+{
+  init_board() ;
+  do {
+    ply = 0 ;
+    gen() ;
+    rvalue = doMove(rvalue) ;
+  }
+  while (!isCompleted(NULL)) ;
+}
+
+static void loop()
+{
+  uint32_t rvalue = 0 ;
+  init_hash();
+  while (1) {
+    char const* result ;
+    char const* type ;
+    play(rvalue) ;
+    result = isCompleted(&type) ;
+    printf("%d %s %08x %08x %s\n", 
+	   hply,result,hist_dat[hply].hash,rvalue,type) ;
+    rvalue = nextRandom(rvalue) ;
+  }
+}
+
+static void show(char const arg[])
+{
+  int i ;
+  uint32_t rvalue ;
+  init_hash();
+  rvalue = strtoul(arg,NULL,16) ;
+  play(rvalue) ;
+  for (i=0 ; i<hply ; ++i) {
+    printf("%d %s\n", i+1, move_str(hist_dat[i].m.b));
+  }
+  print_board();
+}
+
+int main(int argc, char *argv[])
+{
+  if (argc == 1) {
+    loop() ;
+  }
+  else {
+    show(argv[1]) ;
+  }
+  return 0 ;
+}
diff -rupN tscp181/protos.h tscp181-mod/protos.h
--- tscp181/protos.h	2003-01-30 00:34:00.000000000 +0100
+++ tscp181-mod/protos.h	2013-05-25 16:37:12.807116519 +0200
@@ -48,7 +48,7 @@ int eval_dkp(int f);
 
 /* main.c */
 int get_ms();
-int main();
+//int main();
 int parse_move(char *s);
 char *move_str(move_bytes m);
 void print_board();
Binary files tscp181/tscp181.exe and tscp181-mod/tscp181.exe differ
