Commit 2a4021f

mo <mokha@cisco.com>
2017-05-23 19:46:47
ensure each positive angle can be calculated.
1 parent 7ba0897
Changed files (1)
spec/visible_points_spec.rb
@@ -257,4 +257,15 @@ describe "visible points" do
       expect(angle_for(x, y)).to eql(expected)
     end
   end
+
+  it do
+    angles = Set.new
+    -100.upto(100) do |x|
+      -100.upto(100) do |y|
+        next if x == 0 && y == 0
+        angles << angle_for(x, y).floor
+      end
+    end
+    expect(angles.count).to eql(360)
+  end
 end