-
-
Save eiel/a9a365e65ce834cc27a92ec9443c3af7 to your computer and use it in GitHub Desktop.
重複のない整数対の配列を作る
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def random_problem(n) | |
a = [*1..5] | |
a.product(a) | |
.shuffle[0..n] | |
.each do |e0, e1| | |
puts "$#{e0} + #{e1} = $ \n\n \\vfill" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment