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).

!7

p {
  assertEquals("0", calc("0"));
  assertEquals("1", calc("1"));
  assertEquals("1", calc("1!"));
  assertEquals("1", calc("0!"));
  assertEquals("1", calc("!0"));
  assertEquals("0", calc("!1"));
  assertEquals("0", calc("!0!"));
  assertEquals("1", calc("!!0!"));
  assertEquals("0", calc("!!0"));
  assertEquals("1", calc("!!!0"));
  assertEquals("1", calc("0!!"));
  assertEquals("1", calc("1!!"));
  assertEquals("0", calc("!0!!"));
  assertEquals("0", calc("!0!!!"));
  assertEquals("0", calc("!0!!!!"));
}

sS calc(S s) {
  ret repeatMultiReplace3(s, "0!", "1", "1!", "1", "!0", "1", "!1", "0");
}

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: 679 / 828
Version history: 14 change(s)
Referenced in: #1006862 - !x! (golfed version)