If there is one relatively good thing about Murphy’s Law is that it actually also may retunr an error: error in ‘murphysLaw’ at line 5: outcome(try) = min(stepForward) – sum(damage(anythingThatCanGoWrong(try))); index exceeds matrix dimensions. I kept going, trying to ignore that two eye trackers have broken down, repairing one while setting up the other one…
Which can be wonderfully expressed as logical function of only a few parameters:
if ~isempty(possibleActions)
if remainingMotivation > 0,
attempts = (1:remainingMotivation);for try = 1:size(attempts,1),
outcome(try) = min(stepForward) – sum(damage(anythingThatCanGoWrong));
endelse
result = fail;
endif max(outcome) < 0
result = fail;
else
result = impossibleError;
endelse
result = stagnation;
end
Should be MatLAB compatible….



