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

24
LINES

< > BotCompany Repo | #1010203 // Find a random standard function [OK]

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

Download Jar. Uses 616K of libraries. Click here for Pure Java version (15281L/110K).

1  
!7
2  
3  
sS inputDiagrams = [[
4  
  CirclesAndLines(circles=[Circle(text="Find", x=d("0.42219020172910665"), y=d("0.1644100580270793")), Circle(text="standard function", x=d("0.659942363112392"), y=d("0.28239845261121854"))], lines=[Arrow(a=t5, b=t26, text="")])
5  
  CirclesAndLines(circles=[Circle(text="A standard function that finds", x=d("0.3011527377521614"), y=d("0.2688588007736944")), Circle(text="standard functions", x=d("0.5561959654178674"), y=d("0.4448742746615087")), Circle(text="\"standardFunctionNames\"", x=d("0.7521613832853026"), y=d("0.6808510638297872"))], lines=[Arrow(a=t5, b=t26, text=""), Arrow(a=t26, b=t47, text="is")])
6  
]];
7  
8  
p {
9  
  Web web = webFromCALStructures(inputDiagrams);
10  
  showWeb(web);
11  
  WebNode find = web_findNode(web, "Find");
12  
  WebNode op = web_operand(find);
13  
  print("Finding a: " + op);
14  
  S plural = plural(web_text(op));
15  
  print(plural);
16  
  Pair<WebNode> finder = web_findTriple(web, "A standard function that finds", "", plural);
17  
  print("Finder: " + finder);
18  
  if (finder == null) fail("No finder");
19  
  S sfName = web_operandText(finder.b, "is");
20  
  if (sfName == null) fail("No sf");
21  
  print(sfName);
22  
  O found = random((Collection) makeAndCall(sfName));
23  
  print("Found: " + sfu(found));
24  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, imzmzdywqqli, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1010203
Snippet name: Find a random standard function [OK]
Eternal ID of this version: #1010203/10
Text MD5: 22bb0b5328801a8b09a2933052b7b09e
Transpilation MD5: 8830e1657522ff2a5ffac5dd173a52db
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-09-06 20:30:43
Source code size: 1245 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 547 / 1043
Version history: 9 change(s)
Referenced in: [show references]