File: humanplayer.cpp

package info (click to toggle)
brutalchess 0.0.20060314cvs-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 6,496 kB
  • ctags: 447
  • sloc: cpp: 6,696; makefile: 118
file content (36 lines) | stat: -rw-r--r-- 848 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/***************************************************************************
*	Brutal Chess Pre-Alpha Build
*	- humanplayer.cpp
*
*	Authors: Maxwell Lazaroff, Michael Cook, and Joe Flint
*	Date Created : November 5th, 2005
*	Last Modified: November 5th, 2005
*
*	- description - Implements the methods of HumanPlayer.
***************************************************************************/

#include "humanplayer.h"

BoardMove
HumanPlayer::decide_move(const Board & board, bool & white)
{
	bool firstTry = true;
    BoardMove currentmove;

	do
    {
		if (!firstTry)
		{
			cout << "The move you entered was not valid, please try again.\n";
			cout << "Still your move: ";
		}

        cin >> currentmove;

		firstTry = false;
    } while (!check_move( currentmove, board, white ) );

    return currentmove;
}

// End of file humanplayer.cpp