Array For Loop Combined

array for loop combined - Demonstrates printing and basic output

// Test array indexing with for loops
fn main() -> void {
    let values = [10, 20, 30, 40, 50];
    
    // Print each element using for loop and array indexing
    for i in 5 {
        let element = values[i];
        print_int(element);
    }
}
📁 array_for_loop_combined.cyl

Arithmetic Test

arithmetic test - Demonstrates printing and basic output

// Simple arithmetic test
fn main() -> void {
    let x = 10;
    let y = 5;
    let result = x + y * 2;
    print(result);
}
📁 arithmetic_test.cyl

Array Test

array test - Demonstrates printing and basic output

// Array creation and indexing example
fn main() -> void {
    let numbers = [10, 20, 30, 40, 50];
    
    // Test array indexing - should now work!
    let first = numbers[0];   // 10
    let third = numbers[2];   // 30
    let last = numbers[4];    // 50
    
    print_int(first);
    print_int(third);
    print_int(last);
}
📁 array_test.cyl

Print Test

print test - Demonstrates printing and basic output

// Test print functionality with strings and integers
fn main() -> void {
    let message = "Hello, World!";
    let number = 42;
    
    print(message);
    print_int(number);
}
📁 print_test.cyl

Struct Test

struct test - Demonstrates printing and basic output

// Struct definition and member access example
struct Person {
    age: int,
    id: int
}

fn main() -> void {
    let person = Person { age: 25, id: 1001 };
    // Note: This example compiles and runs successfully
    // but doesn't produce output (no print statements)
}
📁 struct_test.cyl

Web Request

web request - Demonstrates printing and basic output

// Advanced web request example (aspirational - for future implementation)
import net;
import fs;

fn main() -> void {
    // This is a design example showing the intended syntax
    // Current implementation supports basic functions, variables, and control flow
    
    // Future implementation would support:
    // let response = net.get("https://api.example.com/data");
    // 
    // if response.status == 200 {
    //     fs.write("/tmp/response.json", response.body);
    //     print("Data saved successfully");
    // } else {
    //     print("Request failed");
    // }
    
    print("Web request functionality is planned for future releases");
}
📁 web_request.cyl

Hello World

hello world - Demonstrates printing and basic output

// Hello World example in Cyl
fn main() -> void {
    print("Hello, World!");
    print("Welcome to Cyl programming language!");
}
📁 hello_world.cyl