I also want to generate and save random coordinates.
This file will contain:
board size(int) difficulty(string) some coordinates(2d array)
10 different board sizes,
3 difficulties and
20 levels,
Thats mean 600 different coordinate array i don’t want to read every one of that. Any suggestions?
I guess I have a solution but since i’m new to c# i don’t know exactly how to do it.
Create new class for management and new list to save and read data in a c# file.
You can split then into groups. For example, create 1 file per board size. 10 files, only 60 per file. But you’ll probably find that reading 600 of them from disk takes a rather trivial amount of time to complete. So you might be overthinking this issue.
I thought the whole point was you didn’t want to put them all in the same file? How you’d partition it depends on what kind of text format you’re using. If it’s you’re own custom format, you’d just put some identifier to indicate the start of each partition. But I don’t think that would save you anything performance wise, since you’d need to read through the file to find the different partitions. Might as well just load the entire file at that point probably.