Skip to main content
Commonmark migration
Source Link

#Ruby (43 bytes) def rand7;(0..7).reduce{|i|i+rand5}%7+1;end

Ruby (43 bytes)

def rand7;(0..7).reduce{|i|i+rand5}%7+1;end

cemper93's solution ported to Ruby is three bytes shorter ;) (34 bytes)

def rand7;eval("+rand5"*7)%7+1;end

#Ruby (43 bytes) def rand7;(0..7).reduce{|i|i+rand5}%7+1;end

cemper93's solution ported to Ruby is three bytes shorter ;) (34 bytes)

def rand7;eval("+rand5"*7)%7+1;end

Ruby (43 bytes)

def rand7;(0..7).reduce{|i|i+rand5}%7+1;end

cemper93's solution ported to Ruby is three bytes shorter ;) (34 bytes)

def rand7;eval("+rand5"*7)%7+1;end
Source Link

#Ruby (43 bytes) def rand7;(0..7).reduce{|i|i+rand5}%7+1;end

cemper93's solution ported to Ruby is three bytes shorter ;) (34 bytes)

def rand7;eval("+rand5"*7)%7+1;end