Back to Blog
Tutorials

Loops and Logic: Mastering Control Flow in Soplang

F
Fatima Abdi
Core Maintainer
10/20/2018

Control flow is the heart of any logic.

If Statements (Hadii)

main.sop
hadii (da >= 18) {
    qor("Waad codeyn kartaa");
} hadii kale {
    qor("Ma codeyn kartid wali");
}

Loops (Ku Celi)

main.sop
ku_celi (x = 0; x < 10; x++) {
    qor(x);
}
Thanks for reading!