FANDOM


save.GetSolutions

Function
table save.GetSolutions()
Description
Get a list of solutions.
V1 Function Name
New to V2

save.GetSolutions returns a table containing the names of saved solutions.

See save.LoadSolution for an example of how to load a solution returned by save.GetSolutions.

The table returned by save.GetSolutions consists of keyword-value pairs. The keywords are:

  • filename - the name of the file containing the saved solution
  • name - the name of the saved solution
  • score - the score of the saved solution

The example below demonstrates how to reference the values. The recipe:

sol = save.GetSolutions () 

print ( #sol .. " solutions found" )

for ii = 1, #sol do
    print ( "solution # " .. ii )
    soli = sol [ ii ]
    print ( "filename = " .. soli.filename )
    print ( "name = " .. soli.name )
    print ( "score = " .. soli.score )
end

might produce the output:

2 solutions found
solution # 1
filename = 0381635826.ir_shared_solution.ir_solution
name = solo 10
score = 12386.872115187
solution # 2
filename = 0381644939.ir_shared_solution.ir_solution
name = solo 11
score = 12387.18291233
Community content is available under CC-BY-SA unless otherwise noted.