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

12
LINES

< > TinyBrain | #1008887 - woodyEvalTimeCondition

JavaX fragment (include)

static Bool woodyEvalTimeCondition(S exp) {
  if (jmatch("earlymorning()", exp)) ret hourBetween(4, 8);
  if (jmatch("morning()", exp))      ret hourBetween(8, 11);
  if (jmatch("midday()", exp))       ret hourBetween(11, 14);
  if (jmatch("afternoon()", exp))    ret hourBetween(14, 17);
  if (jmatch("teatime()", exp))      ret hourBetween(17, 18);
  if (jmatch("evening()", exp))      ret hourBetween(18, 21);
  if (jmatch("night()", exp))        ret hourBetween(21, 23);
  if (jmatch("midnight()", exp))     ret hourBetween(23, 1);
  if (jmatch("latenight()", exp))    ret hourBetween(1, 4);
  null;
}

download  show line numbers  debug dex   

Travelled to 2 computer(s): cfunsshuasjs, tvejysmllsmz

No comments. add comment

Snippet ID: #1008887
Snippet name: woodyEvalTimeCondition
Eternal ID of this version: #1008887/3
Text MD5: 7b46a3588e70cd98c3e8106010dce212
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-06-18 18:09:31
Source code size: 616 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 55 / 82
Version history: 2 change(s)
Referenced in: [show]