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).

!7

sS inputDiagrams = [[
  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="")])
  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")])
]];

p {
  Web web = webFromCALStructures(inputDiagrams);
  showWeb(web);
  WebNode find = web_findNode(web, "Find");
  WebNode op = web_operand(find);
  print("Finding a: " + op);
  S plural = plural(web_text(op));
  print(plural);
  Pair<WebNode> finder = web_findTriple(web, "A standard function that finds", "", plural);
  print("Finder: " + finder);
  if (finder == null) fail("No finder");
  S sfName = web_operandText(finder.b, "is");
  if (sfName == null) fail("No sf");
  print(sfName);
  O found = random((Collection) makeAndCall(sfName));
  print("Found: " + sfu(found));
}

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: 533 / 1010
Version history: 9 change(s)
Referenced in: [show references]