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

!7

sS questions = [[
  Do you ship to Norway? => Yes
  Do you ship to Oslo? => Yes
  Do you ship to Australia? => Sorry, we cannot ship there.
  Do you ship to Melbourne? => Sorry, we cannot ship there.
]];

sS facts = [[
  We ship to Norway
  We don't ship to Australia
  
  Melbourne is in Australia
  Oslo is in Norway
]];

sS rules = [[
  Q: Do you ship to X?
    (We ship to X) => A: Yes
    (We don't ship to X) => A: Sorry, we cannot ship there.
    (We ship to X for a fee of Y) => A: Yes, for a fee of Y we will ship to X.
    (X is in Y) => Replace question with: Do you ship to Y?
    
  Always: (Replace question with: X) => Q: X
  
  lvjqbruihqmsgckd - Do you ship to X?
  aileauajpxpgymdj - We ship to X
  siacyutikdvksvwp - We don't ship to X
  zlrmmqtlczxnjabk - Sorry, we cannot ship there.
  vzfbivkrprmgghhp - Replace question with: X
  wmwqvagqbsfenmtf - X is in Y
]];

p {
  rules = rules_unfoldIndented(rules, "Always: ");
  print(rules);
  myTruthNonPersist(facts + standardConcepts() + rules);
  lispCheckQuestionsVerbose(questions);
  lispBot();
}

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: 501 / 597
Version history: 15 change(s)
Referenced in: [show references]