Icon representing a recipe

Recipe: nicm25.hti.CompactStructure v1.01

created by Nicm25

Profile


Name
nicm25.hti.CompactStructure v1.01
ID
104864
Shared with
Public
Parent
None
Children
None
Created on
June 30, 2021 at 12:07 PM UTC
Updated on
June 30, 2021 at 12:07 PM UTC
Description

you just idealize for compacted easy see! (no args)

Best for


Code


-- created by Nicm25; function run() local lc=1 local segs=1 local sege=structure.GetCount() for lc=1,sege do if structure.IsLocked(lc) then segs=lc+1 end end if segs>sege then print("not supported partial puzzle") return 1 end if sege-segs>3.5 then lc=math.floor((segs+sege)*0.5+0.25) undo.SetUndo(false) selection.DeselectAll() selection.SelectRange(segs,sege) structure.SetSecondaryStructureSelected("h") selection.DeselectAll() structure.SetSecondaryStructure(segs,"l") structure.SetSecondaryStructure(sege,"l") undo.SetUndo(true) structure.SetSecondaryStructure(lc,"e") end return 0 end local lfi=1 lfi=run() if lfi>0.5 then print("terminated by exception error") end

Comments


Nicm25 Lv 1

thank you for your interest.
this is by product of bootstrap, where i prepare tools myself from beginning
and my personal 'Hand Tools, Information such package'(hti).

In this little script, setting to secondary structure as helices other than central segment.
you can folding compact by using idealization tool, easily see and mutating to AA for first game.
(not auto idealize)
no argument
int return: whether it was successfully. function: 0 is okay, else is problem

Nicm25 Lv 1

improved to undo history into one task.
other that, there are no changes to specifications.