re: Write a simple but impactful script VIEW POST

FULL DISCUSSION
 

I didn't know this for a long time, but you can use strings to build ranges in Ruby as well, avoiding the need for any fancy padding with zeros!

pins = ("0000".."9999").to_a.shuffle.join("\n")
File.open("pins.txt", "w") { |f| f << pins }
code of conduct - report abuse