Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rainbow'
- puts "enter a number"
- mod = Integer(gets)
- (0..mod-1).each do |i|
- row = ""
- (0..mod-1).each do |j|
- if ((j * i) % mod) == 1
- row += " #{(j * i) % mod}".ljust(3).color(:red)
- else
- row += " #{(j * i) % mod}".ljust(3).color((i*j) % 255, 255, 255)
- end
- end
- puts row
- end
Add Comment
Please, Sign In to add comment