cho45 #4284(2007/11/21 05:37 GMT) [ Io ] Rating0/0=0.00
Io で普通に書いてみました。alignCenter があるのできりつめるところだけです。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
Sequence centered := method(width, margin := (width - self size) / 2 if (margin < 0, self slice(-margin, self size + margin) , self alignCenter(width) ) ) # なんか手元のだと定義されていないので Number to := method(i, Range clone setRange(self, i) ) 0 to(7) foreach(i, "proto" asMutable centered(i) justSerialized "" println ) /* output "" "o" "ro" "rot" "prot" "proto" "proto " " proto " */
Rating0/0=0.00-0+
[ reply ]
cho45
#4284()
[
Io
]
Rating0/0=0.00
Io で普通に書いてみました。alignCenter があるのできりつめるところだけです。
Sequence centered := method(width, margin := (width - self size) / 2 if (margin < 0, self slice(-margin, self size + margin) , self alignCenter(width) ) ) # なんか手元のだと定義されていないので Number to := method(i, Range clone setRange(self, i) ) 0 to(7) foreach(i, "proto" asMutable centered(i) justSerialized "" println ) /* output "" "o" "ro" "rot" "prot" "proto" "proto " " proto " */Rating0/0=0.00-0+
[ reply ]