Skip to content

Instantly share code, notes, and snippets.

@loganhasson
Last active August 29, 2015 14:20
Show Gist options
  • Select an option

  • Save loganhasson/830e9c59bf9f409c4e82 to your computer and use it in GitHub Desktop.

Select an option

Save loganhasson/830e9c59bf9f409c4e82 to your computer and use it in GitHub Desktop.

Revisions

  1. loganhasson revised this gist May 7, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion metro.rb
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    def metro_card(init)
    (5.50..60.00).step(0.05).map {|v| v if (init + (v*1.11).round(2)) % 2.75 == 0}.compact
    (5.50..60.00).step(0.05).map {|v| v.round(2) if (init + (v*1.11).round(2)) % 2.75 == 0}.compact
    end
  2. loganhasson created this gist May 7, 2015.
    3 changes: 3 additions & 0 deletions metro.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    def metro_card(init)
    (5.50..60.00).step(0.05).map {|v| v if (init + (v*1.11).round(2)) % 2.75 == 0}.compact
    end