2017-09-23 10:01:46 +02:00
|
|
|
|
var max = 12
|
|
|
|
|
|
var width = (max**2 -> len+1)
|
|
|
|
|
|
|
2016-12-05 23:44:36 +01:00
|
|
|
|
func fmt_row(*items) {
|
2017-09-23 10:01:46 +02:00
|
|
|
|
items.map {|s| "%*s" % (width, s) }.join
|
2016-12-05 23:44:36 +01:00
|
|
|
|
}
|
2017-09-23 10:01:46 +02:00
|
|
|
|
|
|
|
|
|
|
say fmt_row('x┃', (1..max)...)
|
|
|
|
|
|
say "#{'━' * (width - 1)}╋#{'━' * (max * width)}"
|
2016-12-05 23:44:36 +01:00
|
|
|
|
|
2017-09-23 10:01:46 +02:00
|
|
|
|
{ |i|
|
|
|
|
|
|
say fmt_row("#{i}┃", {|j| i <= j ? i*j : ''}.map(1..max)...)
|
|
|
|
|
|
} << 1..max
|