Surprise! We've been running on hardware provided by BuyVM for a few months and wanted to show them a little appreciation.
Running a paste site comes with unique challenges, ones that aren't always obvious and hard to control. As such, BuyVM offered us a home where we could worry less about the hosting side of things and focus on maintaining a clean and useful service! Go check them out and show them some love!
Submitted on October 3, 2018 at 07:12 AM

New Paste 1 (Crystal)

def distance_between(obj1, obj2)
  a = obj1.x - obj2.x
  b = obj1.y - obj2.y
  Math.hypot(a, b)
end

struct Vector2
  property x = 0f32
  property y = 0f32

  def initialize(@x : Float32, @y : Float32)
  end
end

# All fake data
a = Vector2.new(100.00f32, 100.00f32)
b = Vector2.new(100.00f32, 300.00f32)

# fake game loop
loop do
  temp_buffer = Hash(String, Float32).new

  temp_buffer["update_positions"] = distance_between(a, b)

  puts temp_buffer

  sleep 0 # 100 CPU USAGE!
end

puts "Started..."