completed save rect to RLE file feature

This commit is contained in:
2024-05-26 20:26:13 +02:00
parent cb3e8b3c4c
commit 4b38bea5db
7 changed files with 160 additions and 5 deletions

View File

@@ -69,6 +69,11 @@ func GetFilename(generations int64) string {
return fmt.Sprintf("dump-%s-%d.gol", now.Format("20060102150405"), generations)
}
func GetFilenameRLE(generations int64) string {
now := time.Now()
return fmt.Sprintf("rect-%s-%d.rle", now.Format("20060102150405"), generations)
}
func (grid *Grid) SaveState(filename string) error {
file, err := os.Create(filename)
if err != nil {