Skip to content

Instantly share code, notes, and snippets.

@picandocodigo
Created January 2, 2013 21:01

Revisions

  1. picandocodigo created this gist Jan 2, 2013.
    2 changes: 2 additions & 0 deletions ci.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    # ci = cédula
    a = 0; (0..6).each { |i| a = a + ("2987634"[i].to_i * ci[i].to_i)}; puts (10 - (a % 10)).to_s[-1]