Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Collections Example

This example demonstrates how to initialize, modify, and iterate over list and map collections in TechScript.

Code (collections.txs)

# List modifications
fruits = ["apple", "banana"]
fruits.push("cherry")

say "--- List Iteration ---"
for fruit in fruits
    say fruit
end

# Map modifications
prices = {
    "apple": 50,
    "banana": 20
}
prices["cherry"] = 80

say "--- Map Iteration ---"
for item in prices
    say $"{item}: {prices[item]}"
end

Running the Example

tech run collections.txs

Expected Output

--- List Iteration ---
apple
banana
cherry
--- Map Iteration ---
apple: 50
banana: 20
cherry: 80