| 1 | taskID = selectATask() | 
| 2 | verifier = getVerifierForTask(taskId) | 
| 3 | solution = shortestSolutionForTask(taskID) | 
| 4 | |
| 5 | if not verifier(solution) then error 'Sanity check failed' end | 
| 6 | if verifier '' then error 'Sanity check failed (or problem is trivial)' end | 
| 7 | |
| 8 | while shouldRun() do | 
| 9 | solution2 = shorten(solution) | 
| 10 | if solution2 == nil then break end | 
| 11 | if verifier(solution2) then | 
| 12 | solution = solution2 | 
| 13 |     print('Shortened solution to '..#solution2..' chars')
 | 
| 14 | end | 
| 15 | end | 
test run test run with input download show line numbers
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Recognizer | Recognition Result | Visualize | Recalc | 
|---|---|---|---|
| #308 | 471 | [visualize] | 
| Snippet ID: | #236 | 
| Snippet name: | Code golf loop (incomplete Lua code) | 
| Eternal ID of this version: | #236/1 | 
| Text MD5: | b629a63aa5bf41ec0490ed5f0378125d | 
| Author: | stefan | 
| Category: | computation loops | 
| Type: | Lua code | 
| Public (visible to everyone): | Yes | 
| Archived (hidden from active list): | No | 
| Created/modified: | 2014-02-15 22:18:28 | 
| Source code size: | 471 bytes / 15 lines | 
| Pitched / IR pitched: | Yes / Yes | 
| Views / Downloads: | 1236 / 284 | 
| Referenced in: | [show references] |