After a lesson in Computer Science about Chess and Chess Playing computers, I decided to make a text based chess game written in ANSI C. Started off simple, defined the data sturcture to hold the chess board and where the pieces are, then a function to setup the board to the default peices, followed by another function that can draw the chess board to the terminal. Also started user input to choose a move.

Day Two, on the bus, to university i was thinking how to handle weather the move the player wants to do is valid. I then considered a mathmatical way using Gradients. For peices to move Left or Right the gradient is zero. For them to move to up or down the change in X is 0. For them to move diagonal, the gradient is zero. Haven’t sorted out Horses/Knights yet.

Advertisements