Write your first program
Welcome to the "Hello, World!" tutorial for Zynk. In this guide, we'll create a simple Zynk program that prints "Hello, World!" to the console. Follow the steps below to get started.
1. Create a new Zynk file
First, you'll need to create a new file with a .zk extension. This file will contain your Zynk code.
- Open your favorite text editor or IDE.
- Create a new file and save it as
hello.zk.
2. Write your Zynk program
In the hello.zk file, write the following Zynk code:
println("Hello, World!");
Explanation
println("Hello, World!");: This line of code calls theprintlnfunction, which outputs the string"Hello, World!"to the console followed by a newline character.
3. Run your Zynk program
To run your Zynk program, follow these steps:
- Open a Terminal or Command Prompt.
-
Navigate to the directory containing your
hello.zkfile. For example:cd path/to/your/directory -
Execute the Zynk interpreter with your file as an argument:
./Zynk hello.zk
Expected Output
When you run the program, you should see the following output:
Hello, World!
4. Troubleshooting
If you encounter any issues, make sure of the following:
- The Zynk interpreter is correctly installed and located in your system's PATH.
- The file extension is
.zkand the code is properly written. - You are running the command from the directory where
hello.zkis located.