Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/martijnarts/tiniest-code. Finding the smallest possible implementation of a script (while adhering
Something went wrong. Try again.
123456789101112#!/usr/bin/env python3def shift(string, key, decipher=False): return ''.join( chr((ord(c) & 224)+(ord(c) % 32-1-key*(2*decipher-1)*c.isalpha()) % 26+1) for c in string)
if __name__ == '__main__': assert shift('abcz+', 1) == 'bcda+', shift('abcz+', 1) assert shift('ABCZ+', 1) == 'BCDA+', shift('ABCZ+', 1) assert shift('bcda+', 1, True) == 'abcz+', shift('bcda+', 1, True)