Sponsored Content
Full Discussion: C++ Help
Top Forums Programming C++ Help Post 302274430 by Corona688 on Wednesday 7th of January 2009 02:33:54 PM
Old 01-07-2009
You're putting X-es into the array for player one, how about using 1's and 2's instead? That'll make it easier to keep track of the players.

I would declare a variable outside the loop to keep track of whose turn it is, and toggle it back and forth at the top of the loop. Here's a really bare skeleton of the idea:
Code:
int player=2;

while(! gameover)
{
  int value;

  if(player == 1)
  {
    player=2;
  }
  else 
  {
    player=1;
  }

  cout << "Player " << player << "'s turn:" << endl;
  cin >> value;
  board[value]=player;

  check_if_game_over;
}

cout << "Player " << player << " wins!" << endl;

 
FS_GETCELLSTATUS(1)					       AFS Command Reference					       FS_GETCELLSTATUS(1)

NAME
fs_getcellstatus - Reports whether setuid programs are honored in a cell SYNOPSIS
fs getcellstatus -cell <cell name>+ [-help] fs getce -c <cell name>+ [-h] DESCRIPTION
The fs getcellstatus command reports whether the Cache Manager allows programs fetched from each specified cell to run with setuid permission. To set a cell's setuid status, use the fs setcell command; fs_setcell(1) fully describes how AFS treats setuid programs. OPTIONS
-cell <cell name>+ Names each cell for which to report setuid status. Provide the fully qualified domain name, or a shortened form that disambiguates it from the other cells listed in the local /etc/openafs/CellServDB file. -help Prints the online help for this command. All other valid options are ignored. OUTPUT
The output reports one of the following two values as appropriate: Cell <cell> status: setuid allowed Cell <cell> status: no setuid allowed EXAMPLES
The following example indicates that programs from the cell "abc.com" are not allowed to run with setuid permission. % fs getcellstatus abc.com Cell abc.com status: no setuid allowed PRIVILEGE REQUIRED
None SEE ALSO
CellServDB(5), fs_setcell(1) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 FS_GETCELLSTATUS(1)
All times are GMT -4. The time now is 11:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy