SStest.k 198 B

1234567
  1. hasloops: {deps:&'x; d:deps; #,/((#deps)(,/'deps@)/d)>0};
  2. order: {deps: {$[+/x>0;&x;()]}'x; ?,/deps};
  3. dm: ((0 0 0 0 0);(1 0 0 0 0);(0 0 0 0 1);(1 1 0 0 0);(0 0 1 1 0));
  4. :hasloops[dm];
  5. :order[dm];