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

18
LINES

< > BotCompany Repo | #1003282 // unparsePoem - poem pretty printer

JavaX fragment (include)

1  
static S unparsePoem(L<E> poem) {
2  
  new L<S> l;
3  
  for (E e : poem) {
4  
    S s;
5  
    if (e.q != null)
6  
      s = "Usr: " + trim(e.q);
7  
    else if (e.a != null)
8  
      s = "Bot: " + trim(e.a);
9  
    else if (e.state != null)
10  
      s = "[" + trim(e.state) + "]";
11  
    else
12  
      s = "?";
13  
    if (e.comment != null)
14  
      s += " // " + e.comment;
15  
    l.add(s);
16  
  }
17  
  ret joinLines(l);
18  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1003282
Snippet name: unparsePoem - poem pretty printer
Eternal ID of this version: #1003282/1
Text MD5: 22ff83928b758411ef2d94c65d33162e
Author: stefan
Category: javax / talking robots
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-07-19 17:51:04
Source code size: 392 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 538 / 1272
Referenced in: [show references]