Jump to content
  • Advertisement
Sign in to follow this  
Xabbu

Tic Tac Toe with C++?

This topic is 5149 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been pondering weather to attempt to make Tic Tac Toe in C++. I just don't know how to update the board without having to print it out again using cout.Is there a way to update it without printing the whole board out again? -Thanks

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Yeah, just use SetConsoleCursorPosition to write to the same locations on your console window. Here's a link that describes the function

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/setconsolecursorposition.asp

TTT is easy so it shouldn't be too hard to complete, Good luck!

Share this post


Link to post
Share on other sites
Sure.

Similarly, for Linux/BSD/etc., look into the "curses" and "ncurses" libraries.

On the other hand, re-outputting the board is not that difficult. You should have some data structure that represents the board "state" (i.e. stores whether there's an X or O or blank space at each spot), and pass that to a function, which takes the data and outputs the corresponding board.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!