zoukankan      html  css  js  c++  java
  • pythonchallenge 解谜 Level 5

    第五关的确很坑爹。。。

    不过,根据之前的思路,我想着是把信息放在了 “源码” 中。

    翻了下源码。有用的东西在以下部分。

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

    出现了一个 src = "banner.p" 应该是一个有用的文件,替换下 url 下载,打开后发现

    (lp0
    (lp1
    (S' '
    p2
    I95
    tp3
    aa(lp4
    ...

    下一个信息 peak hell sounds familiar ? pick? 于是手动百度过发现有 pickle 这个模块。

    替换下 url 发现下一个页面是 yes! pickle!  说明我们的方向是对的。

    关于 pickle 模板 的使用。下面豆瓣这个介绍还是值得看一下的。

    https://www.douban.com/note/143585267/

    想着我们得到的文件应该是需要把文件进行重构对象。

    重构先。

     1 #-*- coding:utf-8 -*-
     2 #代码版本均为python 3.5.1
     3 #Level 5
     4 
     5 import pickle
     6 
     7 pkl_file = open('banner.p', 'rb')
     8 
     9 data = pickle.load(pkl_file)
    10 
    11 print (data)

    得到的是

    [[(' ', 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 #-*- coding:utf-8 -*-
     2 #代码版本均为python 3.5.1
     3 #Level 5
     4 
     5 import pickle
     6 
     7 pkl_file = open('banner.p', 'rb')
     8 
     9 data = pickle.load(pkl_file)
    10 
    11 print (data)
    12 
    13 print ('
    '.join([''.join([p[0] * p[1] for p in row]) for row in data]))

    然后,进入下一关。

                  #####                                                                      ##### 
                   ####                                                                       #### 
                   ####                                                                       #### 
                   ####                                                                       #### 
                   ####                                                                       #### 
                   ####                                                                       #### 
                   ####                                                                       #### 
                   ####                                                                       #### 
          ###      ####   ###         ###       #####   ###    #####   ###          ###       #### 
       ###   ##    #### #######     ##  ###      #### #######   #### #######     ###  ###     #### 
      ###     ###  #####    ####   ###   ####    #####    ####  #####    ####   ###     ###   #### 
     ###           ####     ####   ###    ###    ####     ####  ####     ####  ###      ####  #### 
     ###           ####     ####          ###    ####     ####  ####     ####  ###       ###  #### 
    ####           ####     ####     ##   ###    ####     ####  ####     #### ####       ###  #### 
    ####           ####     ####   ##########    ####     ####  ####     #### ##############  #### 
    ####           ####     ####  ###    ####    ####     ####  ####     #### ####            #### 
    ####           ####     #### ####     ###    ####     ####  ####     #### ####            #### 
     ###           ####     #### ####     ###    ####     ####  ####     ####  ###            #### 
      ###      ##  ####     ####  ###    ####    ####     ####  ####     ####   ###      ##   #### 
       ###    ##   ####     ####   ###########   ####     ####  ####     ####    ###    ##    #### 
          ###     ######    #####    ##    #### ######    ###########    #####      ###      ######
    http://www.pythonchallenge.com/pc/def/channel.html
  • 相关阅读:
    远程连接阿里云服务器记录
    java 怎样 改变 数组元素的值
    Knife4j 注解详谈
    warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&f);
    三分钟了解VRRP、堆叠、M-LAG这三大虚拟化技术
    网络虚拟化VXLAN网络架构
    虚拟化平台运维 10 个知识和经验
    BIOS 与 UEFI引导流程
    MBR 与 GPT
    4KB扇区硬盘来了,RAID、VMware兼容不?
  • 原文地址:https://www.cnblogs.com/qipa/p/5509924.html
Copyright © 2011-2022 走看看