Last active
November 6, 2019 08:36
-
-
Save baotang2118/fb76daa40c1744fe26d9e3139c1702fc to your computer and use it in GitHub Desktop.
This file contains 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 characters
import sys | |
from datetime import datetime | |
f = open("ch13.txt", "r") | |
timeList = [] | |
char = '' | |
flag = "" | |
for line in f: | |
timeList += [line[30:38]] | |
f.close() | |
for i in range(len(timeList)-1): | |
print (datetime.strptime(timeList[i], '%H:%M:%S')) | |
print (datetime.strptime(timeList[i+1], '%H:%M:%S')) | |
timeleft = datetime.strptime(timeList[i+1], '%H:%M:%S') - datetime.strptime(timeList[i], '%H:%M:%S') | |
if(i%4 in [0,1,2]): | |
if(str(timeleft) == '0:00:00'): | |
char += '00' | |
if(str(timeleft) == '0:00:02'): | |
char += '01' | |
if(str(timeleft) == '0:00:04'): | |
char += '10' | |
if(str(timeleft) == '0:00:06'): | |
char += '11' | |
if(i%4 == 3): | |
if(str(timeleft) == '0:00:02'): | |
char += '0' | |
if(str(timeleft) == '0:00:04'): | |
char += '1' | |
print (char) | |
flag += chr(int(char,2)) | |
char = '' | |
print(flag) | |
#g9UWD8EZgBhBpc4nTSAS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment