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
# 毎日『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
public class AlphaBetaCom: Player { | |
private var color: Board.Color | |
private lazy var opponent: Board.Color = self.color.opponent | |
private var depth: Int | |
public init(color: Board.Color, depth: Int = 3) { | |
self.color = color | |
self.depth = depth | |
} |
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_relative "board" | |
require_relative "game" | |
module YWF | |
class AlphaBetaCom | |
def initialize(color, depth=3) | |
@color = color | |
@opponent = (color == Board::BLACK) ? Board::WHITE : Board::BLACK |
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
module YWF | |
class Board | |
ROW_MIN = 1 | |
ROW_MAX = 9 | |
COL_MIN = 1 | |
COL_MAX = 9 | |
WALL = -1 | |
EMPTY = 0 | |
BLACK = 1 |
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 | |
#---- | |
# ruby-nicovideo-dl.rb | |
#---- | |
# [Set up] | |
# 1. Install Netrc gem | |
# Use gem command. | |
# | |
# $ gem install netrc |
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 'netrc' | |
require 'net/http' | |
require 'net/https' | |
require 'cgi' | |
LoginURI = URI.parse("https://secure.nicovideo.jp/secure/login?site=niconico") | |
LoginPostFormat = "current_form=login&mail=%s&password=%s&login_submit=Log+In" |
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 'netrc' | |
require 'net/http' | |
require 'net/https' | |
require 'cgi' | |
LoginURI = URI.parse("https://secure.nicovideo.jp/secure/login?site=niconico") | |
LoginPostFormat = "current_form=login&mail=%s&password=%s&login_submit=Log+In" |
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 'netrc' | |
require 'net/http' | |
require 'net/https' | |
require 'cgi' | |
LoginURI = URI.parse("https://secure.nicovideo.jp/secure/login?site=niconico") | |
LoginPostFormat = "current_form=login&mail=%s&password=%s&login_submit=Log+In" |
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
目次 | |
========== | |
- 見出し | |
- 改行と段落 | |
- 強制改行 | |
- 段落 | |
- テキスト修飾 | |
- 強調 | |
- 打ち消し線 |
NewerOlder