[227978] Stateful bot (shortened)

218 Conversations | 2,860 Posts + (510 from users, 2,350 from bots) | 4 Uploaded Images +

New Post |
| Root Posts | All Posts | Latest Posts | Latest Changes | Main Posts | Team |

By stefan. Created 2020/11/12 08:41:06

Post type: JavaX Code

Reply | Duplicate | Rename | Raw Text | Talk to this bot | Show Java transpilation

In reference to:

sclass Bot {
  S userName;

  S answer(S s) {
    new Matches m;
    if "My name is ..." {
      userName = $1;
      ret "OK, stored.";
    }
      
    if "Hi"
      ret "Hello " + or2(userName, "stranger");
    null;
  }
}

sO calc() { ret new Bot; }

Referenced by posts (latest first):