Advertisement

tic tac toe

Started by October 21, 2019 04:47 PM
61 comments, last by 8Observer8 5 years, 1 month ago

The simplest way is to write a text file with that information, and read it again.

You had a working program last time, where's that? It used a vanilla array to store the board data, that's all you need. You can write it to a file in 2 lines of code. Don't let things get more complicated than they are.

Advertisement

Yes, you are right. It is impossible to store a game board in a database to save a game. The database is better and simpler way than a text file if we store: nicknames, passwords, records and so on. I will use a text file too to save a game board. But I need to create two buttons: "Save Game" and "Load Game". The simplest way to do it in C# is using WinForms or WPF. But I do not know what is the simplest way in C++. For example, you can create buttons using textures or you can just use key board buttons: "S" and "L". Yes, I think using "S" and "L" keys on the key board is the simplest way to initiate the save and load processes in a text file.

so I should not use a list?

11 minutes ago, phil67rpg said:

so I should not use a list?

It is confused me. Do you want to keep game board data in the list?

yes I was thinking about keeping the board data in  list.

Advertisement

Why do you not like a static array?

I thought it would meet my needs 

Phil, you meet my needs.

4 hours ago, phil67rpg said:

I thought it would meet my needs 

What needs are those? You said you want to store the game board, a simple char array is perfectly suitable for that. You're not even going to use all the bits.

This topic is closed to new replies.

Advertisement