Icon representing a recipe

Recipe: Wiggle Shake Wiggggggggle

created by SaveVMK

Profile


Name
Wiggle Shake Wiggggggggle
ID
103291
Shared with
Public
Parent
Wiggle Shake Wiggle 0.2.0
Children
Created on
March 09, 2020 at 01:33 AM UTC
Updated on
March 09, 2020 at 01:33 AM UTC
Description

Now with more wiggle!

Best for


Code


function switch_to_highest_power() if (behavior.HighPowerAllowed() == true) then behavior.SetWigglePower('h') else behavior.SetWigglePower('m') end end function wiggle_shake_until_done() behavior.SetClashImportance(1); wiggle_shake_improvement = nil repeat score_before_wiggle_shake = current.GetScore() structure.WiggleAll(8) if (current.GetScore() - score_before_wiggle_shake > 0.1) then structure.ShakeSidechainsAll(1); end wiggle_shake_improvement = current.GetScore() - score_before_wiggle_shake print("Wiggle shake improvement: " .. wiggle_shake_improvement) until (wiggle_shake_improvement < 0.5) end random_seed = os.time(); math.randomseed(random_seed); print("Using " .. random_seed .. " as the random seed"); --Lua's documentation recommends calling math.random() at least once before actually using it math.random(); --save.Quicksave(1) --best_score = 0 print("Initial score is " .. current.GetScore()) switch_to_highest_power(); while true do print("Starting a new round") clash_importance = (0.00 + math.random() * (1.00 - 0.00)); print("Setting clash importance to " .. clash_importance); behavior.SetClashImportance(clash_importance); print("Wiggling..."); structure.WiggleAll(2); print("Setting clash importance to 1"); behavior.SetClashImportance(1); print("Wiggle shaking until done"); wiggle_shake_until_done(); --score_after = current.GetScore(); --if (score_after > best_score) then --best_score = score_after; --print("New high score: " .. best_score); --save_puzzle_in_next_free_slot(); --else --print("Score (" .. score_after .. ") is lower than: " .. best_score); --end end

Comments