Optimering af function
Jeg har denne funktion som virker, men jeg har på fornemmelsen at den kan laves på en smart måde: Noget med xor eller sådan noget og fylder kun en linie men hvordanfunction SkiftPind(FraPind, TilPind: Byte): Byte;
begin
if (FraPind = 1) and (TilPind = 2) then
Result := 3;
if (FraPind = 1) and (TilPind = 3) then
Result := 2;
if (FraPind = 2) and (TilPind = 1) then
Result := 3;
if (FraPind = 2) and (TilPind = 3) then
Result := 1;
if (FraPind = 3) and (TilPind = 1) then
Result := 2;
if (FraPind = 3) and (TilPind = 2) then
Result := 1;
end;
