Skip to content

Frankenstein - HH11 #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 66 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
6b62af8
Level 2
forensicman Oct 25, 2020
e69d1a8
Level 5
forensicman Nov 15, 2020
9a57e9b
Update Frankenstein.py
forensicman Nov 19, 2020
9c109ee
fixed missing n
forensicman Nov 19, 2020
93e00c7
badge number solution first half
Nov 19, 2020
b1bfc27
finished level 3 solution
Nov 21, 2020
9e26a6b
Updated Frankenstein.py with Level 3
Nov 21, 2020
c1a2369
Level 4 solution placeholder
Nov 21, 2020
46c2ec6
remove import random from function
Nov 21, 2020
6510862
Level 4 solution
Nov 21, 2020
8a44c55
Level 4 in Frankenstein.py
Nov 21, 2020
62ed42f
small fixes
Nov 21, 2020
e9ba0c7
Add files via upload
forensicman Nov 23, 2020
3117188
Christoph's stuff
forensicman Nov 23, 2020
698c06f
final (hopefully...)
forensicman Nov 27, 2020
c3d5de5
Feinschliff
forensicman Nov 28, 2020
fef26c0
Powerpoint Präsi geadded
forensicman Nov 28, 2020
39b2dd6
Merge remote-tracking branch 'origin/christoph' into lisa
Nov 29, 2020
591d54b
merged christoph into my branch
Nov 29, 2020
2c7a84a
level 4 create random code
Nov 29, 2020
80550f4
Merge branch 'lisa' of https://github.com/lisamowagner/pythonescapero…
Nov 29, 2020
e23e878
Merge remote-tracking branch 'origin/thomas' into lisa
Nov 29, 2020
c080754
removed merge conflicts
Nov 29, 2020
869de8c
Solutions updated
Nov 29, 2020
4c26de0
order of levels
Nov 29, 2020
f694fdc
Added slides, no content
lisamowagner Nov 29, 2020
c1a18b5
Delete 8csum9c.py
forensicman Nov 29, 2020
32d12f9
Updated Level 3 logic to take an argument
Nov 30, 2020
7af4eee
Added task message & hints
Nov 30, 2020
5ec9410
minor fix
Nov 30, 2020
ed772d8
Comments
Dec 1, 2020
cbc0f66
Merge branch 'lisa' of https://github.com/lisamowagner/pythonescapero…
Dec 1, 2020
8763ed0
Add files via upload
lisamowagner Dec 1, 2020
bf40639
text updates
Dec 2, 2020
575dd6d
Merge branch 'lisa' of https://github.com/lisamowagner/pythonescapero…
Dec 2, 2020
bfb7d61
Merge remote-tracking branch 'origin/thomas' into lisa
Dec 2, 2020
7a07cc6
Aenderungen vom Meeting
forensicman Dec 2, 2020
04dd0dc
Merge branch 'lisa' of https://github.com/lisamowagner/pythonescapero…
Dec 4, 2020
a728da8
Lvl 3 new, lvl 4 one return
Dec 4, 2020
da494ed
Text Updates
Dec 4, 2020
8dbfb7c
Merge pull request #2 from lisamowagner/lisa
lisamowagner Dec 4, 2020
0fe46fc
Renamed solutions files
Dec 4, 2020
f576a9d
Added code for decrypt lvl 6
Dec 4, 2020
a234f0f
Deleted unnecessary files
Dec 4, 2020
ea2105a
Typos
Dec 4, 2020
47d58f0
Ordner umbenannt
Dec 5, 2020
e8bd68b
Add files via upload
lisamowagner Dec 5, 2020
c3b3018
Deleted powerpoint_slides
Dec 5, 2020
e821b29
Add files via upload
lisamowagner Dec 5, 2020
0bd0e3f
TR eigenständigkeitserklärung
forensicman Dec 5, 2020
5850d4c
Update Frankenstein_Level2.py
forensicman Dec 5, 2020
f250417
Added function to encrypt a text
Dec 5, 2020
0215284
git
Dec 5, 2020
a06ae74
Delete Eigenständigkeitserklärung_Lisa_Wagner.pdf
lisamowagner Dec 5, 2020
84d56d0
Add files via upload
lisamowagner Dec 5, 2020
2038cf9
Feinschliff
Dec 5, 2020
b2154f0
Add files via upload
lisamowagner Dec 5, 2020
e9fb004
Delete frankenstein.pptx
lisamowagner Dec 5, 2020
aadb652
Longer delay for hints
Dec 5, 2020
680a755
Missing comma added Lvl 3
Dec 5, 2020
65822f3
Merge branch 'master' of https://github.com/lisamowagner/pythonescape…
Dec 5, 2020
6524cce
Deleted files for data privacy
Dec 5, 2020
bdc06c9
Delete syyfvs7.py
lisamowagner Dec 5, 2020
1851c38
crypt text level 6 in task messages
forensicman Dec 6, 2020
5a4e90e
lvl 6 klammern und zahlen wech
forensicman Dec 6, 2020
05544e6
Schönheitsreparaturen in den Hints
Dec 6, 2020
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
36 changes: 0 additions & 36 deletions rooms/ExampleRoom.py

This file was deleted.

416 changes: 416 additions & 0 deletions rooms/Frankenstein.py

Large diffs are not rendered by default.

62 changes: 0 additions & 62 deletions rooms/MyRoom.py

This file was deleted.

6 changes: 0 additions & 6 deletions solutions/ExampleRoom_Level1.py

This file was deleted.

9 changes: 9 additions & 0 deletions solutions/Frankenstein_Level1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def run(rectangle):
m = [] # Mittelpunkt des Rechtecks - List
# Werte aus dem Tupel mit Formel für x
m.append(rectangle[0] + (2 / (rectangle[4] - rectangle[0])))
# Werte aus dem Tupel mit Formel für y
m.append(rectangle[1] + (2 / (rectangle[5] - rectangle[1])))

print(m)
return m
18 changes: 18 additions & 0 deletions solutions/Frankenstein_Level2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import string
from itertools import product

def run(doorbell):
vowels_alphabetical_order = ["a","e","i","o","u"]
doorbell_solution_vowels = []
for character in doorbell:
##If vowel add to vowel list
if character in vowels_alphabetical_order:
doorbell_solution_vowels.append(character)

combination_list = list(product(vowels_alphabetical_order,repeat=len(doorbell_solution_vowels)))
position_counter = 1
for c in combination_list:
position_counter = position_counter + 1
if tuple(doorbell_solution_vowels) == c:
print(position_counter)
return position_counter
86 changes: 86 additions & 0 deletions solutions/Frankenstein_Level3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import random

name = 'Adam Chattoway'

def run(name):

# Slicing & Indexing to get the initials from the name

def get_initials(name):

initials =[]
names = name.split()

for i in range(0,2):
initials.append(names[i][0])

return initials

# Using the initials for the seed

initials = get_initials(name)

def create_seed(initials):

seed_digits = [ord(i) for i in str(initials)]

return sum(seed_digits)

seed = create_seed(initials)

# Check if the digits are unique within a 3 digit block

def unique_digits(a):

digits = [int(i) for i in str(a)]

if digits[0] == digits[1]:
return False

elif digits[0] == digits[2]:
return False

elif digits[1] == digits[0]:
return False

else:
return True

# Calculate a cross sum for a given number

def cross_sum(a):

cross_sum_digits = [int(i) for i in str(a)]

return sum(cross_sum_digits)

# Randomly create 3-digit numbers from seed, check the requirements and add to list if they are met

random.seed(seed)

numbers = []

while len(numbers) < 3:

x = random.randint(seed,988)

if unique_digits(x) == True:

if cross_sum(x) >= 9 and cross_sum(x) <= 15:

numbers.append(x)

else:
continue

# Create the strings and join/add everything together

badge_initials = ''.join(get_initials(name))
badge_nums = '-'.join(map(str, numbers))

badge_number = badge_initials + '-' + badge_nums

print(badge_number)
return badge_number

run(name)
48 changes: 48 additions & 0 deletions solutions/Frankenstein_Level4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
from itertools import permutations
import string

# code = ['A1', 'B1', 'C1', 'D1', 'E1', 'F1']

def run(code):
'''
find the right 3 keys red, blue, yellow
decode numbers from the note
'''
# Try out all combinations of the keys

def key_combinations():

colours =['red', 'yellow', 'blue']
all_possible_compinations = []

p = permutations(colours)

for p in list(p):
all_possible_compinations.append(p)

return all_possible_compinations

# Decode the numbers to open the safe, 1-52 (A1 - Z2)

def decoding_numbers(code):

# Create the list of the uppercase letters of the alphabet with a 1 and then a 2 added

alphabet = list(string.ascii_uppercase)

key = [item + '1' for item in alphabet] + [item + '2' for item in alphabet]

# Decode the numbers using their list position

decoded_numbers = []

for item in code:

num = key.index(item)

decoded_numbers.append(num+1)

return decoded_numbers

print(key_combinations() + decoding_numbers(code))
return key_combinations() + decoding_numbers(code)
12 changes: 12 additions & 0 deletions solutions/Frankenstein_Level5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def run(task_messages):
picture_lines = task_messages[0:10]
aligned_picture_lines = []
date_from_picture = list(map(int, str(picture_lines[9])))

for i, elem in enumerate(picture_lines[0:8]):
picture_line = list(picture_lines[i])
del picture_line[:date_from_picture[i]]
picture_line = ''.join(picture_line)
aligned_picture_lines.append(str(picture_line))

return aligned_picture_lines
34 changes: 34 additions & 0 deletions solutions/Frankenstein_Level6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
def run(data): # Tupel/Tripel 3 Elemente
msg_encr = data[0]
a = data[1]
b = data[2]

def decrypt(y, a_inv, b):
return ((a_inv*(y - b)) % 26)

def euklid(a, m):
def ggt_euklid(a, b):
if a == 0:
return (b, 0, 1)
else:
ggt, y, x = ggt_euklid(b % a, a)
return (ggt, x - (b // a) * y, y)

ggt, x, y = ggt_euklid(a, m)
if ggt != 1:
# Laufzeitfehler
raise Exception("Es gibt kein inverses zu a modulo m")
else:
return x % m

alphabet = "abcdefghijklmnopqrstuvwxyz"
msg = ""
for y in msg_encr:
if alphabet.find(y) == -1:
msg = msg + y
else:
a_inv = euklid(a, 26)
x = decrypt(alphabet.find(y), a_inv, b)
msg = msg + alphabet[x]
print(msg) # die Lösung wird in der Kommandozeile ausgegeben
return msg # auf msg ist nun die entschlüsselte Nachricht gespeichert
21 changes: 21 additions & 0 deletions solutions/Frankenstein_Level6_Crypt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
def crypt(x, a, b):
return ((a*x+b) % 26)


msg = "der junge lebt wieder. das tonikum hat geholfen, seinen aggressiven drang zu lindern, aber er wird von den erinnerungen an seine vergangenheit heimgesucht. ich ertappte ihn wieder beim schleichen zum fenster dieses maedchens. meine theorien brauchen mehr arbeit. diese schoepfung ist wie so viele andere unvollkommen."
msg_crypt = ""
a = 25
b = 13

alphabet = "abcdefghijklmnopqrstuvwxyz"

for x in msg:
if alphabet.find(x) == -1:
msg_crypt = msg_crypt + x
else:
y = crypt(alphabet.find(x), a, b)

msg_crypt = msg_crypt + alphabet[y]


print(msg_crypt)
20 changes: 16 additions & 4 deletions static/escape.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ function next_room() {
);
}

//changed from "text" to "html" convert
function notify(message, fadeout = true) {
if (fadeout) {
$("#message").text(message).fadeTo(500, 1).delay(3000).fadeTo(500, 0);
$("#message").html(message).fadeTo(500, 1).delay(6000).fadeTo(500, 0);
}
else {
$("#message").text(message).fadeTo(500, 1);
$("#message").html(message).fadeTo(500, 1);
}
}

Expand Down Expand Up @@ -136,12 +137,23 @@ function upload() {
});
}

//Convert message to html and make sure it can handle arrays if solution returns an array
function show_result(result) {
var html_msg = "Deine Lösung ist:<br>"
if (result.solution.constructor.name == "Array") {
result.solution.forEach(function(m, index){
html_msg = html_msg + m + "<br>";
});
}
else {
html_msg = html_msg + result.solution + "<br>"
}

if (result.correct) {
notify("Deine Lösung ist: " + result.solution + ". Juhu, das war richtig!");
notify(html_msg + "Juhu, das war richtig!");
next_level();
}
else {
notify("Deine Lösung ist: " + result.solution + ". Das ist leider falsch.");
notify(html_msg + "Das ist leider falsch.");
}
}