How can I quickly save and load data files in Prolog, for use with games?
Save files with save(File_name,Term), where File_name is the file name in folder folder_name and Term is a compound containing the data file.
?- save("file_name.txt",[[["player_name","Harold"],["score",10],["symbol",key_word]],[["player_name","Queenie"],["score",20],["symbol",schema]]]).
Load files with load(File_name,Term), where File_name is the file name in folder folder_name and Term is the contents loaded from the file.
?- load("file_name.txt",Term),writeln1(Term).
Term=[[["player_name","Harold"],["score",10],["symbol",key_word]],[["player_name","Queenie"],["score",20],["symbol",schema]]]