From 47b94dfe0efe3554bf8b694e05dad4662310ec04 Mon Sep 17 00:00:00 2001 From: Vatana Rianti Aldefi Date: Fri, 24 Feb 2017 20:51:29 +0700 Subject: [PATCH 1/2] ya sudahlah --- bigrandom/answer.py | 16 +++++++++++++--- caesar/answer.py | 12 +++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/bigrandom/answer.py b/bigrandom/answer.py index cb5fee4..672fd56 100644 --- a/bigrandom/answer.py +++ b/bigrandom/answer.py @@ -8,9 +8,19 @@ def answer(self): # ommiting line number's hashtag suc = 0 # variable to store sum of character's code in ascii, # ommiting line number and its hashtag - # your algorithm - + data = open ("data.txt", "r") + for char in data : + while (char[0] != "#") : + char = char[1:] + char = char[1:] + for i in char : + if (i == "#") : + noh+=1 + suc = suc + ord(char) + data.close() return (noh,suc) - # add methods if you need more \ No newline at end of file + # add methods if you need more +data = BigRandom() +print(data.answer()) \ No newline at end of file diff --git a/caesar/answer.py b/caesar/answer.py index 0d85db4..b944ff6 100644 --- a/caesar/answer.py +++ b/caesar/answer.py @@ -7,7 +7,13 @@ def answer(self): key = 0 # variable to store the key # your algorithm - - return (key) - + data = open (self.ciphertext,"r"); + for x in data.read(): + i = ord(x)-key + if (i<0): + i += 127 + tmp += chr(i) + data.close() + hasil = Caesar() + hasil.answer() # add methods if you need more \ No newline at end of file From 8ce2cc7515d41ca8b5e3ee81ddc8d01ee1e860f9 Mon Sep 17 00:00:00 2001 From: Vatana Rianti Aldefi Date: Fri, 24 Feb 2017 20:55:21 +0700 Subject: [PATCH 2/2] Vatana Rianti Aldefi - Tugas Computing Bismillah --- bigrandom/Vatana Rianti Aldefi - Tugas Computing | 1 + 1 file changed, 1 insertion(+) create mode 100644 bigrandom/Vatana Rianti Aldefi - Tugas Computing diff --git a/bigrandom/Vatana Rianti Aldefi - Tugas Computing b/bigrandom/Vatana Rianti Aldefi - Tugas Computing new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/bigrandom/Vatana Rianti Aldefi - Tugas Computing @@ -0,0 +1 @@ +