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 foldercd examples/hello_world
tech run hello.txs

You can verify that output matches expectations:

tech test

🗺️ Index of Core Examples

FolderFocusKey Concept covered
hello_worldCoreSimplest output prints
calculatorMathFunctions and math operators
todo_cliStateLists and maps manipulation
guess_numberLogicRanges, loops, conditionals
http_serverNetworkWeb routing and mock testing
json_parserDataEncoding/decoding maps
file_readerFile SystemIO file writes and reads
oopModelsClasses, inheritance, overriding
modulesImportsMulti-file namespaces
collectionsTypesLoops over list and maps
genericsPolymorphParameterized types
error_handlingErrorstry/catch boundaries
asyncConcurrencyEvent loops and futures
threadsParallelThread spawns & mutexes
web_apiFetchExternal GET API calls