Activity for lapiscarrotâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #293849 |
This gives the wrong answer, '`', for ROT('m',13), since ASCII uses offsets 1-26 for letters while modular arithmetic yields 0-25. A solution I found is to add 1 to the definition for o as follows:
90 bytes: lambda m,k:''.join([c,chr((o:=(2+('`'<c)<<5)+1)+(ord(c)+k-o)%26)][c.isalpha()] for c in m)... (more) |
— | 8 days ago |