Timeline for Count without 3
Current License: CC BY-SA 3.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 7, 2016 at 12:55 | history | edited | Xanderhall | CC BY-SA 3.0 | saved bytes |
| Dec 6, 2016 at 16:15 | comment | added | Titus | Save one byte with %3<1, one with 51 instead of '3', two more with strstr($i) instead of strpos(_.$i) and another two by swapping the | operands in the second version: <?for(;strstr($i=++$argv[1],51)|$i%3<1;);echo$i; -> 48 bytes | |
| Nov 8, 2016 at 18:32 | history | edited | Xanderhall | CC BY-SA 3.0 | improved solution |
| Nov 4, 2016 at 18:12 | comment | added | Alex Howansky | Save a byte with strpos(_.$i,'3') | |
| Nov 4, 2016 at 12:16 | history | edited | Xanderhall | CC BY-SA 3.0 | improved solution |
| Nov 4, 2016 at 9:03 | comment | added | user59178 | most of the time questions are pretty flexible in how input and output is done, as long as the right thing is given and received. Besides, looking at answers in other languages, most choose to print to stdout. | |
| Nov 3, 2016 at 19:14 | comment | added | Xanderhall | @user59178 I assumed the function had to return $i | |
| Nov 3, 2016 at 16:39 | comment | added | user59178 | You can save 7 bytes by just using a program taking input from the command line rather than a function: for($i=$argv[1];!(++$i%3)|strpos(" $i",'3'););echo$i; it may be possible to do better by assigning $i while using it too. | |
| Nov 3, 2016 at 16:17 | history | answered | Xanderhall | CC BY-SA 3.0 |