Python Forum

Full Version: Coding Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I am trying to solve a puzzle that is written in python. The solution is a set of gps coordinates like "N 38 32.321 W 90 31.312" The statement is a repeating python code. I think the solution is to add a "break" but I don't know how to properly do this in python. Does anyone know how to change the code to print the solution? Here is the code:

s=12

for i in range (33):

   o=i

Clarke=77

import random

e=random.randint (6,8)

Hector=485

laisis_fuscus=77

w=random.randint(1,6)

if e==6:

   e+=32

elif e==8:

   e+=30

else:

   e+=31

p=475

s*=2

Boggs=len("laisis_fuscus")

while not (w==6):

   print(laisis_fuscus)

   w+random.randint(1,6)

print ("Hector")

a=Boggs+Clarke

n=Hector+a

s+=5

if s==o:

   p+=2

else:

   p-=2

n+=Clarke
can you provide link to the puzzle itself?
Sure thing: https://www.geocaching.com/geocache/GC8F...tl-version

It's a geocache puzzle.
do you want the solution, or just a hint?
I am geocacher too :-)
How about a hint? I don't really know how to code in python though. Cool to see another cacher on here. :-)
Remove lines
while not (w==6):
 
   print(laisis_fuscus)
 
   w+random.randint(1,6)
 
print ("Hector")
All they do is to introduce random element, i.e. the code will continue after that part only if w=6.
Then you need to solve the puzzle
Okay, thank you for your help!
when I say you need to solve the puzzle, I mean you need to make the connection how to use the information in/from the script to get the coordinates (e.g. you may need to print something). You can also solve/reproduce what the script is doing on paper and get the result
what's going on? did you solve and find it? :-)