Your first Otter program
Three steps take you from an empty file to a program that says hello.
1. Create hello.ot
In any text editor, create a file named hello.ot containing:
Otter
# Your first Otter program
say "Hello, Otter!"
2. Run it
In PowerShell, in the folder that holds the file:
PowerShell
otter run hello.ot
Running from the project folder without installing? Use .\otter.cmd hello.ot instead. The shorthand otter hello.ot works too.
3. See the output
Output
Hello, Otter!
Make it yours
Put a value in a variable and say it beside some text. say separates each part with a single space:
Otter
name is "Otter Explorer"
say "Hello," name
Output
Hello, Otter Explorer
Ask the person running the program for input. Numbers and true/false are recognised automatically:
Otter
ask "What is your name? " and call it userName
say "Hello" userName