Ruby 2.7, (削除) 112 (削除ここまで)(削除) 98 (削除ここまで)(削除) 77 (削除ここまで)(削除) 112 (削除ここまで)(削除) 98 (削除ここまで)(削除) 77 (削除ここまで) 74 bytes
Saved 6 bytes using String#count method, thanks to Razetime!
Saved 3 bytes using literal newline, thanks to Dingus!
->m{m.map{" "*3+_1}<<?-*(6+c=m[0].size)+"
| #{" "*c} |"*(m*"").count(?d)}
- TIO uses an older version of Ruby, while in Ruby 2.7, we've numbered parameters, i.e.,
_1, which saves 2 bytes.
Ruby 2.7, (削除) 112 (削除ここまで)(削除) 98 (削除ここまで)(削除) 77 (削除ここまで) 74 bytes
Saved 6 bytes using String#count method, thanks to Razetime!
Saved 3 bytes using literal newline, thanks to Dingus!
->m{m.map{" "*3+_1}<<?-*(6+c=m[0].size)+"
| #{" "*c} |"*(m*"").count(?d)}
- TIO uses an older version of Ruby, while in Ruby 2.7, we've numbered parameters, i.e.,
_1, which saves 2 bytes.
Ruby 2.7, (削除) 112 (削除ここまで)(削除) 98 (削除ここまで)(削除) 77 (削除ここまで) 74 bytes
Saved 6 bytes using String#count method, thanks to Razetime!
Saved 3 bytes using literal newline, thanks to Dingus!
->m{m.map{" "*3+_1}<<?-*(6+c=m[0].size)+"
| #{" "*c} |"*(m*"").count(?d)}
- TIO uses an older version of Ruby, while in Ruby 2.7, we've numbered parameters, i.e.,
_1, which saves 2 bytes.
Ruby 2.7, (削除) 112 (削除ここまで) (削除) 98 (削除ここまで) (削除) 77 (削除ここまで) 74 bytes
Saved 6 bytes using String#count method, thanks to Razetime!
Saved 3 bytes using literal newline, thanks to Dingus!
->m{m.map{" "*3+_1}<<?-*(6+c=m[0].size)+"
| #{" "*c} |"*(m*"").count(?d)}
- TIO uses an older version of Ruby, while in Ruby 2.7, we've numbered parameters, i.e.,
_1, which saves 2 bytes.
Ruby 2.7, (削除) 112 (削除ここまで) (削除) 98 (削除ここまで) (削除) 77 (削除ここまで) 74 bytes
Saved 6 bytes using String#count method, thanks to Razetime!
Saved 3 bytes using literal newline, thanks to Dingus!
->m{m.map{" "*3+_1}<<?-*(6+c=m[0].size)+"
| #{" "*c} |"*(m*"").count(?d)}
- TIO uses an older version of Ruby, while in Ruby 2.7, we've numbered parameters, i.e.,
_1, which saves 2 bytes.
Ruby 2.7, (削除) 112 (削除ここまで) (削除) 98 (削除ここまで) (削除) 77 (削除ここまで) 74 bytes
Saved 6 bytes using String#count method, thanks to Razetime!
Saved 3 bytes using literal newline, thanks to Dingus!
->m{m.map{" "*3+_1}<<?-*(6+c=m[0].size)+"
| #{" "*c} |"*(m*"").count(?d)}
- TIO uses an older version of Ruby, while in Ruby 2.7, we've numbered parameters, i.e.,
_1, which saves 2 bytes.
Ruby 2.7, (削除) 112 (削除ここまで) (削除) 98 (削除ここまで) 77(削除) 77 (削除ここまで) 74 bytes
Saved 6 bytes using String#count method, thanks to Razetime!
Saved 3 bytes using literal newline, thanks to Dingus !
->m{m<<m.map{" "*3+_1}<<?-*(6+c=m[0].size)+"\n+"
|#| #{" ".*c+2"*c}|"*(m.map!{" "*3+_1}*""m*"").count(?d)}
- TIO uses an older version of Ruby, while in Ruby 2.7, we've numbered parameters, i.e.,
_1, which saves 2 bytes.
Ruby 2.7, (削除) 112 (削除ここまで) (削除) 98 (削除ここまで) 77 bytes
Saved 6 bytes using String#count method, thanks to Razetime!
->m{m<<?-*(6+c=m[0].size)+"\n |#{" ".*c+2}|"*(m.map!{" "*3+_1}*"").count(?d)}
- TIO uses an older version of Ruby, while in Ruby 2.7, we've numbered parameters, i.e.,
_1, which saves 2 bytes.
Ruby 2.7, (削除) 112 (削除ここまで) (削除) 98 (削除ここまで) (削除) 77 (削除ここまで) 74 bytes
Saved 6 bytes using String#count method, thanks to Razetime!
Saved 3 bytes using literal newline, thanks to Dingus !
->m{m.map{" "*3+_1}<<?-*(6+c=m[0].size)+"
| #{" "*c}|"*(m*"").count(?d)}
- TIO uses an older version of Ruby, while in Ruby 2.7, we've numbered parameters, i.e.,
_1, which saves 2 bytes.