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

36
LINES

< > BotCompany Repo | #1004851 // Solve An AI Job (Show Clapping Audience)

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

Libraryless. Click here for Pure Java version (3729L/25K/85K).

!752

!include #1004681 // Concepts
//include #1004848 // AIJob custom class

static S dbName = "AI Jobs.";
sbool doIt = true;

p {
  DialogIO db = findBot(dbName);

  for (PassRef job : (L<PassRef>) rpc(db, "xlist", "AIJob")) {
    S desc = cast rpc(db, "xget", job, "description");
    bool hot = cast rpc(db, "xget", job, "hot");
    bool doing = cast rpc(db, "xget", job, "doing");
    bool done = cast rpc(db, "xget", job, "done");
    S type = done ? "DONE Job"
      : doing ? "Job being done"
      : hot ? "HOT JOB" : "Non-hot Job";
    print(type + " >> " + desc);
    if (hot && !done && !doing && match("show a clapping audience", desc)) {
      print("I can do this!!");
      if (doIt) {
        print("Doing the job!!");
        PassRef doingObj = cast rpc(db, "xnew", "Doing", new O[] {"theJob", job, "programDoingIt", programID(), "vmID", vmID()});
        rpc(db, "xset", job, "doing", true);
        
        applaud(); // show the animation!
        
        rpc(db, "xset", job, "done", true);
      }
    }
  }
  
  db.close();
}

Author comment

Began life as a copy of #1004847

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1004851
Snippet name: Solve An AI Job (Show Clapping Audience)
Eternal ID of this version: #1004851/1
Text MD5: 743af26a65f8ff425c25f89fd7dc6746
Transpilation MD5: e9ac4b3cb74af622cc369cf0ca126269
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-09-05 17:40:27
Source code size: 1086 bytes / 36 lines
Pitched / IR pitched: No / No
Views / Downloads: 582 / 685
Referenced in: [show references]