【随时更新】小菜梆子的Python Challenge 攻略过程
来源:互联网 发布:淘宝vr资源怎么搜索 编辑:程序博客网 时间:2024/04/27 15:30
2016.6.8
心血来潮决定攻略Python Challenge,不知道什么时候能通(fang)关(qi)嗯
话说在Google的帮助下,应该能通关吧,恩,立个flag
http://www.pythonchallenge.com/
挑战开始
http://www.pythonchallenge.com/pc/def/0.html
2016.6.9
先吐个槽,csdn这个博客好难用啊。。。不能随手插图片不说,这个什么是个什么鬼啊,我昨天晚上发出去之后审核了一个多小时,行不行啊。。。
算了,感觉更几关然后写作业去了
第0关
http://www.pythonchallenge.com/pc/def/0.html
我上课做这个的时候一定是没睡醒,这个看着怎么也不像238啊,显然是2^38……
pow(2,38)得到结果274877906944L。去掉无用的L,进入下一关
第1关
http://www.pythonchallenge.com/pc/def/map.html
明显是把字母加2嘛,g fmnc翻译成i hope,但是不可能手翻,代码如下:
chr(ord(ch)+2)<span style="white-space:pre"></span># ch为每一个字符需要考虑的条件是ch为字母,且若翻译过后大于'z'则需减去26 。 不难得到结果 "ocr"
第2关
http://www.pythonchallenge.com/pc/def/ocr.html
MAYBE they are in the page source,显然答案在网页的源码里啊
</body></html><!--find rare characters in the mess below:--><!--%%$@_$^__#)^)&!_+]!*@&^}@[@%]()%+$&[(_@%+%$*^@$^!+]!&_#)_*}{}}!}_]$[%}@[{_@#_^{*@##&{#&{&)*%(]{{([*}@[@&]+!!*{)!}{%+{))])[!^})+)$]#{*+^((@^@}$[**$&^{$!@#$%)!@(&+^!{%_$&@^!}$_${)$_#)!({@!)(^}!*^&!$%_&&}&_#&@{)]{+)%*{&*%*&@%$+]!*__(#!*){%&@++!_)^$&&%#+)}!@!)&^}**#!_$([$!$}#*^}$+&#[{*{}{((#$]{[$[$$()_#}!@}^@_&%^*!){*^^_$^]@}#%[%!^[^_})+@&}{@*!(@$%$^)}[_!}(*}#}#___}!](@_{{(*#%!%%+*)^+#%}$+_]#}%!**#!^_)@)$%%^{_%!@(&{!}$_$[)*!^&{}*#{!)@})!*{^&[&$#@)*@#@_@^_#*!@_#})+[^&!@*}^){%%{&#@@{%(&{+(#^{@{)%_$[+}]$]^{^#(*}%)@$@}(#{_&]#%#]{_*({(])$%[!}#@@&_)([*]}$}&${^}@(%(%[@%!}%*$}(*@)}){+@(%@*$&]*^*}*]&$[}*]%]+*}^!}*$^^_()#$^]++@__){&&+((#%+(&+){)$%&&#($[[+##*%${)_!+{_[})%++)$#))]]]$]@]@($+{&%&%+!!!@]_]+])^*@$(@#${}}#}{%}#+{(@后边还有很多,就不都粘在这了。看这意思是要在这堆字符里找到出现次数最少的.
代码部分先跳过吧,码几个字睡觉了。。。上边这题的结果是equality
第3关
http://www.pythonchallenge.com/pc/def/equality.html
连网页title都提示用re了,那就用吧。核心语句:
exp = re.compile('[^A-Z][A-Z]{3}[a-z][A-Z]{3}[^A-Z]')得到结果linkedlist。话说我第一次看成linkedin了我会说。。。
第4关
http://www.pythonchallenge.com/pc/def/linkedlist.html
2016.6.11更新
按照提示,地址改为http://www.pythonchallenge.com/pc/def/linkedlist.php
不知道干什么,依旧查看源码
<html><head> <title>follow the chain</title> <link rel="stylesheet" type="text/css" href="../style.css"></head><body><!-- urllib may help. DON'T TRY ALL NOTHINGS, since it will never end. 400 times is more than enough. --><center><a href="linkedlist.php?nothing=12345"><img src="chainsaw.jpg" border="0"/></a><br><br><font color="gold"></center>Solutions to previous levels: <a href="http://wiki.pythonchallenge.com/"/>Python Challenge wiki</a>.<br><br>IRC: irc.freenode.net #pythonchallenge</body></html>发现图片带个链接,
linkedlist.php?nothing=12345点开,页面显示
and the next nothing is 44827
那我就把url里的12345改成44827呗,
and the next nothing is 45439
继续,
Your hands are getting tired and the next nothing is 94485
这意思是不让我手动复制粘贴了呗,那就用脚本实现数字的提取和页面的访问
while True:text = urllib.urlopen('http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=' + nothing).read()print(text)words = text.split(' ')nothing = words[-1]反正运行速度也不快,我可以一直盯着访问结果,中间有几个不那么老实的页都被我发现了,最终得到结果peak.html
第5关
http://www.pythonchallenge.com/pc/def/peak.html
- 【随时更新】小菜梆子的Python Challenge 攻略过程
- python challenge的攻略
- Python Challenge攻略(更新到5)
- Python Challenge 通关攻略
- 一个古老的编程游戏:Python Challenge全通攻略
- 随时更新的日记
- Python资源(随时更新)
- 学习python的一些资料(收集,随时更新)
- 我的python学习网站(随时添加更新)
- Python中遇到的错误(随时更新)
- python challenge 7-12关 攻略
- python challenge 0-6关 攻略
- python challenge 13-16关 攻略
- python challenge 7学习过程
- 阅读梆子的反手日记
- 我的博客随时更新
- 收藏的文章,随时更新
- Python Numpy 线性代数操作总结(随时更新)
- LeetCode:Word Break
- Java 复制大文件方式(nio2 FileChannel 拷贝文件能力测试)
- android 弹出底部dialog
- 斐波那契数数列
- Linux 目录体系
- 【随时更新】小菜梆子的Python Challenge 攻略过程
- C++独孤九剑第四式——菩提无树(构造函数语意)
- response.setContentType()的作用及参数
- JS复习小计
- Ubuntu Server的安装配置
- POJ初级分类 贪心专题 poj1328 POJ2109 POJ 2586
- DCOS实践分享(2):基于Docker Compose和Swarm的Docker化之路
- 如何理解闭包这一概念
- 数据库连接池原理与实例解析