This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 毎日『m段上ってn段下がる』を繰り返したら、x日目にd段目に初めて着いた。 | |
# xをd,m,nで表せ。 | |
# 文字はすべて正の整数で、m>nとする。 | |
# https://twitter.com/hyuki/status/1134018952416321536 | |
class Stairs | |
def initialize(dest, up, down) | |
@dest = dest | |
@up = up | |
@down = down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'fileutils' | |
USAGE =<<END_OF_USAGE | |
$ ./snapshot <target>.<ext> | |
Save snapshot of taget into HISTORY_DIR/<target>-yyyymmdd.<ext> | |
END_OF_USAGE | |
# 設定 -------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# coding: utf-8 | |
require 'curses' | |
Curses.init_screen | |
text = "TEXT" | |
attrs = { | |
normal: Curses::A_NORMAL, |
OlderNewer