Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 1.85 KB

File metadata and controls

49 lines (39 loc) · 1.85 KB

Examples Directory Guide

This guide explains how to run, understand, and inspect the code examples under the examples/ directory.


📂 Example Folder Structure

Every example is in its own folder and contains:

  • Source Script: The .txs source code.
  • README.md: Explanation of how the code works.
  • expected.txt: The exact output printed by the program when executed.

🚀 Running the Examples

Run an example using the tech compiler:

# Navigate to the example folder
cd examples/hello_world
tech run hello.txs

You can verify that output matches expectations:

tech test

🗺️ Index of Core Examples

Folder Focus Key Concept covered
hello_world Core Simplest output prints
calculator Math Functions and math operators
todo_cli State Lists and maps manipulation
guess_number Logic Ranges, loops, conditionals
http_server Network Web routing and mock testing
json_parser Data Encoding/decoding maps
file_reader File System IO file writes and reads
oop Models Classes, inheritance, overriding
modules Imports Multi-file namespaces
collections Types Loops over list and maps
generics Polymorph Parameterized types
error_handling Errors try/catch boundaries
async Concurrency Event loops and futures
threads Parallel Thread spawns & mutexes
web_api Fetch External GET API calls