Getting started: Windows
Before setting up Jogo, you need to install a C compiler. Jogo and C are intended to work together, and Jogo relies on C quite a bit. The C compiler for Windows that works with Jogo is Microsoft's Visual C compiler. There are many versions of this compiler, but the one that works best is Visual Studio 2012 Express. Click the link, then download "Visual C++ 2012 Express" and install it.
You will also need a text editor in order to write Jogo programs. Notepad (which ships with Windows) works just fine, but there are many other text editors: Notepad++, Sublime Text, and Vim, for example.
The next step is to download and install Jogo. You can download Jogo here. Once the file downloads, run the executable installer. When you run the installer, you will see:
next to install, and follow the instructions given by the installer.
When you reach the page above, the installation is complete. Click "Finish" to exit the installer.
Writing your first Jogo program
Now you can finally start writing your first Jogo program! Writing a program has three steps:
- Create the source file
- Compile the source file into a program
- Run the program
Create the source file
To begin, click the Start menu, and type "cmd.exe" into the Run box, or simply find
Command Prompt in the Start menu.
Next, use your text editor to open a file named "Hello.jg." The instructions below use Notepad.exe, but feel free to use your own text editor to create "Hello.jg." "Hello.jg" is a Jogo source file, because it ends with the
.jg extension. In the command prompt, type
ENTER. Notepad will ask you to create a new file; click
Yes. Then, type in the following program:
After you've finished typing in the program, make sure you save Hello.jg in Notepad or your other text editor.
Compile the source file
Now go back to the command prompt. Type in
This compiles "Hello.jg" and generates a the program
Run the program
To run the program, type
out.exe and hit
If you see
hello world in the command prompt, then congratulations! You've compiled and run your first working Jogo program. Continue on to the next section of the tutorial to learn more.
It didn't work!
If you don't see
hello world, then reread this page from the beginning. Make sure you didn't there aren't typos in your command prompt commands or in Hello.jg. Remember, case is important!
int is not the same as
Int. Also, make sure you installed the correct C compiler: Microsoft Visual C++ 2010.