Skip to content

Instantly share code, notes, and snippets.

// 「ようかいしりとり」の状態遷移図
// 作成者: takehikom (http://d.hatena.ne.jp/takehikom/)
// 歌詞参照: http://plaza.rakuten.co.jp/ribbon1976/diary/201311210002/
digraph youkaishiritori {
// node[fontname="ms gothic"]; // Windowsではコメントを外す
"ようかいはかせの ところに" ->
"ろくろっくびが やってきた" ->
"ようかいしりとり しようかい?" ->
// 「ようかいしりとり」の状態遷移図2
// 作成者: takehikom (http://d.hatena.ne.jp/takehikom/)
// 歌詞参照: http://plaza.rakuten.co.jp/ribbon1976/diary/201311210002/
digraph youkaishiritori {
// node[fontname="ms gothic"]; // Windowsではコメントを外す
n1 [label = "ようかいはかせの ところに"]; n1 ->
"ろくろっくびが やってきた" ->
"ようかいしりとり しようかい?" ->
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>トライアングル3分割</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style type="text/css" >
.thinline { fill:none; stroke:black; stroke-width:1; }
.thickline { fill:none; stroke:black; stroke-width:2; }
</style>
@takehiko
takehiko / regularpolygons.html
Created March 21, 2014 13:16
Regular Polygons
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>Regular Polygons</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
</head>
<body>
<script type="text/javascript">
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# Makes a "Hello, world!" program that has no literals.
class HelloWorldGenerator1
def initialize(s = "Hello, world!")
@message = s.chomp + "\n"
end
#!/usr/bin/env ruby
# ruby magicsquare.rb
# ruby magicsquare.rb -c
# ruby magicsquare.rb 2
# ruby magicsquare.rb 3
module MagicSquare
class Table
def initialize(t = nil)
@takehiko
takehiko / kukuplot.R
Created July 15, 2014 21:28
Kuku (a.k.a. multiplication table) Answer Accuracy
# kukuplot.R - Kuku (a.k.a. multiplication table) Answer Accuracy
# by takehikom
# http://berd.benesse.jp/berd/center/open/report/keisanryoku/2013/pdf/keisanryoku_2013_data_all.pdf#page=15
# http://i.imgur.com/tE4ncBy.gif
# http://qiita.com/wakuteka/items/c5910a54273d05577c5d
library(lattice)
kuku.acc <- c(
@takehiko
takehiko / TrianglePuzzleSolver.rb
Last active August 29, 2015 14:04
triangle puzzle solver
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# TrianglePuzzleSolver.rb
# by takehikom
# inspired by:
# http://www.huffingtonpost.jp/satoshi-kagimoto/triangle-puzzle_b_5590269.html
module TrianglePuzzle
@takehiko
takehiko / TrianglePuzzleSolver5x5.rb
Created July 19, 2014 14:42
triangle puzzle solver (5 numbers on a side)
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# TrianglePuzzleSolver5x5.rb
# by takehikom
# inspired by:
# http://www.ksproj.com/PDF/chirashi201405.pdf
# NOTE: Since we get 4354560 patterns (whereas TrianglePuzzleSolver.rb
@takehiko
takehiko / trips.rb
Created July 23, 2014 21:07
Triangle Puzzle Solver
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# trips.rb - Triangle Puzzle Solver
# by takehikom
# inspired by:
# http://www.huffingtonpost.jp/satoshi-kagimoto/triangle-puzzle_b_5590269.html
# ruby trips.rb