Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #1010891 // Decide by word at index v3 [OK]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (3594L/23K).

!7

static SS map = unstructMap([[lhm{null="assumed", "what is a bear?"="rejected", "a bear is an animal"="assumed", "a bear is dangerous"="assumed", "\"dude\" is a word for someone"="assumed", "Pouet is a website"="assumed", "an integer is a whole number"="assumed", "what is a small bird"="rejected", "what is a good joke"="assumed", "peter is a fun guy"="confirmed", "john is a person"="confirmed"}]]);

static L<S> tests = ll("what is a bunny", "klaus is a fool", "john is a joker");

p {
  dropValuesFromMapOtherThan(map, 'confirmed, 'rejected);
  int wordIndex = 0;
  O decider = boolGuesserByWordAtIndex(mapValuesToBool(map, 'confirmed), wordIndex);
  
  for (S test : tests)
    print(" " + test + " => " + callF(decider, test));
}

Author comment

Began life as a copy of #1010883

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: #1010891
Snippet name: Decide by word at index v3 [OK]
Eternal ID of this version: #1010891/4
Text MD5: 9da8ac2ae86b1342093558f3aee13991
Transpilation MD5: c2d26b125d4773920b095f473f5d2ecd
Author: stefan
Category: javax / a.i.
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-10-11 18:22:23
Source code size: 752 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 603 / 1239
Version history: 3 change(s)
Referenced in: