Skip to content

Instantly share code, notes, and snippets.

@aquarla
Created March 12, 2021 06:26
Show Gist options
  • Save aquarla/16182be41cb75cf844b27df76d70789c to your computer and use it in GitHub Desktop.
Save aquarla/16182be41cb75cf844b27df76d70789c to your computer and use it in GitHub Desktop.
九九の進捗がいまいちなこどものために無限に問題を作成するヤツ
# coding: utf-8
100.times do |n|
str = ""
20.times do |i|
5.times do |j|
str += (rand(9)+1).to_s + "×" + (rand(9)+1).to_s + "=   "
end
str += "\n"
end
File.open("./dst/" + Time.now.to_i.to_s + "_" + sprintf("%03d", n) + ".txt", "w") do |f|
f.write(str)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment