This guide gets you up and running with your very first TechScript program.
Make sure you have installed the TechScript compiler and VM on your machine. If not, follow the Installation Guide.
Validate your installation:
tech version
This should output the current version of the language (e.g., TechScript v2.0.0.1).
hello.txs.say "Hello, World!"
tech run hello.txs
You should see the output:
Hello, World!
Let’s write a slightly more complex program that accepts user input, computes a value, and uses conditions:
# Ask user for their name
name = ask "What is your name? "
say $"Welcome, {name}!"
# Prompt for age
age_input = ask "How old are you? "
age = math.parse_int(age_input)
# Logic checks
when age >= 18
say "You are eligible to vote."
else
years_left = 18 - age
say $"Come back in {years_left} years!"
end
Run this script:
tech run age_check.txs