1 | static abstract class o_KnowingSolver { |
2 | abstract void solve(L<Para> examples, Para target); |
3 | } |
4 | |
5 | static void optimizeLastLine(L<Para> paras, O solver) { |
6 | int score = 0; |
7 | for (Para p : paras) { |
8 | S method = optimizeLastLine(paras, p); |
9 | if (notNull(method)) { |
10 | print(p.index + " = " + method); |
11 | ++score; |
12 | } |
13 | } |
14 | |
15 | print("Successfully calculated last lines: " + score + " of " + l(paras)); |
16 | } |
17 | |
18 | // returns calculation method if pivot could be calculated from other paragraphs |
19 | static S optimizeLastLine(L<Para> all, Para pivot) { |
20 | L<Para> rest = listMinus(all, pivot); |
21 | Para shortened = new Para(pivot.index, dropLastLine(pivot.text)); |
22 | ret optimizeLastLine_solve(rest, shortened); |
23 | } |
24 | |
25 | optimizeLastLine_solve(L<Para> examples, Para target) { |
26 | S lastLine = lastLine(pivot.text); |
27 | } |
Began life as a copy of #1005116
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1005153 |
Snippet name: | optimizeLastLine (dev.) |
Eternal ID of this version: | #1005153/1 |
Text MD5: | a8661696ff39975b843f9f9355238425 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-10-17 01:50:21 |
Source code size: | 830 bytes / 27 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 454 / 459 |
Referenced in: | [show references] |