Skip to content

Instantly share code, notes, and snippets.

@msg7086
Created November 11, 2015 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msg7086/4fa5a3d344c1118bc98c to your computer and use it in GitHub Desktop.
Save msg7086/4fa5a3d344c1118bc98c to your computer and use it in GitHub Desktop.
def seq(digit = 6, source = '12356789')
0.upto(source.size ** digit - 1).map { |i| i.to_s(source.size).each_char.map{ |j| source[j.to_i] }.join.rjust(digit, source[0]) }
end
seq(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment