revrevrev
Desciption
Analysis
Solution
from itertools import product
# Product creates permutations from charset with length of 5
for ins in product("rRL", repeat=5):
ins = 'r' * 15 + ''.join(ins) # Concatenate answer
s, a, x, y = 0, 0, 0, 0
for c in ins:
if c == 'r': # rev
s += 1
elif c == 'L': # left
a = (a + 1) % 4
elif c == 'R': # right
a = (a + 3) % 4
else:
print("this character is not necessary for the solution.")
if a == 0: x += s
elif a == 1: y += s
elif a == 2: x -= s
elif a == 3: y -= s
if x == 168 and y == 32:
print("(%d, %d) flag{%s}" % (x, y, ins)) # fStrings and curly braces tricky
else:
print(f"({x}, {y}) incorrect sadly", end='\r')
Last updated