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

14
LINES

< > BotCompany Repo | #1036337 // UpDown

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (40L) is out of date.

enum UpDown {
  up(true), down(false);
  
  bool bit;
  
  private *(bool *bit) {}
  
  static UpDown fromBool(bool bit) { ret bit ? up : down; }
  
  bool isUp() { ret bit; }
  bool isDown() { ret !bit; }
  
  int direction() { ret isUp() ? 1 : -1; }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1036337
Snippet name: UpDown
Eternal ID of this version: #1036337/8
Text MD5: 2b817ff22768dd40c70fdd98ba9b485e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-11-21 10:25:26
Source code size: 266 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 17 / 49
Version history: 7 change(s)
Referenced in: [show references]