Sponsored Content
Full Discussion: C++ Help
Top Forums Programming C++ Help Post 302274446 by Corona688 on Wednesday 7th of January 2009 03:13:03 PM
Old 01-07-2009
Quote:
Originally Posted by RossMc
So that would go before

Code:
cout << "Player 1 Your Turn Please Enter Which Cell You Would Like" << endl;
 
cin >> row >> column;
}
 
if(board[row-1][column-1] ==' ')
 
board[row-1][column-1] = 'X'; }

Or instead of?
My example replaces your entire while() loop. It's also just a bare skeleton, like I said; there's bits you need to fill in yourself. I'll comment it better to give you more idea what it's doing and what's not finished. I've also fixed some problems I just noticed in my first version.

Code:
char player='2'; /* Keeps track of who's playing */

/* Loop through this block until the game ends */
while(! gameover)
{
  int row, column;

  /* Put the stuff to print the board here */

  /* Switch players */
  if(player == '1')
  {
    player='2';
  }
  else 
  {
    player='1';
  }

  /* Print a message for the player */
  cout << "Player " << player << "'s turn:" << endl;
  /* Read two values from the keyboard */
  cin >> row >> column;
  /* Change the game board */
  board[row-1][column-1]=player;

  /* You need to check if the game's 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 10:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy