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
#include <stdio.h> | |
/* | |
constant.c - compare "const int", "#define", and "enum". | |
inspired by: | |
http://stackoverflow.com/questions/1674032/static-const-vs-define-in-c | |
*/ | |
/* gcc constant.c -o constant */ | |
/* gcc -std=c89 -pedantic -DOPTION_1 constant.c -o constant */ |
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 | |
# -*- coding: utf-8 -*- | |
# trips5.rb - Trinagle Puzzle Solver (5 numbers on a side) | |
# by takehikom | |
# inspired by: | |
# http://www.ksproj.com/PDF/chirashi201405.pdf | |
# see also: | |
# https://gist.github.com/takehiko/65dc59fb984e60bafb24 (trips.rb) |
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 | |
# -*- 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 |
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 | |
# -*- 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 |
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 | |
# -*- coding: utf-8 -*- | |
# TrianglePuzzleSolver.rb | |
# by takehikom | |
# inspired by: | |
# http://www.huffingtonpost.jp/satoshi-kagimoto/triangle-puzzle_b_5590269.html | |
module TrianglePuzzle |
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
# 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( |
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 | |
# ruby magicsquare.rb | |
# ruby magicsquare.rb -c | |
# ruby magicsquare.rb 2 | |
# ruby magicsquare.rb 3 | |
module MagicSquare | |
class Table | |
def initialize(t = 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 | |
# -*- coding: utf-8 -*- | |
# Makes a "Hello, world!" program that has no literals. | |
class HelloWorldGenerator1 | |
def initialize(s = "Hello, world!") | |
@message = s.chomp + "\n" | |
end |
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
<!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"> |
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
<!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> |