Re: I do not understand what the problem is in this code.

2017-03-03 Thread steven kladitis via Digitalmars-d-learn
On Friday, 3 March 2017 at 04:14:02 UTC, Jordan Wilson wrote: On Friday, 3 March 2017 at 03:11:24 UTC, steven kladitis wrote: [...] I saw this answer for a similar question from Adam D. Ruppe: Quote: "...it is anything that Phobos considers "bidirectional" and "swappable" - an array it can

Re: I do not understand what the problem is in this code.

2017-03-02 Thread Jordan Wilson via Digitalmars-d-learn
On Friday, 3 March 2017 at 03:11:24 UTC, steven kladitis wrote: void main() { import std.stdio, std.range, std.algorithm, std.string; const pieces = "KQRrBbNN"; alias I = indexOf; auto starts = permutations(pieces.dup).filter!(p => I(p, 'B') % 2 != I(p, 'b') % 2 &&

I do not understand what the problem is in this code.

2017-03-02 Thread steven kladitis via Digitalmars-d-learn
void main() { import std.stdio, std.range, std.algorithm, std.string; const pieces = "KQRrBbNN"; alias I = indexOf; auto starts = permutations(pieces.dup).filter!(p => I(p, 'B') % 2 != I(p, 'b') % 2 && // Bishop constraint. // King constraint.