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.

1  
enum UpDown {
2  
  up(true), down(false);
3  
  
4  
  bool bit;
5  
  
6  
  private *(bool *bit) {}
7  
  
8  
  static UpDown fromBool(bool bit) { ret bit ? up : down; }
9  
  
10  
  bool isUp() { ret bit; }
11  
  bool isDown() { ret !bit; }
12  
  
13  
  int direction() { ret isUp() ? 1 : -1; }
14  
}

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: 115 / 188
Version history: 7 change(s)
Referenced in: [show references]