Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main()
- local function repeatPattern(pattern, last)
- if last == nil then last = false end
- local gain = 0.0
- local round = 0
- local score
- repeat
- score = getScore()
- round = round + 1
- print("Starting round " .. round .. " of pattern " .. table.concat(pattern, ","))
- BandedWorm(pattern)
- gain = getScore() - score
- until gain < 0.01
- PrintState()
- if not last then InitializePuzzleState() end
- end
- if GetParams() then
- UUnweightedInitialScore = getScore()
- for i = 1, 1000 do
- mainloop = i
- InitializePuzzleState()
- print("#####################")
- print("Starting main loop " .. mainloop)
- repeatPattern({2, 5, 11, 3, 13, 4, 7, 1, 6})
- repeatPattern({14, 8, 6, 7, 13, 12, 2, 10, 11})
- repeatPattern({5, 7, 1, 3, 9, 6, 2, 4, 8})
- repeatPattern({3, 6, 12, 4, 14, 5, 8, 2, 7})
- repeatPattern({3, 8, 4, 5, 12, 6, 10, 2, 7}, true)
- end
- End()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement