Libraryless. Click here for Pure Java version (1115L/8K/27K).
1 | !7 |
2 | |
3 | enum Bit { yes, no, unknown } |
4 | |
5 | sclass OneBitBot { |
6 | new TreeMap<S, Bit> examples; |
7 | |
8 | void yes(S s) { examples.put(s, Bit.yes); } |
9 | void no(S s) { examples.put(s, Bit.no); } |
10 | |
11 | Bit get(S s) { |
12 | ret examples.get(levenClosestIC(examples, s)); |
13 | } |
14 | } |
15 | |
16 | p { |
17 | new OneBitBot bot; |
18 | bot.yes("yes"); |
19 | bot.no("no"); |
20 | print(bot.get("yessss")); |
21 | print(bot.get("nooooo")); |
22 | } |
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: | #1008050 |
Snippet name: | OneBitBot Test [OK, but we need more "bits"] |
Eternal ID of this version: | #1008050/6 |
Text MD5: | 2bbb920232847712ef64ed8cc3f03aba |
Transpilation MD5: | d42b273e66a48a1105f9972710993125 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-04-23 00:08:37 |
Source code size: | 394 bytes / 22 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 464 / 531 |
Version history: | 5 change(s) |
Referenced in: | [show references] |