private static void PermutationsInnner(TileKinds stock, int depth, TileKinds current, IList <TileKinds> result) { if (depth == 0) { result.Add(current); return; } for (var i = 0; i < stock.Count(); i++) { var copyOfStock = new TileKinds(stock); var copyOfCurrent = new TileKinds(current) { copyOfStock[i] }; copyOfStock.RemoveAt(i); PermutationsInnner(copyOfStock, depth - 1, copyOfCurrent, result); } }