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

41
LINES

< > BotCompany Repo | #1008320 // Do you ship to...? [WORKS]

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

Libraryless. Click here for Pure Java version (11150L/78K/254K).

1  
!7
2  
3  
sS questions = [[
4  
  Do you ship to Norway? => Yes
5  
  Do you ship to Oslo? => Yes
6  
  Do you ship to Australia? => Sorry, we cannot ship there.
7  
  Do you ship to Melbourne? => Sorry, we cannot ship there.
8  
]];
9  
10  
sS facts = [[
11  
  We ship to Norway
12  
  We don't ship to Australia
13  
  
14  
  Melbourne is in Australia
15  
  Oslo is in Norway
16  
]];
17  
18  
sS rules = [[
19  
  Q: Do you ship to X?
20  
    (We ship to X) => A: Yes
21  
    (We don't ship to X) => A: Sorry, we cannot ship there.
22  
    (We ship to X for a fee of Y) => A: Yes, for a fee of Y we will ship to X.
23  
    (X is in Y) => Replace question with: Do you ship to Y?
24  
    
25  
  Always: (Replace question with: X) => Q: X
26  
  
27  
  lvjqbruihqmsgckd - Do you ship to X?
28  
  aileauajpxpgymdj - We ship to X
29  
  siacyutikdvksvwp - We don't ship to X
30  
  zlrmmqtlczxnjabk - Sorry, we cannot ship there.
31  
  vzfbivkrprmgghhp - Replace question with: X
32  
  wmwqvagqbsfenmtf - X is in Y
33  
]];
34  
35  
p {
36  
  rules = rules_unfoldIndented(rules, "Always: ");
37  
  print(rules);
38  
  myTruthNonPersist(facts + standardConcepts() + rules);
39  
  lispCheckQuestionsVerbose(questions);
40  
  lispBot();
41  
}

Author comment

Began life as a copy of #1008318

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1008320
Snippet name: Do you ship to...? [WORKS]
Eternal ID of this version: #1008320/16
Text MD5: ce6403c36d2094acd51afea4e75ff524
Transpilation MD5: f035cb35cfd58ae84b295b5abadd6292
Author: stefan
Category: javax / a.i.
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-05-07 22:20:51
Source code size: 1113 bytes / 41 lines
Pitched / IR pitched: No / No
Views / Downloads: 506 / 604
Version history: 15 change(s)
Referenced in: [show references]