Mercurial > repos > icfp2013
comparison src/solver.tp @ 40:1cadb591eef1
Fix bug that was causing the solver to not find certain matches
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 11 Aug 2013 00:37:34 -0700 |
parents | cde3f5943cd4 |
children | e795f7179456 |
comparison
equal
deleted
inserted
replaced
39:1dcf26c070fe | 40:1cadb591eef1 |
---|---|
87 foreach: cps :idx tree { | 87 foreach: cps :idx tree { |
88 res append: cps | 88 res append: cps |
89 } | 89 } |
90 } | 90 } |
91 } | 91 } |
92 } else: { | |
93 if: _hasFirst? { | |
94 res append: _first | |
95 } | |
92 } | 96 } |
93 res | 97 res |
94 } | 98 } |
95 } | 99 } |
96 } else: { | 100 } else: { |
137 resp <- (requests evalId: progId (info allInputs)) sendWithKey: authKey | 141 resp <- (requests evalId: progId (info allInputs)) sendWithKey: authKey |
138 if: (resp status) = "ok" { | 142 if: (resp status) = "ok" { |
139 matches <- info findMatches: (resp outputs) at: 0 | 143 matches <- info findMatches: (resp outputs) at: 0 |
140 noSuccess <- true | 144 noSuccess <- true |
141 cur <- 0 | 145 cur <- 0 |
146 if: (matches length) = 0 { | |
147 print: "No matches? :(\n" | |
148 print: info | |
149 } | |
142 while: { noSuccess && cur < (matches length) } do: { | 150 while: { noSuccess && cur < (matches length) } do: { |
143 prog root!: (matches get: cur) | 151 prog root!: (matches get: cur) |
144 gresp <- (requests guess: progId (string: prog)) sendWithKey: authKey | 152 gresp <- (requests guess: progId (string: prog)) sendWithKey: authKey |
145 if: (gresp status) = "win" { | 153 if: (gresp status) = "win" { |
146 noSuccess <- false | 154 noSuccess <- false |