有趣的Python Challenge编程解谜游戏攻略二(5-9关)

**有趣的Python Challenge编程解谜游戏攻略二(5-9关)**

介绍

游戏介绍

平时自己学python,大家肯定很是无聊,推荐一个很早之前的网页版python闯关游戏——Python Challenge,虽然说这个网站很早了,但是很有意思,你会发现这些游戏一点也不简单,基本都需要通过编程来解决……

有意思的是,这是个解谜游戏,所以需要你细心去发现线索,破解谜底,并且考察的知识量也不是很小,很有意思。

游戏链接:http://www.pythonchallenge.com/

界面是这样的:

点击图中Click here to get challenged开始挑战。

0-4关攻略

(0-4关攻略:点击这里直接查看

写在前面

从第五关起,后面的关卡都是比较难的,但是我们是站在巨人的肩膀上的,我们可以参考前人智慧。
另外,其实每一关的网页标题都是有一定的提示作用的,注意查看。

关卡

第5关

在这里插入图片描述
提示pronounce it,貌似没头绪,查看源代码:

<html>
<head>
  <title>peak hell</title>
  <link rel="stylesheet" type="text/css" href="../style.css">
</head>
<body>
<center>
<img src="peakhell.jpg"/>
<br><font color="#c0c0ff">
pronounce it
<br>
<peakhell src="banner.p"/>
</body>
</html>
<!-- peak hell sounds familiar ? -->

可以看见注释<!-- peak hell sounds familiar ? -->读起来熟悉吗??其实就是pickle库,得到URL:http://www.pythonchallenge.com/pc/def/pickle.html进去之后发现一句话yes! pickle!,看来方向没错,但是没用。
网页标题是peak hell,网页源代码也有个peakhell标签,http://www.pythonchallenge.com/pc/def/banner.p看看再说,像是这样,看不懂:在这里插入图片描述
看来需要pickle了,上代码:

import pickle
from urllib.request import urlretrieve
url = 'http://www.pythonchallenge.com/pc/def/banner.p'
urlretrieve(url, filename = 'five.pkl')
with open('five.pkl', 'rb') as f:
    r = pickle.load(f)

结果是这样的

[(' ', 95)], [(' ', 14), ('#', 5), (' ', 70), ('#', 5), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 6), ('#', 3), (' ', 6), ('#', 4), (' ', 3), ('#', 3), (' ', 9), ('#', 3), (' ', 7), ('#', 5), (' ', 3), ('#', 3), (' ', 4), ('#', 5), (' ', 3), ('#', 3), (' ', 10), ('#', 3), (' ', 7), ('#', 4), (' ', 1)], [(' ', 3), ('#', 3), (' ', 3), ('#', 2), (' ', 4), ('#', 4), (' ', 1), ('#', 7), (' ', 5), ('#', 2), (' ', 2), ('#', 3), (' ', 6), ('#', 4), (' ', 1), ('#', 7), (' ', 3), ('#', 4), (' ', 1), ('#', 7), (' ', 5), ('#', 3), (' ', 2), ('#', 3), (' ', 5), ('#', 4), (' ', 1)], [(' ', 2), ('#', 3), (' ', 5), ('#', 3), (' ', 2), ('#', 5), (' ', 4), ('#', 4), (' ', 3), ('#', 3), (' ', 3), ('#', 4), (' ', 4), ('#', 5), (' ', 4), ('#', 4), (' ', 2), ('#', 5), (' ', 4), ('#', 4), (' ', 3), ('#', 3), (' ', 5), ('#', 3), (' ', 3), ('#', 4), (' ', 1<
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值