Timeline for Is my barcode valid?
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 16, 2017 at 16:16 | history | edited | pizzapants184 | CC BY-SA 3.0 | -7 from Nahuel Fouilleul |
| Nov 16, 2017 at 13:07 | comment | added | Nahuel Fouilleul | also i<8 can be replaced by x | |
| Nov 16, 2017 at 13:03 | comment | added | Nahuel Fouilleul | the tio link is 61 bytes but in the answer it's 72, also don't know why x=c%10<1 or c=c%10<1 instead of return c%10<1 still works | |
| Nov 15, 2017 at 18:57 | history | edited | pizzapants184 | CC BY-SA 3.0 | -11 from Neil (again) |
| Nov 15, 2017 at 16:59 | comment | added | Neil | In fact I think s is unnecessary: c;i;f(x){for(i=c=0;i<8;x/=10)c+=(1+2*i++%4)*x;return c%10<1;} | |
| Nov 15, 2017 at 16:49 | comment | added | pizzapants184 | @Neil Thanks! That got -10 bytes. | |
| Nov 15, 2017 at 16:48 | history | edited | pizzapants184 | CC BY-SA 3.0 | -1 bytes from Neil |
| Nov 15, 2017 at 16:30 | comment | added | Neil | I think (x%10) can just be x as you're taking c%10 later anyway. Also I think you can use i<8 and then just test whether c%10 is zero at the end. | |
| Nov 15, 2017 at 16:21 | history | edited | pizzapants184 | CC BY-SA 3.0 | -2 bytes |
| Nov 15, 2017 at 16:11 | history | answered | pizzapants184 | CC BY-SA 3.0 |