Jump to content
  • Advertisement
Sign in to follow this  
Yhack

Refresh c++

This topic is 4817 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

Hi, I have made a small game of tic tac toe which I want to refresh so it changes. How would I do this?

Share this post


Link to post
Share on other sites
Advertisement
In short (I can't believe I'm doing this):

here is an example:

[/source]
void DrawTheBoard(TicTacToeBoard board)
{
system("cls");
//Do the drawing procedure here
}

int main()
{
TicTacToeBoard board;
while(game)
{
//User input stuff
DrawTheBoard(board);
}
}


If you don't know how to write a function, you really need to read up more. Check out the GDnet store - look for books by Addison-Wesley, a publisher with a good reputation.

Share this post


Link to post
Share on other sites
Are you using Java or C/C++? How much programming do you know? You would just pass the information of the squares to a drawing function which would then draw the squares and mark the appropriate Xs or Os.

Share this post


Link to post
Share on other sites
Quote:
Original post by Yhack
Could you tell me how to write a function please?


This question shows that you don't really know wht a C++ function is, because it shows that you didn't notice that main() is a function.

I believe you should find a small book about C or C++; you might also check the web for more information. cprogramming has rather simple C++ tutorials that might help you.

HTH,

(icks. too slow)

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!