-
-
Save GabeOchieng/ef8d11aa957ff04bea3d974f1a31e3a4 to your computer and use it in GitHub Desktop.
Revisions
-
adithyabsk revised this gist
Feb 23, 2021 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,6 +30,7 @@ def solve(): # middle ring 2 (starts at n=21) "00000101000000001000000000100100000011100000000111000001001100011111111111111111", ] # outer ring (starts at n=76) outer = "00001000100000001011000011101000000011100001110110000000101000000111110000010111" for m in msg: print(intarr2str(bit2int_arr(m))) -
adithyabsk revised this gist
Feb 23, 2021 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ """Python Script to solve the perseverence parachute code Output: DARE¿¿¿¿ -
adithyabsk revised this gist
Feb 23, 2021 . 1 changed file with 7 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,4 @@ """Python Script to solve the perseverence parachute code Output: DARE¿¿¿¿ @@ -51,4 +47,10 @@ def solve(): if __name__ == "__main__": """ Original Code by /u/rdtwt1 Outer Ring Solved by /u/tend0g Comments + Updated Code by /u/adithyabsk https://www.reddit.com/r/nasa/comments/lpy2fa/does_the_parachute_for_perseverance_have_some/goedts0/ """ solve() -
adithyabsk created this gist
Feb 23, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,54 @@ """Script to solve the perseverence parachute code Original Code by /u/rdtwt1 Outer Ring Solved by /u/tend0g Comments + Updated Code by /u/adithyabsk https://www.reddit.com/r/nasa/comments/lpy2fa/does_the_parachute_for_perseverance_have_some/goedts0/ Output: DARE¿¿¿¿ MIGHTY¿¿ THINGS¿¿ 34°11'58'' N 14°118'10'' W """ def bit2int_arr(msg): rslt = [] while len(msg) > 0: msg = msg[3:] # Skip the first 3 characters (padding) rslt.append(int(msg[:7], 2)) # Convert the binary string to an integer msg = msg[7:] # Skip 7 characters (we just read this char) return rslt def intarr2str(msg): return "".join([chr(i+64) for i in msg]) # Add 64 (ASCII offset) def solve(): msg = [ # inner ring (starts at n=1) "00000001000000000001000001001000000001010001111111111111111111111111111111111111", # middle ring 1 (starts at n=41) "00000011010000001001000000011100000010000000010100000001100100011111111111111111", # middle ring 2 (starts at n=21) "00000101000000001000000000100100000011100000000111000001001100011111111111111111", ] outer = "00001000100000001011000011101000000011100001110110000000101000000111110000010111" for m in msg: print(intarr2str(bit2int_arr(m))) coords = bit2int_arr(outer) degrees = u"\N{DEGREE SIGN}" print( f"{coords[0]}{degrees}" f"{coords[1]}'" f"{coords[2]}'' " f"{chr(coords[3]+64)} " f"{coords[4]}{degrees}" f"{coords[5]}'" f"{coords[6]}'' " f"{chr(coords[7]+64)}" ) if __name__ == "__main__": solve()