while {!finished} { if (!problem) { goCode(); } else { goSmoke(); } }