diff --git a/pycipher/foursquare.py b/pycipher/foursquare.py index 8f9118e..120d005 100644 --- a/pycipher/foursquare.py +++ b/pycipher/foursquare.py @@ -24,7 +24,7 @@ def __init__(self,key1='zgptfoihmuwdrcnykeqaxvsbl',key2='mfnbdcrhsaxyogvituewlqz def encipher_pair(self,a,b): arow,acol = self.alph.index(a)/5, self.alph.index(a)%5 brow,bcol = self.alph.index(b)/5, self.alph.index(b)%5 - return (self.key1[arow*5+bcol], self.key2[brow*5+acol]) + return (self.key1[int(arow*5)+bcol], self.key2[int(brow*5)+acol]) def decipher_pair(self,a,b): arow,acol = self.key1.index(a)/5, self.key1.index(a)%5 @@ -42,7 +42,7 @@ def encipher(self,string): :param string: The string to encipher. :returns: The enciphered string. """ - string = self.remove_punctuation(string) + string = self.remove_punctuation(string) if len(string)%2 == 1: string = string + 'X' ret = '' for c in range(0,len(string.upper()),2): @@ -70,4 +70,4 @@ def decipher(self,string): return ret if __name__ == '__main__': - print('use "import pycipher" to access functions') \ No newline at end of file + print('use "import pycipher" to access functions')