48 Code Examples

Learn by example — from simple basics to advanced applications

KIDS

Kids (9 examples)

👋 Hello World

Your very first program — say hello and ask for a name!

// My first Neuridion program!
Console.Print("Hello, World!")
Console.Print("Welcome to Neuridion!")

Var name As String = Console.ReadLine("What is your name? ")
Console.Print("Nice to meet you, " + name + "!")

Var age As String = Console.ReadLine("How old are you? ")
Console.Print(name + " is " + age + " years old.")
Console.Print("Have fun programming!")

🐱 Favorite Animal

Store your favorite animals in variables and describe them.

// My favorite animals
Var animal As String = "Cat"
Var color As String = "orange"
Var legs As Integer = 4

Console.Print("My favorite animal is a " + color + " " + animal)
Console.Print("It has " + legs.ToString() + " legs")

Var sound As String = "Meow"
Console.Print("The " + animal + " says: " + sound + "!")

Var pet2 As String = "Dog"
Console.Print("I also like " + pet2 + "s!")

🔢 Counting

Count up, count by twos, and do a countdown with loops.

// Counting with loops
Console.Print("Counting up:")
For i = 1 To 10
    Console.Print("Number: " + i.ToString())
End For

Console.Print("---")
Console.Print("Counting by twos:")
For j = 2 To 20 Step 2
    Console.Print(j.ToString())
End For

Console.Print("Countdown:")
For k = 5 To 1 Step -1
    Console.Print(k.ToString() + "...")
End For
Console.Print("Liftoff!")

📱 Calculator

Do math with variables and the Math module.

// Simple calculator
Var a As Double = 42.5
Var b As Double = 7.3

Console.Print("a = " + a.ToString())
Console.Print("b = " + b.ToString())
Console.Print("a + b = " + (a + b).ToString())
Console.Print("a - b = " + (a - b).ToString())
Console.Print("a * b = " + (a * b).ToString())
Console.Print("a / b = " + Math.Round(a / b, 2).ToString())

Var pi As Double = Math.PI
Console.Print("Pi = " + Math.Round(pi, 4).ToString())
Console.Print("Square root of 144 = " + Math.Sqrt(144).ToString())

🎨 Colors

Create colors from RGB, hex, and random values.

// Playing with colors
Var red As Object = Color.FromRGB(255, 0, 0)
Console.Print("Red hex: " + red.Hex)

Var blue As Object = Color.FromRGB(0, 128, 255)
Console.Print("Blue hex: " + blue.Hex)

Var green As Object = Color.FromHex("#00CC66")
Console.Print("Green: R=" + green.Red.ToString() + " G=" + green.Green.ToString())

For i = 1 To 3
    Var random As Object = Color.Random()
    Console.Print("Random color: " + random.Hex)
End For

🖌️ Drawing

Draw a picture with sky, sun, house, and a tree.

// Draw a picture
Var pic As Object = Graphics.CreatePicture(300, 300)

pic.FillRect(0, 0, 300, 300, "#87CEEB")
pic.FillCircle(240, 60, 40, "#FFD700")
pic.FillRect(0, 220, 300, 80, "#228B22")
pic.FillRect(80, 140, 120, 80, "#8B4513")
pic.FillRect(120, 170, 40, 50, "#654321")
pic.DrawRect(80, 140, 120, 80, "#000000")

pic.FillRect(30, 150, 15, 70, "#654321")
pic.FillCircle(37, 140, 30, "#006400")

pic.Show()

🎲 Guessing Game

Guess a secret number with hints — too high or too low!

// Number guessing game
Var secret As Integer = Math.RandomInt(1, 20)
Var attempts As Integer = 0
Var found As Boolean = False

Console.Print("Guess a number between 1 and 20!")

While found = False
    Var input As String = Console.ReadLine("Your guess: ")
    Var guess As Integer = input.ToInteger()
    attempts = attempts + 1

    If guess = secret Then
        found = True
        Console.Print("Correct! " + attempts.ToString() + " tries!")
    ElseIf guess < secret Then
        Console.Print("Too low!")
    Else
        Console.Print("Too high!")
    End If
End While

📖 Story Maker

Build an interactive adventure story with user input.

// Interactive story maker
Var hero As String = Console.ReadLine("Hero name: ")
Var place As String = Console.ReadLine("A magical place: ")
Var creature As String = Console.ReadLine("A creature: ")
Var item As String = Console.ReadLine("A magic item: ")

Console.Print("---")
Console.Print("THE ADVENTURE OF " + hero.ToUpper())
Console.Print("Once upon a time, " + hero + " traveled to " + place + ".")
Console.Print("A friendly " + creature + " appeared!")
Console.Print("It said: Take this " + item + "!")
Console.Print(hero + " grabbed the " + item + " and smiled.")
Console.Print("The End.")

🎵 Music

Play a melody with the synthesizer — note by note!

// Play a melody
Var synth As Object = Synth.Create()
synth.SetWaveform("sine")

Var notes As Array = ["C4", "D4", "E4", "F4", "G4", "A4", "B4", "C5"]

For i = 0 To notes.Count - 1
    Console.Print("Playing: " + notes[i])
    synth.NoteOn(notes[i])
    System.Sleep(300)
    synth.NoteOff(notes[i])
    System.Sleep(50)
End For

Console.Print("Melody complete!")
synth.Stop()
BASICS

Basics (5 examples)

📦 Variables

All variable types: String, Integer, Double, Boolean, Array, and Object.

// All variable types
Var name As String = "Alice"
Var age As Integer = 25
Var height As Double = 1.72
Var isStudent As Boolean = True

Console.Print("Name: " + name)
Console.Print("Age: " + age.ToString())
Console.Print("Height: " + height.ToString() + " m")

Var fruits As Array = ["Apple", "Banana", "Cherry"]
fruits.Append("Date")
Console.Print("Fruits: " + fruits.Count.ToString())

Var person As Object = {"name": "Bob", "age": 30}
Console.Print("Person: " + person["name"])

🔀 Control Flow

If/ElseIf/Else branching and Select Case statements.

// If / ElseIf / Else
Var temp As Integer = 22

If temp > 30 Then
    Console.Print("Hot!")
ElseIf temp > 20 Then
    Console.Print("Nice and warm!")
ElseIf temp > 10 Then
    Console.Print("A bit cool.")
Else
    Console.Print("Cold!")
End If

// Select Case
Var day As String = "Monday"
Select Case day
    Case "Monday", "Tuesday", "Wednesday"
        Console.Print(day + " is a weekday")
    Case "Saturday", "Sunday"
        Console.Print(day + " is weekend!")
End Select

🔁 Loops

For, While, For Each loops and a nested multiplication table.

// For loop with step
For i = 0 To 20 Step 2
    Console.Print("Even: " + i.ToString())
End For

// While loop
Var count As Integer = 1
While count <= 5
    Console.Print("Count: " + count.ToString())
    count = count + 1
End While

// For Each
Var colors As Array = ["Red", "Green", "Blue"]
For Each color In colors
    Console.Print("Color: " + color)
End For

// Nested: multiplication table
For row = 1 To 5
    Var line As String = ""
    For col = 1 To 5
        line = line + (row * col).ToString() + "\t"
    End For
    Console.Print(line)
End For

⚙️ Functions

Define Functions with return values, Subs, and recursion.

Function Greet(name As String) As String
    Return "Hello, " + name + "!"
End Function

Function Factorial(n As Integer) As Integer
    If n <= 1 Then
        Return 1
    End If
    Return n * Factorial(n - 1)
End Function

Sub PrintLine()
    Console.Print("========================")
End Sub

Console.Print(Greet("World"))
PrintLine()
Console.Print("10! = " + Factorial(10).ToString())
PrintLine()

Function Average(nums As Array) As Double
    Var total As Double = 0
    For Each n In nums
        total = total + n
    End For
    Return total / nums.Count
End Function

Console.Print("Avg: " + Average([85, 92, 78, 95]).ToString())

🏗️ Classes

Define classes with properties, constructors, and methods.

Class Animal
    Property Name As String
    Property Sound As String
    Property Legs As Integer

    Sub New(name As String, sound As String, legs As Integer)
        Me.Name = name
        Me.Sound = sound
        Me.Legs = legs
    End Sub

    Function Speak() As String
        Return Me.Name + " says " + Me.Sound + "!"
    End Function
End Class

Var cat As Object = New Animal("Cat", "Meow", 4)
Var bird As Object = New Animal("Bird", "Tweet", 2)

Console.Print(cat.Speak())
Console.Print(bird.Speak())
Console.Print(cat.Name + " has " + cat.Legs.ToString() + " legs")
DATA & STORAGE

Data & Storage (8 examples)

{} JSON

Parse JSON strings and create structured data objects.

Var jsonText As String = "{\"name\": \"Alice\", \"age\": 30, \"hobbies\": [\"reading\", \"coding\"]}"
Var data As Object = JSON.Parse(jsonText)
Console.Print("Name: " + data["name"])
Console.Print("Age: " + data["age"].ToString())

Var person As Object = {"name": "Bob", "city": "Munich"}
Var output As String = JSON.PrettyPrint(person)
Console.Print(output)

person["email"] = "bob@example.com"
Console.Print(JSON.Stringify(person))

📊 CSV

Write tabular data to CSV and read it back row by row.

Var path As String = System.TempDirectory + "/data.csv"

Var data As Array = [
    ["Name", "Age", "City"],
    ["Alice", "30", "Berlin"],
    ["Bob", "25", "Munich"],
    ["Carol", "35", "Hamburg"]
]

CSV.Write(path, data)
Console.Print("CSV written!")

Var loaded As Array = CSV.Read(path)
For Each row In loaded
    Console.Print(row[0] + " | " + row[1] + " | " + row[2])
End For

🗄️ Database

Create a SQLite database, insert rows, and query them.

Var db As Object = Database.Open(System.TempDirectory + "/app.db")

db.Execute("CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT, email TEXT)")
db.Execute("INSERT INTO users (name, email) VALUES ('Alice', 'alice@test.com')")
db.Execute("INSERT INTO users (name, email) VALUES ('Bob', 'bob@test.com')")

Var rows As Array = db.Query("SELECT * FROM users")
For Each row In rows
    Console.Print(row["name"] + " (" + row["email"] + ")")
End For

Var count As Integer = db.Scalar("SELECT COUNT(*) FROM users")
Console.Print("Total: " + count.ToString())
db.Close()

📁 File I/O

Write text files, check existence, and read contents back.

Var path As String = System.TempDirectory + "/hello.txt"

FileAndFolder.WriteAllText(path, "Hello from Neuridion!\nLine 2\nLine 3")
Console.Print("File written!")

If FileAndFolder.Exists(path) Then
    Console.Print("File exists!")
End If

Var content As String = FileAndFolder.ReadAllText(path)
Console.Print("Content: " + content)
Console.Print("Length: " + content.Length.ToString() + " chars")

Var files As Array = FileAndFolder.ListFiles(System.TempDirectory)
Console.Print("Files in temp: " + files.Count.ToString())

💾 Storage

Persistent key-value storage that survives between runs.

Storage.Set("username", "Alice")
Storage.Set("highscore", "9500")
Storage.Set("theme", "dark")

Var user As String = Storage.Get("username")
Console.Print("User: " + user)

Var keys As Array = Storage.Keys()
Console.Print("Keys: " + keys.Count.ToString())
For Each key In keys
    Console.Print("  " + key + " = " + Storage.Get(key))
End For

Storage.Delete("theme")
Console.Print("After delete: " + Storage.Keys().Count.ToString() + " keys")

</> XML

Parse XML documents and navigate the element tree.

Var xml As String = "<library><book id=\"1\"><title>Neuridion Guide</title><author>Alice</author></book><book id=\"2\"><title>Learn Coding</title><author>Bob</author></book></library>"

Var doc As Object = XML.ParseString(xml)
Var books As Array = doc.GetChildren("book")

Console.Print("Found " + books.Count.ToString() + " books:")
For Each book In books
    Var title As String = book.GetChild("title").Text
    Var author As String = book.GetChild("author").Text
    Console.Print("  " + title + " by " + author)
End For

📱 QR Code

Generate QR code images from text or URLs.

Var path As String = System.TempDirectory + "/myqr.png"

QRCode.Generate("https://neuridium.com", path)
Console.Print("QR code saved: " + path)

Var largePath As String = System.TempDirectory + "/large_qr.png"
QRCode.Generate("Hello from Neuridion!", largePath, 512)
Console.Print("Large QR saved!")

📄 PDF

Create PDF documents with text and formatted content.

Var path As String = System.TempDirectory + "/report.pdf"
Var doc As Object = PDF.Create(path)

doc.AddPage()
doc.AddText("Monthly Report", 50, 750)
doc.AddText("Generated by Neuridion IDE", 50, 720)
doc.AddText("Date: " + DateAndTime.Now().Format("yyyy-MM-dd"), 50, 700)
doc.AddText("Sales: $12,500", 50, 650)
doc.AddText("Expenses: $8,300", 50, 630)
doc.AddText("Profit: $4,200", 50, 610)
doc.Save()
Console.Print("PDF created: " + path)
TEXT & LANGUAGE

Text & Language (4 examples)

🔍 RegEx

Pattern matching — validate emails, extract numbers, and replace text.

Var email As String = "alice@example.com"
Var valid As Boolean = RegEx.IsMatch(email, ".+@.+\\..+")
Console.Print("Valid email: " + valid.ToString())

Var text As String = "Order 123 has 5 items for $99"
Var numbers As Array = RegEx.FindAll(text, "[0-9]+")
For Each num In numbers
    Console.Print("Found number: " + num)
End For

Var cleaned As String = RegEx.Replace("Hello   World", "\\s+", " ")
Console.Print("Cleaned: " + cleaned)

🔢 Encoding

Base64, hex, and URL encoding round-trips.

Var text As String = "Hello, Neuridion!"
Var b64 As String = Encoding.ToBase64(text)
Console.Print("Base64: " + b64)
Var decoded As String = Encoding.FromBase64(b64)
Console.Print("Decoded: " + decoded)

Var hex As String = Encoding.ToHex(text)
Console.Print("Hex: " + hex)
Console.Print("From hex: " + Encoding.FromHex(hex))

Var url As String = Encoding.URLEncode("hello world & more")
Console.Print("URL encoded: " + url)
Console.Print("URL decoded: " + Encoding.URLDecode(url))

🌍 Translate

Translate text between multiple languages.

Var text As String = "Hello, how are you?"
Console.Print("English: " + text)

Var german As String = Translate.Text(text, "en", "de")
Console.Print("German: " + german)

Var french As String = Translate.Text(text, "en", "fr")
Console.Print("French: " + french)

Var spanish As String = Translate.Text(text, "en", "es")
Console.Print("Spanish: " + spanish)

Var languages As Array = Translate.AvailableLanguages()
Console.Print("Available: " + languages.Count.ToString() + " languages")

🎤 Speech

Text-to-speech in multiple languages.

Console.Print("Speaking English...")
Speech.Say("Hello from Neuridion!")

Console.Print("Speaking German...")
Speech.Say("Hallo Welt!", "de")

Console.Print("Speaking French...")
Speech.Say("Bonjour le monde!", "fr")

Var voices As Array = Speech.Voices()
Console.Print("Available voices: " + voices.Count.ToString())
For i = 0 To Math.Min(3, voices.Count) - 1
    Console.Print("  " + voices[i])
End For
SYSTEM & SECURITY

System & Security (14 examples)

💻 System Info

Read system properties like username, OS version, and directories.

Console.Print("--- System Information ---")
Console.Print("User: " + System.UserName)
Console.Print("OS: " + System.OSVersion)
Console.Print("Home: " + System.HomeDirectory)
Console.Print("Temp: " + System.TempDirectory)

Var now As Object = DateAndTime.Now()
Console.Print("Date: " + now.Format("yyyy-MM-dd"))
Console.Print("Time: " + now.Format("HH:mm:ss"))
Console.Print("Timestamp: " + now.Format("yyyy-MM-dd HH:mm:ss"))

💻 Shell Commands

Run shell commands and capture their output.

Console.Print("--- Directory Listing ---")
Var listing As String = Shell.Execute("ls -la")
Console.Print(listing)

Console.Print("--- Disk Usage ---")
Var disk As String = Shell.Execute("df -h /")
Console.Print(disk)

Console.Print("--- Current Date ---")
Var date As String = Shell.Execute("date")
Console.Print("System date: " + date)

Console.Print("--- Uptime ---")
Var uptime As String = Shell.Execute("uptime")
Console.Print(uptime)

📋 Clipboard

Read and write the system clipboard.

Var original As String = Clipboard.Get()
Console.Print("Current clipboard: " + original)

Clipboard.Set("Hello from Neuridion!")
Console.Print("Set new clipboard text")

Var check As String = Clipboard.Get()
Console.Print("Clipboard now: " + check)

// Restore original content
Clipboard.Set(original)
Console.Print("Restored original clipboard")
Console.Print("Verified: " + Clipboard.Get())

🔔 Notifications

Send macOS system notifications from your program.

Console.Print("Sending notifications...")

Notification.Show("Neuridion IDE", "Your program has started!")
System.Sleep(1000)

Notification.Show("Build Complete", "Project compiled successfully.")
System.Sleep(1000)

Notification.Show("Reminder", "Don't forget to save your work!")

Console.Print("All notifications sent!")
Console.Print("Check the notification center.")

🔒 Crypto

Hash, encrypt, decrypt text and generate UUIDs.

Var text As String = "Hello, World!"

Var sha256 As String = Crypto.SHA256(text)
Console.Print("SHA-256: " + sha256)

Var md5 As String = Crypto.MD5(text)
Console.Print("MD5: " + md5)

Var key As String = "mysecretkey12345"
Var encrypted As String = Crypto.Encrypt(text, key)
Console.Print("Encrypted: " + encrypted)

Var decrypted As String = Crypto.Decrypt(encrypted, key)
Console.Print("Decrypted: " + decrypted)

Var uuid As String = Crypto.UUID()
Console.Print("UUID: " + uuid)

🌐 Network GET

Fetch data from a web API with GET requests.

Console.Print("Fetching data from API...")
Var resp As Object = Network.Get("https://httpbin.org/get")

Console.Print("Status: " + resp.StatusCode.ToString())
Console.Print("OK: " + resp.OK.ToString())

If resp.OK Then
    Var data As Object = JSON.Parse(resp.Body)
    Console.Print("Origin: " + data["origin"])
    Console.Print("URL: " + data["url"])
End If

Var headers As Object = resp.Headers
Console.Print("Content-Type: " + headers["Content-Type"])

📤 Network POST

Send data to a web API with POST requests.

Var payload As Object = {"name": "Alice", "email": "alice@test.com", "score": 95}
Var body As String = JSON.Stringify(payload)

Console.Print("Sending POST request...")
Var resp As Object = Network.Post("https://httpbin.org/post", body)

Console.Print("Status: " + resp.StatusCode.ToString())
If resp.OK Then
    Var result As Object = JSON.Parse(resp.Body)
    Console.Print("Server received: " + result["data"])
End If

Console.Print("Response OK: " + resp.OK.ToString())

✉️ Email Send

Compose and prepare an email for sending via SMTP.

Var mail As Object = Email.Create()
mail.To = "friend@example.com"
mail.From = "me@example.com"
mail.Subject = "Hello from Neuridion!"
mail.Body = "This email was sent from a Neuridion program."

Console.Print("To: " + mail.To)
Console.Print("Subject: " + mail.Subject)
Console.Print("Body: " + mail.Body)

// mail.Send()  // Uncomment to actually send
Console.Print("Email ready to send!")
Console.Print("(Configure SMTP in Settings first)")

📨 Email Read

Connect to an IMAP server and fetch unread messages.

// Configure IMAP in Settings first
Var host As String = "imap.example.com"
Var port As Integer = 993
Var user As String = "me@example.com"
Var pass As String = "password"

Console.Print("Connecting to IMAP...")
Var imap As Object = Email.IMAP(host, port, user, pass)
Var messages As Array = imap.FetchUnread()
Console.Print("Unread: " + messages.Count.ToString())

For Each msg In messages
    Console.Print("From: " + msg["from"])
    Console.Print("Subject: " + msg["subject"])
    Console.Print("---")
End For

📅 Calendar

Access calendar events and display today's schedule.

Console.Print("--- Calendar Events ---")
Var events As Array = Calendar.GetEvents()
Console.Print("Total events: " + events.Count.ToString())

For Each ev In events
    Console.Print("Event: " + ev["title"])
    Console.Print("  Start: " + ev["startDate"])
    Console.Print("  End: " + ev["endDate"])
    Console.Print("  ---")
End For

Var today As Object = DateAndTime.Now()
Console.Print("Today is: " + today.Format("EEEE, MMMM d, yyyy"))

👥 Contacts

Read the system address book and display contact details.

Console.Print("--- Address Book ---")
Var people As Array = Contacts.GetAll()
Console.Print("Total contacts: " + people.Count.ToString())

Var count As Integer = Math.Min(5, people.Count)
For i = 0 To count - 1
    Var person As Object = people[i]
    Console.Print("Name: " + person["name"])
    If person.ContainsKey("email") Then
        Console.Print("  Email: " + person["email"])
    End If
    If person.ContainsKey("phone") Then
        Console.Print("  Phone: " + person["phone"])
    End If
End For

📍 Location

Get GPS coordinates, reverse geocode, and look up addresses.

Console.Print("Getting location...")
Var loc As Object = Location.Current()

Console.Print("Latitude: " + loc["latitude"].ToString())
Console.Print("Longitude: " + loc["longitude"].ToString())

Console.Print("Reverse geocoding...")
Var address As Object = Location.Reverse(loc["latitude"], loc["longitude"])
Console.Print("City: " + address["city"])
Console.Print("Country: " + address["country"])

Console.Print("Geocoding Berlin...")
Var berlin As Object = Location.Geocode("Berlin, Germany")
Console.Print("Berlin: " + berlin["latitude"].ToString() + ", " + berlin["longitude"].ToString())

🛠️ Hardware

Query CPU, memory, battery, screen, and disk information.

Console.Print("--- Hardware Info ---")
Console.Print("CPU: " + Hardware.CPUName)
Console.Print("Cores: " + Hardware.CPUCores.ToString())
Console.Print("RAM: " + Hardware.TotalMemory.ToString() + " GB")

Console.Print("Battery: " + Hardware.BatteryLevel.ToString() + "%")
Console.Print("Charging: " + Hardware.IsCharging.ToString())

Console.Print("Screen: " + Hardware.ScreenWidth.ToString() + "x" + Hardware.ScreenHeight.ToString())

Var disk As Object = Hardware.DiskSpace()
Console.Print("Disk total: " + disk["total"].ToString() + " GB")
Console.Print("Disk free: " + disk["free"].ToString() + " GB")

📶 Bluetooth

Scan for nearby Bluetooth devices and display signal strength.

Console.Print("Scanning for Bluetooth devices...")
Var devices As Array = Bluetooth.Scan()
Console.Print("Found " + devices.Count.ToString() + " devices:")

For Each dev In devices
    Console.Print("Name: " + dev["name"])
    Console.Print("  Address: " + dev["address"])
    Console.Print("  RSSI: " + dev["rssi"].ToString() + " dBm")
    Console.Print("  ---")
End For

If devices.Count = 0 Then
    Console.Print("No devices found nearby.")
    Console.Print("Make sure Bluetooth is enabled.")
End If
GRAPHICS & MEDIA

Graphics & Media (7 examples)

🖌️ Drawing Shapes

Create pictures with rectangles, circles, lines, and random colors.

Var pic As Object = Graphics.CreatePicture(400, 300)

// Background
pic.FillRect(0, 0, 400, 300, "#1A1A2E")

// Colorful shapes
pic.FillCircle(100, 100, 60, "#E94560")
pic.FillRect(200, 50, 150, 100, "#0F3460")
pic.DrawLine(0, 250, 400, 250, "#16213E")

// Overlapping circles
For i = 0 To 4
    Var x As Integer = 80 + i * 60
    pic.FillCircle(x, 200, 30, Color.Random().Hex)
End For

pic.Show()
Console.Print("Drawing complete!")

📷 Image Filter

Create an image and apply blur and grayscale filters.

Var pic As Object = Graphics.CreatePicture(300, 300)
pic.FillRect(0, 0, 300, 300, "#FF6B6B")
pic.FillCircle(150, 150, 100, "#4ECDC4")
pic.FillRect(100, 100, 100, 100, "#45B7D1")

Console.Print("Original image created")
pic.Show()

Console.Print("Applying blur filter...")
pic.ApplyFilter("blur", 10)
pic.Show()

Console.Print("Applying grayscale...")
pic.ApplyFilter("grayscale")
pic.Show()

Var savePath As String = System.TempDirectory + "/filtered.png"
pic.Save(savePath)
Console.Print("Saved to: " + savePath)

📈 Charts

Create bar, pie, and line charts from data arrays.

// Bar chart
Var months As Array = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"]
Var sales As Array = [120, 250, 180, 310, 275, 400]
Var bar As Object = Chart.Bar(months, sales)
bar.Title = "Monthly Sales 2026"
bar.Show()

// Pie chart
Var categories As Array = ["Food", "Rent", "Transport", "Fun"]
Var expenses As Array = [400, 800, 150, 200]
Var pie As Object = Chart.Pie(categories, expenses)
pie.Title = "Monthly Expenses"
pie.Show()

// Line chart
Var line As Object = Chart.Line(months, sales)
line.Title = "Sales Trend"
line.Show()

🔊 Audio Playback

Record a short audio clip and play it back.

Console.Print("--- Audio Player ---")
Var path As String = System.TempDirectory + "/test.wav"

// Record a short clip
Console.Print("Recording 3 seconds...")
Var recorder As Object = Audio.StartRecording(path)
System.Sleep(3000)
recorder.Stop()
Console.Print("Recording saved!")

// Play it back
Var player As Object = Audio.LoadSound(path)
Console.Print("Duration: " + player.Duration.ToString() + " seconds")
Console.Print("Playing...")
player.Play()
System.Sleep(3000)
Console.Print("Playback complete!")

🎵 Synthesizer

Play chords and melodies with the built-in synthesizer.

Var synth As Object = Synth.Create()
synth.SetWaveform("sine")

// Play a C major chord
Console.Print("Playing C major chord...")
synth.NoteOn("C4")
synth.NoteOn("E4")
synth.NoteOn("G4")
System.Sleep(1000)
synth.AllNotesOff()

// Play a melody
Console.Print("Playing melody...")
Var melody As Array = ["C4", "E4", "G4", "C5", "G4", "E4", "C4"]
For Each note In melody
    synth.NoteOn(note)
    System.Sleep(200)
    synth.NoteOff(note)
End For

synth.Stop()
Console.Print("Done!")

🖥️ Screen Capture

Get screen info and take a screenshot.

Console.Print("--- Screen Info ---")
Console.Print("Width: " + Screen.Width.ToString())
Console.Print("Height: " + Screen.Height.ToString())
Console.Print("Scale: " + Screen.Scale.ToString() + "x")

Var path As String = System.TempDirectory + "/screenshot.png"
Console.Print("Taking screenshot...")
Screen.Capture(path)
Console.Print("Saved: " + path)

// Load and show the screenshot
Var pic As Object = Graphics.LoadPicture(path)
Console.Print("Screenshot size: " + pic.Width.ToString() + "x" + pic.Height.ToString())
pic.Show()

🗔️ Forms GUI

Build a contact form with text fields, checkbox, and buttons.

Var win As Object = Form.Window("Contact Form", 400, 350)
win.AddLabel("lblTitle", "Contact Information", 20, 20, 360)
win.AddTextField("txtName", "", 20, 60, 360, {"Placeholder": "Your name"})
win.AddTextField("txtEmail", "", 20, 100, 360, {"Placeholder": "Email address"})
win.AddTextArea("txtMessage", "", 20, 140, 360, {"Placeholder": "Your message..."})
win.AddCheckBox("chkAgree", "I agree to the terms", 20, 240, 200)
win.AddButton("btnSubmit", "Submit", 20, 280, 120, {"Style": "Primary"})
win.AddButton("btnCancel", "Cancel", 260, 280, 120)

Var result As Object = win.Show()
If result["_clickedButton"] = "btnSubmit" Then
    Console.Print("Name: " + result["txtName"])
    Console.Print("Email: " + result["txtEmail"])
    Console.Print("Message: " + result["txtMessage"])
End If
AI & VISION

AI & Vision (2 examples)

🧠 AI Chat

Ask the AI assistant questions and get intelligent responses.

Console.Print("--- AI Assistant ---")
Console.Print("Asking about Neuridion...")

Var answer As String = AI.Ask("What is the Neuridion programming language?")
Console.Print("AI: " + answer)

Console.Print("---")
Console.Print("Asking for code help...")
Var code As String = AI.Ask("Write a Neuridion function that checks if a number is prime")
Console.Print("AI: " + code)

Console.Print("---")
Console.Print("Asking a math question...")
Var math As String = AI.Ask("What is the square root of 144?")
Console.Print("AI: " + math)

👁️ Image Analysis

Create an image and use AI vision to describe and classify it.

// Create a test image
Var pic As Object = Graphics.CreatePicture(400, 300)
pic.FillRect(0, 0, 400, 300, "#87CEEB")
pic.FillCircle(300, 80, 50, "#FFD700")
pic.FillRect(0, 200, 400, 100, "#228B22")
pic.FillRect(100, 120, 80, 80, "#8B4513")

Console.Print("Image created. Analyzing...")
Var description As String = pic.Describe()
Console.Print("AI sees: " + description)

Console.Print("Detecting text...")
Var text As String = pic.DetectText()
Console.Print("Text found: " + text)

Console.Print("Classifying...")
Var labels As Array = pic.Classify()
For Each label In labels
    Console.Print("Label: " + label)
End For

Try These Examples Yourself

All 48 examples are built into Neuridion IDE. Open any example with one click from the Welcome screen.

Download Public Beta