Libraryless. Click here for Pure Java version (2574L/17K/59K).
1 | !759 |
2 | |
3 | p { |
4 | // load log |
5 | |
6 | L<S> log = scanEventLogForText("#1004032", "chemists"); |
7 | print(indent("> ", trim(joinLines(log))) + "\n"); |
8 | genLog_set(log); |
9 | |
10 | // infer stuff |
11 | |
12 | gRepeat("inferStuff"); |
13 | |
14 | // answer questions |
15 | |
16 | for (Matches m : gJMatch("if * then check(*)")) |
17 | for (S statement : mapReplaceVars(m.unq(1), gSat(m.unq(0)))) |
18 | gAdd(nempty(gSat(statement)) ? "yes, " + statement : "no @ " + quote(statement)); |
19 | |
20 | // check our performance! |
21 | |
22 | for (S s : gWants()) |
23 | if (nempty(gJMatch(s))) |
24 | print("Success! Found statement: " + s); |
25 | else |
26 | print("Statement " + quote(s) + " not found..."); |
27 | } |
28 | |
29 | svoid inferStuff { |
30 | for (Matches m : gJMatch("if * and * then *")) |
31 | gAddAll(mapReplaceVars(m.unq(2), gSatAnd(m.unq(0), m.unq(1)))); |
32 | } |
Began life as a copy of #1004284
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1004295 |
Snippet name: | More Logic [Chemists] |
Eternal ID of this version: | #1004295/1 |
Text MD5: | 91ce3c7335355e7e6379ca82ab1b6cb5 |
Transpilation MD5: | 6921c8cc4e19af01e50ad09f2362cafd |
Author: | stefan |
Category: | javax |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-08-14 01:45:46 |
Source code size: | 793 bytes / 32 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 664 / 742 |
Referenced in: | [show references] |