Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- initial_angle = 0xD078%65536 #### Input as hex or a signed or unsigned integer (python treats hex like a decimal integer; the mod 65536 allows for signed int input)
- goal_angle_list = [0x0720, 0x0AF2, 0x0EEA] #### These are the working angles for sun's song
- if initial_angle > 65535 or initial_angle < 0 or isinstance(initial_angle, int) == False:
- print('Error: The initial angle is not a valid input')
- Solution_Found = False
- for i in range(8192):
- for angle in goal_angle_list:
- if (initial_angle + i*1800)%65536 == angle:
- Solution_Found = True
- print("%d = %s is a working initial angle with %d Left ESS turns for goal angle %d = %s" %(initial_angle, hex(initial_angle), i, angle, hex(angle)))
- if (initial_angle - i*1800)%65536 == angle:
- Solution_Found = True
- print("%d = %s is a working initial angle with %d Right ESS turns for goal angle %d = %s" %(initial_angle, hex(initial_angle), i, angle, hex(angle)))
- if Solution_Found == False:
- print("No solutions were found for this initial angle.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement