A rule can choose the next step
Picture
It’s a day out. If it rains, visit the café. Otherwise, visit the park. One small fact changes your next step.
Predict
It is raining. Which place does this rule choose?
Let's look
The café. We follow the rainy-day branch.
A little Python, if you want it
raining = True
if raining:
next_stop = "cafe"
else:
next_stop = "park"
assert next_stop == "cafe"
if checks a condition. else gives the other path. Only one of these two branches runs here.
Change one rule
We want to compare both places, not follow the weather rule. Is choosing just one enough?
Let's try it
No. To compare both, we need to consider both. That difference will matter when we explore choices later.
Connect
Next, give a little task a name. Later, backtracking will try several choices.