fork download
  1. // simple_chess.c
  2. // Minimal local 2-player chess (console).
  3. // Compile: i686-w64-mingw32-gcc simple_chess.c -o simple_chess.exe
  4. // or for 64-bit: x86_64-w64-mingw32-gcc simple_chess.c -o simple_chess64.exe
  5.  
  6. #include <stdio.h>
  7. #include <string.h>
  8. #include <ctype.h>
  9.  
  10. char board[8][8];
  11.  
  12. void init_board() {
  13. const char *r0 = "rnbqkbnr";
  14. const char *r1 = "pppppppp";
  15. const char *r6 = "PPPPPPPP";
  16. const char *r7 = "RNBQKBNR";
  17. for (int c=0;c<8;c++){ board[0][c]=r0[c]; board[1][c]=r1[c]; board[6][c]=r6[c]; board[7][c]=r7[c]; }
  18. for (int r=2;r<=5;r++) for (int c=0;c<8;c++) board[r][c]='.';
  19. }
  20.  
  21. void print_board(){
  22. printf("\n a b c d e f g h\n");
  23. for(int r=0;r<8;r++){
  24. printf("%d ", 8-r);
  25. for(int c=0;c<8;c++){
  26. printf("%c ", board[r][c]);
  27. }
  28. printf("%d\n", 8-r);
  29. }
  30. printf(" a b c d e f g h\n\n");
  31. }
  32.  
  33. int in_bounds(int r,int c){ return r>=0 && r<8 && c>=0 && c<8; }
  34.  
  35. int is_white(char p){ return p>='A' && p<='Z'; }
  36. int is_black(char p){ return p>='a' && p<='z'; }
  37. int empty_sq(char p){ return p=='.'; }
  38.  
  39. int path_clear(int sr,int sc,int dr,int dc){
  40. int drs = (dr>sr) ? 1 : (dr<sr ? -1 : 0);
  41. int dcs = (dc>sc) ? 1 : (dc<sc ? -1 : 0);
  42. int r = sr+drs, c = sc+dcs;
  43. while(r!=dr || c!=dc){
  44. if(!in_bounds(r,c)) return 0;
  45. if(!empty_sq(board[r][c])) return 0;
  46. r+=drs; c+=dcs;
  47. }
  48. return 1;
  49. }
  50.  
  51. int valid_move_piece(char piece,int sr,int sc,int dr,int dc,int whiteTurn){
  52. if(!in_bounds(sr,sc) || !in_bounds(dr,dc)) return 0;
  53. if(sr==dr && sc==dc) return 0;
  54. char dst = board[dr][dc];
  55. if(!empty_sq(dst)){
  56. if(whiteTurn && is_white(dst)) return 0;
  57. if(!whiteTurn && is_black(dst)) return 0;
  58. }
  59. char p = piece;
  60. int dir = whiteTurn ? -1 : 1; // white moves "up" the board (lower index rows)
  61. switch(tolower(p)){
  62. case 'p': { // pawn
  63. if(sc==dc){ // forward moves
  64. if(dr == sr + dir && empty_sq(dst)) return 1;
  65. // double step from starting rank
  66. if( (whiteTurn && sr==6 && dr==4) || (!whiteTurn && sr==1 && dr==3) ){
  67. if(empty_sq(board[sr+dir][sc]) && empty_sq(board[dr][dc])) return 1;
  68. }
  69. } else if (abs(dc-sc)==1 && dr==sr+dir && !empty_sq(dst)){
  70. return 1; // capture
  71. }
  72. return 0;
  73. }
  74. case 'r': {
  75. if(sr==dr || sc==dc) return path_clear(sr,sc,dr,dc);
  76. return 0;
  77. }
  78. case 'n': {
  79. int drd = abs(dr-sr), dcd = abs(dc-sc);
  80. return ( (drd==2 && dcd==1) || (drd==1 && dcd==2) );
  81. }
  82. case 'b': {
  83. if(abs(dr-sr)==abs(dc-sc)) return path_clear(sr,sc,dr,dc);
  84. return 0;
  85. }
  86. case 'q': {
  87. if(sr==dr || sc==dc) return path_clear(sr,sc,dr,dc);
  88. if(abs(dr-sr)==abs(dc-sc)) return path_clear(sr,sc,dr,dc);
  89. return 0;
  90. }
  91. case 'k': {
  92. if (abs(dr-sr)<=1 && abs(dc-sc)<=1) return 1;
  93. return 0;
  94. }
  95. }
  96. return 0;
  97. }
  98.  
  99. int parse_coord(const char *s,int *r,int *c){
  100. // expects fileletter rankdigit e.g. e2
  101. if(strlen(s)<2) return 0;
  102. char f = tolower(s[0]);
  103. char rk = s[1];
  104. if(f<'a' || f>'h' || rk<'1' || rk>'8') return 0;
  105. *c = f - 'a';
  106. *r = 8 - (rk - '0');
  107. return 1;
  108. }
  109.  
  110. int make_move(int sr,int sc,int dr,int dc,int whiteTurn){
  111. char piece = board[sr][sc];
  112. if(piece=='.') return 0;
  113. if(whiteTurn && !is_white(piece)) return 0;
  114. if(!whiteTurn && !is_black(piece)) return 0;
  115. if(!valid_move_piece(piece,sr,sc,dr,dc,whiteTurn)) return 0;
  116. // perform move
  117. board[dr][dc] = board[sr][sc];
  118. board[sr][sc] = '.';
  119. // pawn promotion (to queen) if reaches last rank
  120. if(tolower(board[dr][dc])=='p'){
  121. if( (is_white(board[dr][dc]) && dr==0) || (is_black(board[dr][dc]) && dr==7) ){
  122. board[dr][dc] = is_white(board[dr][dc]) ? 'Q' : 'q';
  123. }
  124. }
  125. return 1;
  126. }
  127.  
  128. int main(){
  129. init_board();
  130. char input[64];
  131. int whiteTurn = 1; // white starts
  132. printf("Simple Chess (console) - two players local\n");
  133. printf("Enter moves like e2e4 or 'quit' to exit. No castling/en-passant/check detection.\n");
  134. while(1){
  135. print_board();
  136. printf("%s to move: ", whiteTurn ? "White" : "Black");
  137. if(!fgets(input,sizeof(input),stdin)) break;
  138. // trim newline
  139. input[strcspn(input,"\r\n")] = 0;
  140. if(strlen(input)==0) continue;
  141. if(strncmp(input,"quit",4)==0 || strncmp(input,"exit",4)==0) break;
  142. // allow formats: e2e4 or e2 e4
  143. char sfrom[8], sto[8];
  144. if(strlen(input)==4){
  145. sfrom[0]=input[0]; sfrom[1]=input[1]; sfrom[2]=0;
  146. sto[0]=input[2]; sto[1]=input[3]; sto[2]=0;
  147. } else {
  148. if(sscanf(input,"%7s %7s", sfrom, sto) != 2){
  149. printf("Invalid input. Use e2e4 or 'e2 e4'.\n"); continue;
  150. }
  151. }
  152. int sr,sc,dr,dc;
  153. if(!parse_coord(sfrom,&sr,&sc) || !parse_coord(sto,&dr,&dc)){
  154. printf("Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).\n");
  155. continue;
  156. }
  157. if(make_move(sr,sc,dr,dc,whiteTurn)){
  158. whiteTurn = !whiteTurn;
  159. } else {
  160. printf("Illegal move.\n");
  161. }
  162. }
  163. printf("Goodbye.\n");
  164. return 0;
  165. }
  166.  
Success #stdin #stdout 0s 5316KB
stdin
/*  Berechnung des Hamming-Abstandes zwischen zwei 128-Bit Werten in 	*/
/*	einer Textdatei. 													*/
/*  Die Werte müssen auf einer separaten Zeile gespeichert sein			*/
/* 																		*/
/*	Erstellt: 17.5.2010													*/
/*  Autor: Thomas Scheffler												*/

#include <stdio.h>
#include <stdlib.h>

#define ARRAY_SIZE 32

unsigned Hamdist(unsigned x, unsigned y)
{
  unsigned dist = 0, val = x ^ y;
 
  // Count the number of set bits
  while(val)
  {
    ++dist; 
    val &= val - 1;
  }
 
  return dist;
}



int main (void)
{
	char hex;
	int i;
	int a[ARRAY_SIZE];
	int b[ARRAY_SIZE];
	int hamDist = 0;
	FILE* fp;
	
	//Arrays mit 0 initialisieren
	for (i = 0; i < ARRAY_SIZE; ++i)
	{
  		a[i] = 0;
  		b[i] = 0;
	}

	
	fp = fopen("hex.txt","r");
	if (fp == NULL) 
	{
		printf("Die Datei hex.txt wurde nicht gefunden!");
		exit(EXIT_FAILURE);
	}

	i=0;
	printf("1.Zeile einlesen.\n");

 	while((hex=fgetc(fp))!='\n' && hex != EOF)
    {
        a[i]=strtol(&hex,0,16);
		i++;
    }
	i=0;
	printf("2.Zeile einlesen.\n");

 	while((hex=fgetc(fp))!='\n' && hex != EOF)
    {
    	b[i]=strtol(&hex,0,16);
        i++;
    }
	fclose(fp);

	printf("Hamming-Abweichung pro Nibble:\n");
	for (i = 0; i < ARRAY_SIZE; ++i)
	{
		printf ("%i\t%i\t%i\n",a[i],b[i],Hamdist(a[i],b[i]));
		hamDist += Hamdist(a[i],b[i]);
	}
	printf ("\nHamming-Abweichung der Hash-Werte:%d\n",hamDist);
}

stdout
Simple Chess (console) - two players local
Enter moves like e2e4 or 'quit' to exit. No castling/en-passant/check detection.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: 
  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: 
  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: 
  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: 
  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: 
  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: 
  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: 
  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: 
  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: 
  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: 
  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: 
  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid coordinates. Use files a-h and ranks 1-8 (e.g. e2e4).

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Invalid input. Use e2e4 or 'e2 e4'.

  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: 
  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

White to move: Goodbye.