Skip to content
Open

uhuy #13

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions bigrandom/answer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,43 @@ 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

# <<<<<<< HEAD
data = open('data.txt','r')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coba pakai self.data aja

# your algorithm
line = ""
for char in data:

for x in range(0,len(char)):
if (char[x]=='#'):
line = char[x+1:]
break
x+=1
for y in line:
if (y=='#'):
noh+=1
suc+=ord(y)

# i=0
# while (line[0]!="#"):

# for char in data.readline():
# if (char=='#'):
# noh+=1
# else:
# suc= suc+ ord(char)
#
# noh = noh-10000
# suc = suc-orc(10000)
return (noh,suc)

# add methods if you need more
# add methods if you need more
big = BigRandom()
print (big.answer())


# your algorithm

# return (noh,suc)

# add methods if you need more
# >>>>>>> 64e1f92e25e7147b206ac73695e846881e7f9b0d
19 changes: 17 additions & 2 deletions caesar/answer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ def answer(self):

# your algorithm

return (key)

# add methods if you need more

# add methods if you need more
word = open(self.ciphertext,"r")
# text = open("apagitu.txt","w");

new=""
for x in word.read():
i=0
i=ord(str(x))-46
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ini tau 46 dari mana? Kamu disuruh nyari algoritma buat nyari 46 nya ini, bukan bikin decrypternya

if(i<0):
i=i+127
new += chr(i)
# text.write(new)
print(new)
return (key)
ans = Caesar()
print (ans.answer())