save grid to custom format

This commit is contained in:
2025-07-12 06:03:59 +01:00
parent 04bb7a18c0
commit eb0b8d31b2
6 changed files with 41 additions and 15 deletions

View File

@@ -51,7 +51,13 @@ struct
fun loadSquares (path, inputMailbox) = ()
fun saveSquares squares = ()
fun saveSquares squaresString =
let
val io = TextIO.openOut filename
val () = TextIO.output (io, squaresString)
in
TextIO.closeOut io
end
fun getDirList (dir, acc, rootPath) =
case OS.FileSys.readDir dir of
@@ -87,7 +93,7 @@ struct
let
val _ =
case Mailbox.recv fileMailbox of
SAVE_SQUARES triangles => saveSquares triangles
SAVE_SQUARES str => saveSquares str
| LOAD_SQUARES => loadSquares (filename, inputMailbox)
| EXPORT_SQUARES triangles => exportSquares triangles
| LOAD_FILES path => loadFiles (path, inputMailbox)