… 链接是攻略… 想玩游戏的话先别点, 第九关的数字, 攻略上讲了但是用来不同的软件… 没劲…用代码请问怎么写的?
数据 Gist 好了, Markdown 影响性能, https://gist.github.com/4054140
有意思
地址发上去 http://segmentfault.com/game/
脱光好久了不玩哈哈。
ASIIC 编码转 Base64… 问了同学原理然后搞定了… tar 包解压的那一步… 不知道 Node 怎么用, 只好调用了 Bash 命令 代码是 LiveScript
require! \fs require! \buffer require! \path {exec} = require \child_process show = console.log fs.read-file \string.txt \utf8 (err, file) -> throw err if err? string = file.replace(/\_/g, '1').replace(/\n/g, ' ') arr = string.split ' ' res = arr .map -> parse-int it, 2 .map -> String.from-char-code it .join '' b = new Buffer res, \base64 fs.write-file \a.tgz b, -> exec "/bin/tar zxvf a.tgz" (err, stdout, stder) -> # show arguments arg = path.join __dirname, \./cang.jpg exec "google-chrome #arg"
现在能从代码里写出 .tar 包了… 求指点怎么用 Node 解开 .tar… 另外解压出来有两个问题, 其中一个是隐藏文件, 里面是什么?
require! \fs require! \buffer require! \path require! \zlib {exec} = require \child_process show = console.log fs.read-file \string.txt \utf8 (err, file) -> # throw err if err? res = file .replace /\_/g, '1' .replace /\n/g, ' ' .split ' ' .map -> parse-int it, 2 .map -> String.from-char-code it .join '' b = new Buffer res, \base64 zlib.gunzip b, (err, data) -> fs.write-file \c.tar data
Chrome控制台解法:
$('pre').innerHTML.replace(/_/g,1).split(/\s/).map(function(i){return String.fromCharCode(parseInt(i,2))}).join('');
得到base64字符串
CNode 社区为国内最专业的 Node.js 开源技术社区,致力于 Node.js 的技术研究。
有意思
地址发上去 http://segmentfault.com/game/
脱光好久了不玩哈哈。
ASIIC 编码转 Base64… 问了同学原理然后搞定了… tar 包解压的那一步… 不知道 Node 怎么用, 只好调用了 Bash 命令 代码是 LiveScript
现在能从代码里写出 .tar 包了… 求指点怎么用 Node 解开 .tar… 另外解压出来有两个问题, 其中一个是隐藏文件, 里面是什么?
Chrome控制台解法:
得到base64字符串