Skip to content

Commit

Permalink
Create BlueBookCodeDecryption.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Tang committed May 19, 2015
1 parent 86d8792 commit 47b54c2
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions BlueBookCodeDecryption.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#BlueBook code decryption

import sys

def sieve(n):
x = [1] * n
x[1] = 0
for i in range(2,n/2):
j = 2 * i
while j < n:
x[j]=0
j = j+i
return x

def prime(n,x):
i = 1
j = 1
while j <= n:
if x[i] == 1:
j = j + 1
i = i + 1
return i - 1
x=sieve(10000)
code = [1206,301,384,5]
key =[1,1,2,2,]

sys.stdout.write("".join(chr(i) for i in [73,83,66,78,32,61,32]))
for i in range (0,4):
sys.stdout.write(str(prime(code[i],x)-key[i]))

print

0 comments on commit 47b54c2

Please sign in to comment.