Skip to content

irfanzainudin/cmalay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cmalay

I wanted to code in Malay but too busy (read: lazy) to write up my own compiler so I used C instead :)

Getting started

If you want to use cmalay as well, all you have to do is copy kamus.h into your local directory/folder then #include it into your C file.

For example, let's say you have a folder called projek. Inside that folder, you have utama.c. Copy kamus.h into your projek folder and in your utama.c, you need to have this line of code:

#include "kamus.h"

And voila! You can immediately start using cmalay.

Code example

Compulsory introduction program:

#include <stdio.h>

nom utama() {
    cetak("Salam, dunia!");

    pulang 0;
}

From utama.c:

#include <stdio.h>
#include "kamus.h"

nom utama() {
    nom nombor_bulat;
    cetak("Sila masukkan sebuah nombor bulat: ");
    imbas("%d", &nombor_bulat);
    
    kalau (nombor_bulat == 3) {
        cetak("%d\n", nombor_bulat);
    } atau kalau (nombor_bulat % 2 == 0) {
        cetak("%d ialah genap!\n", nombor_bulat);
    } atau {
        nom i = 0;
        selagi (i < nombor_bulat) {
            cetak("%d ialah ganjil!\n", nombor_bulat);
            i++;
        }
    }

    untuk (nom j = 0; j < nombor_bulat; j++) {
        cetak("%d\n", j);
    }
    
    pulang 0;
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published