Dec 08, 2022Kuina-chan

This is a tutorial for people who are new to Kuin Programming Language, and for exe execution environments.

1Program Creation Flow


Once you have Kuin, run kuin.exe first (Figure 1-1).
Kuin Files
Figure 1-1: Kuin Files
For development with Kuin, you mainly use only (1) kuin.exe. (2) kuincl.exe is a tool for compiling from the command prompt.
When you run kuin.exe, the screen shown in Figure 1-2 will appear.
Figure 1-2: kuin.exe
This kuin.exe is a set of program editor, compiling and debugging functions. Write your program in (1) and press (2) to compile and run it.
In (3), you can select the kind of program to be generated. Choose Window for a window application, or CUI for an application that runs on a command prompt.
The log of the compilation result will be output to (4), and you can check the error content here.

1.2Hello, world!

First of all, with no program written, try "Compile & Run" or press the F5 key on your keyboard. If you see "Hello, world!" on the screen, compilation and execution are successful (Figure 1-3).
"Hello, world!" In Window
Figure 1-3: "Hello, world!" In Window
Sometimes, antivirus software will warn you about this (the act of generating an exe seems to be trapped?) However, if you do not see any problem, please exclude the following from the checklist: "C:\Users\AppData\Roaming\Kuin\".
In Kuin, if you do not write any program, it will be a program that displays "Hello, world!" on the screen.
By the way, if you select CUI to compile and run the program, it will look like Figure 1-4.
"Hello, world!" In CUI
Figure 1-4: "Hello, world!" In CUI
After that, you are free to write, compile and run your own programs.

1.3Release Build

Finally, when the program is finished and you want to distribute it, do a release build (Figure 1-5).
Release Build
Figure 1-5: Release Build
Click "Release Build" in (1), and save the archive file with a name of your choice (.zip). Then, a fast executable file will be generated along with various files in a minimal form so that you can distribute the zip file as is.
During normal development, press "Compile & Run" to generate a debug build that compiles fast and you can detect errors in detail, and when you are finished and ready to distribute, do a release build that runs fast and is suitable for distribution.

1.4res Folder

If you create a folder named res in the same location as the source file (.kn) to be compiled, the entire contents of the folder will be copied to the location of the executable file when it is compiled, so it is convenient to put the resource files used in the program in the res folder (Figure 1-6).
res Folder
Figure 1-6: res Folder
The res folder will be encrypted and combined into a single file when it is built in the release.

2Running Sample Program

In the samples folder, you will find some samples. These samples have been created using a variety of techniques, so make use of them.
To open the samples or the program you made, click (1) in Figure 2-1.
Open File
Figure 2-1: Open File
By the way, (2) allows you to save the program you have created.
Let's open "samples/0000_kuinvaders/". Compile and run it in Window mode, and Kuinvaders will be executed (Figure 2-2).
Figure 2-2: Kuinvaders
All of the included samples are programs for Window mode.
The included samples are shown in Table 2-1.
Table 2-1: Kuin Sample List
Folder Name Screen Summary Number Of Lines
0000_kuinvaders 0000_kuinvaders Invader Game
196 Lines
That's all for the tutorial For Beginners In Kuin. In the tutorials that follow, I will explain in turn while creating specific programs so that even a programming beginner can create a practical application.