Comment detail
トランプの和と積のパズル (Nested Flatten)This comment is reply for 1613 匿名: 最終バージョンです。 相変わらず効...(トランプの和と積のパズル). Go to thread root.
最後の方をこんな感じにするのはありですか?(笑
o := o select: [:t | (o count: [:u | u fourth = t fourth]) = 1].
^o collect: [:t | t first: 2]
なんだか
[:t
が顔に見えてくる…
[:u | 顔だ…
ホントだ。w インデントは自由ですので、#1627 も可能です。





sumim
#1624()
[
Smalltalk
]
Rating0/0=0.00
| n o a | n := 13. o := (1 to: n) inject: #() into: [:r :i | r, ((i to: n) collect: [:j | {i. j. i*j. i+j}])]. a := o select: [:t | (o count: [:u | u third = t third]) > 1]. o := o select: [:t | (o count: [:u | u fourth = t fourth]) > 1]. o := o select: [:t | a includesAllOf: (o select: [:u | u fourth = t fourth])]. o := o select: [:t | (o count: [:u | u third = t third]) = 1]. o := o select: [:t | (o count: [:u | u fourth = t fourth]) = 1]. ^o collect: [:t | t first: 2]Rating0/0=0.00-0+