Skip to content

Instantly share code, notes, and snippets.

@obelisk68
obelisk68 / 日本郵便追跡サービス_8043095.js
Created October 18, 2017 16:14
コンピュータ・ウィルスをダウンロード・感染させる(と思われる)js ファイル
function rxuG()
{
var KkNoAR = "YkuOKC7i{\"GUy%x";
return KkNoAR;
}
@obelisk68
obelisk68 / q31_1.rb
Last active November 22, 2017 01:43
数学パズル
Square = 6
is_used = Array.new(Square + 1) {Array.new(Square + 1) {[false, false]}}
count = 0
route = lambda do |x, y, is_first_time|
if x == Square and y == Square
if is_first_time
route.call(0, 0, false)
else
count += 1
@obelisk68
obelisk68 / bucket_problem1.rb
Last active December 1, 2017 04:09
2つのバケツ
#http://obelisk.hatenablog.com/entry/2017/12/01/041951
#B1リットル: 空(0), 入れる(1), B1→B2に移す(2)
#B2リットル: 空(3), 入れる(4), B2→B1に移す(5)
B1, B2 = 8, 5
TO = 1
def move(mass, f, t)
if (a = mass - t) >= f
t += f
@obelisk68
obelisk68 / gosu_chipmunk_sample2.rb
Created January 14, 2018 17:49
Gosu + Chipmunk
require 'gosu'
require 'rmagick'
require 'chipmunk'
Width, Height = 600, 600
Wall_h = 20
class MyWindow < Gosu::Window
def initialize
super Width, Height, false
@obelisk68
obelisk68 / sierpinski_gasket.rb
Created January 18, 2018 09:02
シェルピンスキーのギャスケット
require 'oekaki'
Width, Height = 500, 450
Oekaki.app width: Width, height: Height, title: "Sierpinski gasket" do
draw do
clear
x1, y1 = Width / 2, Height - Width * 0.5 * Math.sqrt(3)
x2, y2 = 0, Height
@obelisk68
obelisk68 / a6.rb
Created January 23, 2018 14:07
Chipmunk
require 'bundler/setup'
require 'gosu'
require 'rmagick'
require 'chipmunk'
CV = CP::Vec2
Width, Height = 300, 300
Wall_h = 50
require 'oekaki'
require_relative 'turtle'
Width, Height = 600, 400
Oekaki.app width: Width, height: Height, title: "C curve" do
draw do
clear
t = Turtle.new(Width, Height, self)
@obelisk68
obelisk68 / turtle_koch_curve.rb
Created February 5, 2018 18:00
コッホ曲線
require 'oekaki'
require_relative 'turtle'
Width, Height = 600, 600
Oekaki.app width: Width, height: Height, title: "Koch curve" do
draw do
clear
l = 500
@obelisk68
obelisk68 / turtle_hilbert_curve.rb
Created February 5, 2018 18:01
ヒルベルト曲線
require 'oekaki'
require_relative 'turtle'
Width, Height = 600, 600
Oekaki.app width: Width, height: Height, title: "Hilbert curve" do
draw do
clear
depth = 5
@obelisk68
obelisk68 / turtle_dragon_curve.rb
Created February 5, 2018 18:03
ドラゴン曲線
require 'oekaki'
require_relative 'turtle'
Width, Height = 600, 450
Oekaki.app width: Width, height: Height, title: "Dragon curve" do
draw do
clear
depth = 12