良玉的博客 点点滴滴,积水成河_良玉的博客_页游、手游linux运维工程师之路

javascript时间戳转换

// 将当前时间换成时间格式字符串var timestamp3 = 1403058804;var newDate = new Date();newDate.setTime(timestamp3 * 1000);// Wed Jun 18 2014 console.log(newDate.toDateString());// Wed, 18 Jun 2014 02:33:24 GMT console.log(newDate.toGMTString());// 2014-06-18T02:33:24

阅读全文...

python自动创建迷宫

from random import shuffle, randrange   def make_maze(w = 16, h = 8):     vis = [[0] * w + [1] for _ in range(h)] +&n

阅读全文...

标签: python迷宫

作者:良玉 分类:Python 浏览:183 评论:0

有趣的shell,管道

#!/bin/bash#按回车退出p=1f=75 s=13 r=200 t=0w=$(tput cols) h=$(tput lines)# ab -> idx = a*4 + b# 0: up, 1: right, 2: down, 3: left# 00 means going up   , then going up   -> ┃# 12 means going right, then going down -> ┓sets=(   

阅读全文...