1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | void is_reachable(int a, int b, int time_limit) {
+ int max_distance;
int result;
int distance;
+ max_distance = (time_limit * 10);
if (a <= b) {
distance = (b - a);
} else {
distance = (a - b);
};
if (⟨distance <= (time_limit * 10)⟩ → ⟨distance <= max_distance⟩) {
result = 1;
} else {
result = 0;
};
}
|