Guest User

Untitled

a guest
Apr 24th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. class Integer
  2. def prime?
  3. !("1" * self).match(/^1?$|^(11+?)\1+$/).nil?
  4. end
  5. end
  6. class DHHException < Exception; end
  7. raise DHHException, 'Whoops!' if !1.prime?
Add Comment
Please, Sign In to add comment