This file contains hidden or 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 | |
# Wikipedia日本語版「市区町村立病院」から病院名を取り出す | |
require "nokogiri" | |
require "open-uri" | |
filename = "byoin.html" | |
if !test(?f, filename) | |
html = open("https://ja.wikipedia.org/wiki/%E5%B8%82%E5%8C%BA%E7%94%BA%E6%9D%91%E7%AB%8B%E7%97%85%E9%99%A2").read |
This file contains hidden or 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 | |
# kanji-by-kakusu.rb : print kanji (Chinese characters) within 15 stroke counts | |
# by takehikom | |
# 小学校で学習する15画以下の漢字をすべて出力する(他の画数,制限なしにも対応) | |
# 画数情報は,漢字辞典オンライン http://kanji.jitenon.jp/ にアクセスして取得 | |
require "open-uri" | |
require "kconv" |
This file contains hidden or 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 | |
# repeat3.rb : an inspector of a string that occurs three times successively, | |
# and generators of a string which consists of "a" and "b" | |
# and has no substring that occurs three times successively | |
# by takehikom | |
module Repeat3 | |
class Inspector | |
def initialize |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
/* | |
* colorchow.c : ANSIエスケープシーケンスを利用して, | |
大文字を赤色,小文字を青色で表示する. | |
* 作成者: 村川猛彦 ([email protected]) | |
* コンパイル方法: cc colorshow.c -o colorshow | |
* 実行方法: cat report1-cipher.txt | sed -e 'y/ABC/xyz/' | ./colorshow | |
*/ | |
#include <stdio.h> | |
#include <ctype.h> |
This file contains hidden or 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 | |
# trisub.rb : a solver of triangular subtraction problem | |
# by takehikom | |
# Usage: | |
# ruby trisub.rb | |
# ruby trisub.rb 4 | |
# ruby trisub.rb 5 | |
# ruby trisub.rb 6 # no answer |
This file contains hidden or 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 | |
# inome-drawer.rb : drawing "inome", a traditional Japanese design in the shape of a heart | |
# by takehikom | |
# See also: | |
# http://shoujuin.boo.jp/?page_id=466 | |
# http://d.hatena.ne.jp/takehikom/20180619/1529420399 | |
class InomeDrawer |
This file contains hidden or 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 | |
# icosa-drawer.rb : drawing SVG images of a regular icosahedron | |
# with "kuku" forms along the sides | |
# by takehikom | |
module IcosaDrawer | |
class Triangle | |
def initialize(param = {}) | |
@label = param[:label] |
This file contains hidden or 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 | |
# junjo-detector.rb : 「かけ算の順序」(表記ゆれを含む)を見つける | |
# by takehikom | |
# ruby junjo-detector.rb | |
# ruby junjo-detector.rb file ... | |
# ruby junjo-detector.rb directory | |
def find_junjo(io, filename = nil) |
This file contains hidden or 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 | |
# kukuniketa.rb : 「九九2桁」ソルバ | |
# by takehikom | |
# [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]といった配列を入力にとり, | |
# 2個ずつ組み合わせて2桁の数を作って,いずれも九九の答えに出現する | |
# ものを求める. | |
# see also: https://takehikom.hateblo.jp/entry/2019/03/11/054444 |