Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 534 Bytes

code-blocks.md

File metadata and controls

31 lines (26 loc) · 534 Bytes
title desc layout published indexed categories
Code Blocks
Short, but powerful, drop-in code segments.
default
true
true
Tutorials

{% include header.html %}

Gaussian Bell Curve

By Dee Schaedler

def gaussian(mean, stddev)
  theta = 2 * Math::PI * rand
  rho = Math.sqrt(-2 * Math.log(1 - rand))
  scale = stddev * rho
  [mean + scale * Math.cos(theta), mean + scale * Math.sin(theta)]
end

Random Integer in Range

By Dee Schaedler

def randr(min, max)
  rand(max - min + 1) + min
end