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

23
LINES

< > BotCompany Repo | #1006856 // !x! (long version)

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

Libraryless. Click here for Pure Java version (583L/4K/15K).

1  
!7
2  
3  
p {
4  
  assertEquals("0", calc("0"));
5  
  assertEquals("1", calc("1"));
6  
  assertEquals("1", calc("1!"));
7  
  assertEquals("1", calc("0!"));
8  
  assertEquals("1", calc("!0"));
9  
  assertEquals("0", calc("!1"));
10  
  assertEquals("0", calc("!0!"));
11  
  assertEquals("1", calc("!!0!"));
12  
  assertEquals("0", calc("!!0"));
13  
  assertEquals("1", calc("!!!0"));
14  
  assertEquals("1", calc("0!!"));
15  
  assertEquals("1", calc("1!!"));
16  
  assertEquals("0", calc("!0!!"));
17  
  assertEquals("0", calc("!0!!!"));
18  
  assertEquals("0", calc("!0!!!!"));
19  
}
20  
21  
sS calc(S s) {
22  
  ret repeatMultiReplace3(s, "0!", "1", "1!", "1", "!0", "1", "!1", "0");
23  
}

Author comment

http://codegolf.stackexchange.com/questions/109248/mathematics-is-fact-programming-is-not

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006856
Snippet name: !x! (long version)
Eternal ID of this version: #1006856/15
Text MD5: 519e8496467a882ef76a07c3b0b35743
Transpilation MD5: b5b64eba2967aa8d87495dc5943b182c
Author: stefan
Category: javax / fun
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-02-10 20:05:36
Source code size: 633 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 678 / 828
Version history: 14 change(s)
Referenced in: [show references]