Libraryless. Click here for Pure Java version (2401L/17K/56K).
1 | !752 |
2 | |
3 | static OccTree<E> tree; |
4 | |
5 | !include #1003370 // DialogBot |
6 | |
7 | sclass StrictBot extends DialogBot { |
8 | *(OccTree<E> node) { super(node); } |
9 | |
10 | bool matchE(E a, E b) { |
11 | ret eq(a, b); // strict! |
12 | } |
13 | } |
14 | |
15 | p { |
16 | L<L<E>> poems = parsePoems(splitAtEmptyLines([[ |
17 | Usr: Yes |
18 | Bot: ok yes |
19 | [good] |
20 | |
21 | Usr: No |
22 | Bot: ok no |
23 | [good] |
24 | |
25 | Usr: No |
26 | Bot: ok yes |
27 | [bad] |
28 | |
29 | Usr: Yes |
30 | Bot: ok no |
31 | [bad] |
32 | ]])); |
33 | |
34 | print("Got " + n(l(poems), "dialog") + "."); |
35 | psl(poems); |
36 | |
37 | tree = poems2occTree(poems); |
38 | print(asciiHeading("Occurrence Tree")); |
39 | printOccTree(tree); |
40 | |
41 | check("Usr: Yes", "Bot: ok yes"); |
42 | check("Usr: No", "Bot: ok no"); |
43 | check("Usr: yes", "fail"); // we are very strict! |
44 | |
45 | print("OK"); |
46 | } |
47 | |
48 | svoid check(S in, S out) { |
49 | checkBot(new StrictBot(tree), in, out); |
50 | } |
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: | #1003357 |
Snippet name: | Test Strict Mode (WORKS) |
Eternal ID of this version: | #1003357/1 |
Text MD5: | f56ec50e9a9d9aa60c61c745e8bb4f72 |
Transpilation MD5: | 5df5307a3e1d00fdc7d8ecfc7dc14990 |
Author: | stefan |
Category: | javax |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-06-25 23:32:15 |
Source code size: | 861 bytes / 50 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 749 / 826 |
Referenced in: | [show references] |