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"); }
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: | 677 / 827 |
Version history: | 14 change(s) |
Referenced in: | [show references] |