Timeline for CodeGolf - Heads or Tails
Current License: CC BY-SA 4.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 20, 2019 at 2:45 | comment | added | Jakob | True, but it works for any input, which is the most important thing. Now the question is can you find a shorter version? (I think you'll find there's a 17-byte solution). | |
| Aug 19, 2019 at 19:40 | comment | added | CuttingChipset | @Jakob yeah, but it's 25 now... | |
| Aug 19, 2019 at 18:58 | comment | added | Jakob | Welcome! This is a well-golfed solution but when the input is heads it only works when i is interned because of the reference comparison (==). For this reason strings are usually compared in Java using String#equals. Your TIO works because your inputs are string literals, but this approach doesn't work in general. I don't think assuming strings are interned/literal is typical on here, so you should probably make sure your solution doesn't rely on that. | |
| Aug 19, 2019 at 10:40 | review | Late answers | |||
| Aug 19, 2019 at 10:44 | |||||
| Aug 19, 2019 at 10:22 | history | answered | CuttingChipset | CC BY-SA 4.0 |