Uses 911K of libraries. Click here for Pure Java version (11455L/64K).
!7 sclass ICallYou > CruddieScript { swappable void setBotName(S name) {} swappable S getBotName() { null; } S answer(S s) null { new Matches m; if "I call you $name" { // fancy dollar var syntax with automatic declaration of S $name assume("\*$name*/ is a name"); setBotName($name); ret "OK, my name is now \*$name*/"; } if "What is your name" ret or2(getBotName(), "I don't know"); } } sclass SafeEvaluator > CruddieScript { S answer(S s) null { new Matches m; if "what is $expression" { if (!isSafeCodeFragment($expression)) { assume("\*$expression*/ is not a safe JavaX expression"); null; } assume("\*$expression*/ is a safe JavaX expression"); S result = strOrNull(dm_javaEvalOrInterpret($expression)); ret "Result: " + or(result, "nothing"); } } } cmodule SomeCruddieScripts { }
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1027663 |
Snippet name: | Some Cruddie Scripts |
Eternal ID of this version: | #1027663/5 |
Text MD5: | 73fadd5422b2fc3e7dc8072c62ca49f5 |
Transpilation MD5: | f83862f4dee6b04d0adb812c2cdef510 |
Author: | stefan |
Category: | javax / chat bots |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-04-01 13:33:13 |
Source code size: | 961 bytes / 39 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 216 / 54891 |
Version history: | 4 change(s) |
Referenced in: | [show references] |