Rubyの乱数関数がめっちゃ分かりやすいです。
他の言語ならクラスをimportして使うのですがRubyは
例えば21から30までの乱数を表示する場合
puts rand(21..30)
こんなに分かりやすいです。
Go to list of users who liked
Share on X(Twitter)
Share on Facebook
More than 5 years have passed since last update.
Rubyの乱数関数がめっちゃ分かりやすいです。
他の言語ならクラスをimportして使うのですがRubyは
例えば21から30までの乱数を表示する場合
puts rand(21..30)
こんなに分かりやすいです。
Register as a new user and use Qiita more conveniently
Go to list of users who liked