This example simulates a guessing game in TechScript, using loops and conditional logic.
secret_number = 42
guesses = [10, 50, 40, 42]
for guess in guesses
say $"Guessing: {guess}"
when guess < secret_number
say "Too low!"
else when guess > secret_number
say "Too high!"
else
say "Correct! You guessed it!"
break
end
end
tech run guess.txsGuessing: 10
Too low!
Guessing: 50
Too high!
Guessing: 40
Too low!
Guessing: 42
Correct! You guessed it!