Current section
Files
Jump to
Current section
Files
lib/noise.ex
config = Noise.Simplex.new_config(%{
frequency: 0.1
})
reset = IO.ANSI.reset
blue_bg = IO.ANSI.blue_background
green = IO.ANSI.green
magenta_bg = IO.ANSI.magenta_background
red = IO.ANSI.red
for y <- 1..40 do
for x <- 1..80 do
noise = Noise.Simplex.cylindrical(config, 80, {x, y})
if noise < 0 do
IO.write "#{blue_bg}#{green}##{reset}"
else
IO.write "#{magenta_bg}#{red}##{reset}"
end
end
IO.write "\n"
end