hint1: start from 90052
hint2: answer is inside the zip
打开90052.txt,内容是Next nothing is 94191,看来这题是跟第四题一样,找next nothing。同时要用到对ZIP的处理。 准备编程,将下载下来的channel.zip保存到本地环境。
import zipfile
import re
if __name__ == '__main__':
z = zipfile.ZipFile('channel.zip', mode='r')
prefix = '90052'
surfix = '.txt'
findNothing = re.compile('Next nothing is (\d*)').search
while True:
text = z.read(prefix + surfix);
print(text)
match = findNothing(text)
if match:
prefix = match.group(1)
else:
break
最后输出一句:Collect the comments.
去哪儿收集comments呢,再次看页面源码,也没什么特殊的comments,会不会是在zip文件里呢? 于是修改代码,使用ZipInfo类获取comment:
import zipfile
import re
if __name__ == '__main__':
z = zipfile.ZipFile('channel.zip', mode='r')
prefix = '90052'
surfix = '.txt'
findNothing = re.compile('Next nothing is (\d*)').search
comments = []
while True:
text = z.read(prefix + surfix);
print(text)
match = findNothing(text)
if match:
prefix = match.group(1)
comments.append(z.getinfo(prefix + surfix).comment)
else:
break
print(''.join(comments))
最后打印出:
***************************************************************
****************************************************************
** **
** OO OO XX YYYY GG GG EEEEEE NN NN **
** OO OO XXXXXX YYYYYY GG GG EEEEEE NN NN **
** OO OO XXX XXX YYY YY GG GG EE NN NN **
** OOOOOOOO XX XX YY GGG EEEEE NNNN **
** OOOOOOOO XX XX YY GGG EEEEE NN **
** OO OO XXX XXX YYY YY GG GG EE NN **
** OO OO XXXXXX YYYYYY GG GG EEEEEE NN **
** OO OO XX YYYY GG GG EEEEEE NN **
** **
****************************************************************
**************************************************************
出来这个结果很惊讶,原来comment中包含有换行符,开始还以为会出一行长串字符呢。
HOCKEY应该就是过关答案了。
将hockey应用到url上,出现it's in the air. look at the letters. 原来还有个小关卡。这下晕了,开始以为是文字游戏,答案在“air”中,于是试了a,i,r三个字母的每种排列,无效,实在没办法了,上网找线索………… 原来,答案是oxygen,你能猜到吗?
(oxygen就是组成HOCKEY的小字母)
把oxygen应用到url上,过关。
通过这一题,学习到了zipfile的简单使用。
0
顶
0
踩
分享到:
2009-12-29 16:05
浏览 5405
评论
1 楼
plmxsyuts6
2012-03-03
it's in the air. look at the letters.
答案oxygen氧气,不是
(oxygen就是组成HOCKEY的小字母)