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 | |
# 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 | |
# 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
/* | |
* 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> |
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
#!/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 |
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 | |
# 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
#!/bin/bash | |
# arrays-2008-2017.bash : 『小学校学習指導要領解説算数編』のアレイ図比較画像作成 | |
# by takehikom | |
# 使用するコマンド:wget, convert (ImageMagick), unzip | |
# コマンド中の日本語文字にも注意 | |
# 『小学校学習指導要領解説算数編』(平成20年)からアレイ図を取り出す | |
if [ ! -f 2008a.pdf ] |
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 | |
# tomin.rb by takehikom | |
# 「都民ファースト」に似た響きの文字列を生成する | |
require "open-uri" | |
require "zlib" | |
require "stringio" | |
require "kconv" |