Guest User

Untitled

a guest
Jul 20th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. require 'rainbow'
  2.  
  3. puts "enter a number"
  4. mod = Integer(gets)
  5.  
  6. (0..mod-1).each do |i|
  7. row = ""
  8. (0..mod-1).each do |j|
  9. if ((j * i) % mod) == 1
  10. row += " #{(j * i) % mod}".ljust(3).color(:red)
  11. else
  12. row += " #{(j * i) % mod}".ljust(3).color((i*j) % 255, 255, 255)
  13. end
  14. end
  15. puts row
  16. end
Add Comment
Please, Sign In to add comment