Skip to content

Instantly share code, notes, and snippets.

View shinokaro's full-sized avatar

shinokaro shinokaro

View GitHub Profile
@aoitaku
aoitaku / heredoc.rb
Created October 31, 2014 17:19
ヒアドキュメントは式
def event_handler(*names)
names.each do |name|
class_eval <<-EOS
def on_#{name}(*args)
event_handlers[:#{name}] and event_handlers[:#{name}].(*args)
end
EOS
end
end
@Flafla2
Flafla2 / Perlin_Tiled.cs
Last active May 7, 2025 06:09
A slightly modified implementation of Ken Perlin's improved noise that allows for tiling the noise arbitrarily.
public class Perlin {
public int repeat;
public Perlin(int repeat = -1) {
this.repeat = repeat;
}
public double OctavePerlin(double x, double y, double z, int octaves, double persistence) {
double total = 0;