Re: how to remove duplicate code in functional style

2018-11-23 Thread Alex via Digitalmars-d-learn
On Friday, 23 November 2018 at 14:33:40 UTC, berni wrote: I've got the following code, which works, but obviously contains duplication. Is there a way to move that "dissection_available?...:..." to the place, where it should be? return dissection_available ?solution.dup

how to remove duplicate code in functional style

2018-11-23 Thread berni via Digitalmars-d-learn
I've got the following code, which works, but obviously contains duplication. Is there a way to move that "dissection_available?...:..." to the place, where it should be? return dissection_available ?solution.dup .transposed.map!(a=>a.map!(b=>"?#."[b]).array)