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

43
LINES

< > BotCompany Repo | #1007676 // Demo 1: Smart Editor [shortening even more, dev.]

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

Download Jar. Uses 3874K of libraries. Click here for Pure Java version (9992L/68K).

1  
!7
2  
3  
sS theRiddle = [[
4  
5  
  X is the first word in my text.
6  
  Is my text a letter or a program?
7  
  
8  
]];
9  
10  
sS theFacts = [[
11  
12  
  "!" is a typical first word in a program.
13  
  "Hello" is a typical first word in a letter.
14  
  cdtwmxtqspigpyap confirms mibnjwgfxnetaxyz.
15  
  
16  
]];
17  
18  
sS concepts = [[
19  
  ["", "Is X a Y or a Z?"],
20  
  ["mibnjwgfxnetaxyz", "X is the first word in Y."],
21  
  ["cdtwmxtqspigpyap", "X is a typical first word in a Y."],
22  
  ["kdpoqkaoypqenusd", "X confirms Y."]
23  
]];
24  
25  
static JTextArea ta;
26  
static new L<Lisp> facts;
27  
static * computer = new ReliableSingleThread(f think);
28  
29  
p-substance-noconsole {
30  
  aiEnhancements();
31  
  useConceptsDump(concepts);
32  
  facts = clParse(linesToCL(theFacts));
33  
  onChangeAndNow(ta = showText(""), r { computer.go() });
34  
}
35  
36  
svoid think {
37  
  time {
38  
    S w = firstWord2(getText(ta));
39  
    S riddle = formatXYZ(theRiddle, quote(w));
40  
    S type = conceptToName(solveCandidatesRiddle(facts, riddle));
41  
    titleStatus_trailing(ta, empty(type) ? null : "Writing a " + type);
42  
  }
43  
}

Author comment

Began life as a copy of #1007649

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: #1007676
Snippet name: Demo 1: Smart Editor [shortening even more, dev.]
Eternal ID of this version: #1007676/10
Text MD5: 4bf15f93dffb9dbdcab37c720c72d5d9
Transpilation MD5: d5893723c132c7243cb0dceb98cde9c3
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-04-01 13:25:08
Source code size: 1035 bytes / 43 lines
Pitched / IR pitched: No / No
Views / Downloads: 642 / 1256
Version history: 9 change(s)
Referenced in: [show references]