Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Delphi Misc > Re: Pascal, Con...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 12 Topic 5963 of 6137
Post > Topic >>

Re: Pascal, Connect4 Game, 2D Array, display.

by Rob Kennedy <me3@[EMAIL PROTECTED] > Jan 20, 2008 at 05:26 PM

israphelr@[EMAIL PROTECTED]
 wrote:
> hello all
> 
> -------------------------------------------------------------
>   Tstates = (empty,red,yellow);
>   Tplayers = red..yellow;
>   Tboard = ARRAY[0..ColMax, 0..RowMax] OF Tstates;
> ------------------------------------------------------------
> 
> This is a make up of the connect four board I am using.
> 
> I have displayed the board on the screen (this is a console
> application, I am *very* inexperienced with programming and I don't
> know any graphics at all )
> 
> My problem is I am not sure how once I have set an individual cell say
> ----------------------
> board : Tboard
> player 1 : Tstates
> 
> player1 := red;
> 
> board[0,1] := player1
> -----------------------------
> 
> the cell at board[0,1] becomes red, but I am not sure how to display
> that to the user.
> 
> Some suggestions would be great thanks.

If you're not comfortable with graphics, then you might want to 
represent the players by something other than color! Consider using two 
different characters, such as X and O. As you print the board on the 
screen, draw different characters to represent different states of each 
position on the board.

Have you looked at Maarten Wiltink's tic-tac-toe program? Tic-tac-toe 
isn't really much different from Connect Four.

http://www.kittensandcats.net/maarten/programming.html

-- 
Rob
 




 12 Posts in Topic:
Pascal, Connect4 Game, 2D Array, display.
"israphelr@[EMAIL PR  2008-01-20 14:07:48 
Re: Pascal, Connect4 Game, 2D Array, display.
Rob Kennedy <me3@[EMAI  2008-01-20 17:26:49 
Re: Pascal, Connect4 Game, 2D Array, display.
"israphelr@[EMAIL PR  2008-01-20 15:32:17 
Re: Pascal, Connect4 Game, 2D Array, display.
Rob Kennedy <me3@[EMAI  2008-01-21 01:01:24 
Re: Pascal, Connect4 Game, 2D Array, display.
Hans-Peter Diettrich <  2008-01-21 00:42:27 
Re: Pascal, Connect4 Game, 2D Array, display.
Marco van de Voort <ma  2008-01-21 10:55:51 
Re: Pascal, Connect4 Game, 2D Array, display.
Hans-Peter Diettrich <  2008-01-21 15:49:58 
Re: Pascal, Connect4 Game, 2D Array, display.
Marco van de Voort <ma  2008-01-21 20:08:02 
Re: Pascal, Connect4 Game, 2D Array, display.
Hans-Peter Diettrich <  2008-01-22 00:13:25 
Re: Pascal, Connect4 Game, 2D Array, display.
Marco van de Voort <ma  2008-01-22 07:46:17 
Re: Pascal, Connect4 Game, 2D Array, display.
ap <ap.mail@[EMAIL PRO  2008-01-22 10:49:18 
Re: Pascal, Connect4 Game, 2D Array, display.
Marco van de Voort <ma  2008-01-24 09:57:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Sep 5 12:13:32 CDT 2008.