Icon representing a recipe

Recipe: Score Part Totals

created by Susume

Profile


Name
Score Part Totals
ID
37521
Shared with
Public
Parent
None
Children
Created on
February 12, 2014 at 19:57 PM UTC
Updated on
February 12, 2014 at 19:57 PM UTC
Description

prints score part totals for the molecule

Best for


Code


-- Prints the total for each score part for the molecule. -- May be useful in deciding what kind of script to run next. -- Data are comma-separated for use in a spreadsheet, one score part per row. -- Part totals, overall total, and game score are all rounded so may not match exactly. -- In general, total of score parts + 8000 = game score ScoreParts = puzzle.GetPuzzleSubscoreNames() NewLine = " " --replace with your choice of NewLine markers if using data from output file SegCnt = structure.GetCount() TotalScore = 0 PartTotals = {} for p = 1, #ScoreParts do PartTotals[p] = 0 for seg = 1, SegCnt do PartTotals[p] = PartTotals[p] + current.GetSegmentEnergySubscore(seg, ScoreParts[p]) end TotalScore = TotalScore + PartTotals[p] print(ScoreParts[p]..", "..math.floor(PartTotals[p]).." "..NewLine) end print("total, "..math.floor(TotalScore).." "..NewLine) print("game score, "..math.floor(current.GetEnergyScore()).." "..NewLine)

Comments


Susume Lv 1

Gets list of score parts from game. Prints total for each score part, overall total from score parts, and game score. Game score = total from score parts + 8000, with small differences in the printed values due to rounding.