Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ejercicio3[afd_] := Module[{i, res, pozos, nopozos, transaux},
- res = {{}, {}, {}, {}, {}};
- pozos = {};
- nopozos = {};
- transaux = {};
- pozos = Complement[afd[[1]], afd[[5]]];
- Print[pozos];
- For[i = 1, i <= Length[pozos], i++,
- If[Length[Cases[afd[[3]], {pozos[[i]], _, pozos[[i]]}]] ==
- Length[afd[[2]]],
- transaux =
- Join[transaux, Cases[afd[[3]], {pozos[[i]], _, pozos[[i]]}]];
- ,
- AppendTo[nopozos, pozos[[i]]];
- ];
- ];
- pozos = Complement[pozos, nopozos];
- Print[pozos];
- Print[nopozos];
- Print[transaux];
- For[i = 1, i <= Length[pozos], i++,
- transaux = Join[transaux, Cases[afd[[3]], {_, _, pozos[[i]]}]];
- ];
- Print[transaux];
- res[[1]] = Complement[afd[[1]], pozos];
- res[[2]] = afd[[2]];
- res[[3]] = Complement[afd[[3]], transaux];
- res[[4]] = afd[[4]];
- res[[5]] = res[[5]];
- Return[res];
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement