Profile
- Name
- DeleteMax 2info
- ID
- 104097
- Shared with
- Public
- Parent
- DeleteMax 2
- Children
- Created on
- November 06, 2020 at 02:03 AM UTC
- Updated on
- November 06, 2020 at 02:03 AM UTC
- Description
You must login to both the game and the foldit website to add to cookbook.
weile fang zai ni de mingdan, qing denglu Foldit youxi haiyou Fold.it wangzhan.Now works for Two-sided Interface Design puzzle and Linker puzzles.
Helped me rank up quickly though perhaps not longterm
Can be used before other recipes that add segments because deleting segments in use with a recipe can cause crashes so it's hard to delete segments one at a time and test them with bands but it's easy to add one at a time and test it with a recipeDeletes the maximum number of segments (residues) allowed. May be useful for design puzzles with a variable number of segments.
Best for
Code
--DeleteMax
-- AddMax
--
-- adds as many segments as possible
--
-- 1.0 - LociOiling - 2018/03/02
--
Recipe = "DeleteMax"
Version = "1.0"
ReVersion = Recipe .. " " .. Version
print ( ReVersion )
undo.SetUndo ( false )
behavior.SetFiltersDisabled ( true )
local segcnti = structure.GetCount ()
local segcnt = segcnti
print ( "initial segment count = " .. segcnti )
local ok = true
repeat
--local ss1 = structure.GetSecondaryStructure ( segcnt - 1 )
--structure.SetSecondaryStructure ( segcnt - 1, "E" )
--local ss2 = structure.GetSecondaryStructure ( segcnt )
--structure.SetSecondaryStructure ( segcnt, "E" )
--local aa2 = structure.GetAminoAcid ( segcnt )
--
-- add segment before the last segment
--
i=segcnt-1
repeat
ok = structure.DeleteResidue ( i ) and ok
i=i-1
until i==1
--structure.SetSecondaryStructure ( segcnt - 1, ss1 )
--structure.SetSecondaryStructure ( segcnt, ss2 )
segcnt = structure.GetCount ()
if ok then
--
-- set secondary structure of last segment
--
-- structure.SetSecondaryStructure ( segcnt, ss2 )
--
-- set amino acid of added segment
--
--structure.SetAminoAcid ( segcnt - 1, aa2 )
end
until not ok
local segcnt = structure.GetCount ()
if segcnti == segcnt then
print ( "no segments deleted" )
else
print ( segcnt - segcnti .. " segments added" )
end
print ( "final segment count = " .. segcnt )
print ( ReVersion .. " complete" )
undo.SetUndo ( true )
behavior.SetFiltersDisabled ( false )