Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

added 130 characters in body
Source Link
Dingus
  • 11.5k
  • 2
  • 33
  • 67

Ruby -p, (削除) 141 (削除ここまで) (削除) 140 (削除ここまで)(削除) 137 (削除ここまで) 137131 bytes

Saved 3 bytes by using $$%10 instead of rand(10), a golf suggested by @NahuelFouilleul in comments on other answers.

$_="How to#to #{v=$_[8v=$_[9..-2]} in #{n=1+rand(10)n=1+$$%10} easy ste#{:ps[0,n]}!
"+(1..n).map{|i|"
Step #{i} - #{i<n ?'Do not'+vnot '+v:v[/\w/]v.upcase+$'capitalize}."}*''

Try it online! Try it online!

Ruby -p, (削除) 141 (削除ここまで) (削除) 140 (削除ここまで) 137 bytes

$_="How to#{v=$_[8..-2]} in #{n=1+rand(10)} easy ste#{:ps[0,n]}!
"+(1..n).map{|i|"
Step #{i} - #{i<n ?'Do not'+v:v[/\w/].upcase+$'}."}*''

Try it online!

Ruby -p, (削除) 141 (削除ここまで) (削除) 140 (削除ここまで)(削除) 137 (削除ここまで) 131 bytes

Saved 3 bytes by using $$%10 instead of rand(10), a golf suggested by @NahuelFouilleul in comments on other answers.

$_="How to #{v=$_[9..-2]} in #{n=1+$$%10} easy ste#{:ps[0,n]}!
"+(1..n).map{|i|"
Step #{i} - #{i<n ?'Do not '+v:v.capitalize}."}*''

Try it online!

deleted 1 character in body
Source Link
Dingus
  • 11.5k
  • 2
  • 33
  • 67

Ruby -p, (削除) 141 (削除ここまで)(削除) 140 (削除ここまで) 140137 bytes

$_="How to#{v=$_[8..-2]} in #{n=1+rand(10)} easy ste#{:ps[0,n]}!
"+(1..n).map{|i|"
Step #{i} - #{i<n ?'Do not'+v:v[1].upcase+v[2.v[/\w/].-1]upcase+$'}."}*''

Try it online! Try it online!

Ruby -p, (削除) 141 (削除ここまで) 140 bytes

$_="How to#{v=$_[8..-2]} in #{n=1+rand(10)} easy ste#{:ps[0,n]}!
"+(1..n).map{|i|"
Step #{i} - #{i<n ?'Do not'+v:v[1].upcase+v[2..-1]}."}*''

Try it online!

Ruby -p, (削除) 141 (削除ここまで)(削除) 140 (削除ここまで) 137 bytes

$_="How to#{v=$_[8..-2]} in #{n=1+rand(10)} easy ste#{:ps[0,n]}!
"+(1..n).map{|i|"
Step #{i} - #{i<n ?'Do not'+v:v[/\w/].upcase+$'}."}*''

Try it online!

added 20 characters in body
Source Link
Dingus
  • 11.5k
  • 2
  • 33
  • 67

Ruby -p, 141(削除) 141 (削除ここまで) 140 bytes

$_="How to#{v=$_[8..-2]} in #{n=1.+rand n=1+rand(10)} easy step#ste#{n>1??s:pps[0,n]}!
"+(1..n).map{|i|"
Step #{i} - #{i<n ?'Do not'+v:v[1].upcase+v[2..-1]}."}*''

Try it online! Try it online!

Ruby -p, 141 bytes

$_="How to#{v=$_[8..-2]} in #{n=1.+rand 10} easy step#{n>1??s:p}!
"+(1..n).map{|i|"
Step #{i} - #{i<n ?'Do not'+v:v[1].upcase+v[2..-1]}."}*''

Try it online!

Ruby -p, (削除) 141 (削除ここまで) 140 bytes

$_="How to#{v=$_[8..-2]} in #{n=1+rand(10)} easy ste#{:ps[0,n]}!
"+(1..n).map{|i|"
Step #{i} - #{i<n ?'Do not'+v:v[1].upcase+v[2..-1]}."}*''

Try it online!

deleted 36 characters in body
Source Link
Dingus
  • 11.5k
  • 2
  • 33
  • 67
Loading
added 10 characters in body
Source Link
Dingus
  • 11.5k
  • 2
  • 33
  • 67
Loading
added 20 characters in body
Source Link
Dingus
  • 11.5k
  • 2
  • 33
  • 67
Loading
Source Link
Dingus
  • 11.5k
  • 2
  • 33
  • 67
Loading

AltStyle によって変換されたページ (->オリジナル) /