Appendix A: Examples Gallery

**Complete working programs organized by category.**

NanoLang Mascot

All examples include shadow tests and compile successfully. Browse the full collection at examples/ on GitHub.

Getting Started

ExampleDescription
examples/language/nl_hello.nanoHello World
examples/language/nl_factorial.nanoRecursive functions
examples/language/nl_fibonacci.nanoClassic algorithm
examples/language/nl_functions_basic.nanoFunction basics

Data Structures

ExampleDescription
examples/language/nl_array_complete.nanoArray operations
examples/language/nl_struct.nanoCustom types (structs)
examples/language/nl_enum.nanoEnumerations
examples/language/nl_union_types.nanoUnion types
examples/language/nl_types_tuple.nanoTuples
examples/language/nl_hashmap.nanoHashMaps
examples/language/nl_generics_demo.nanoGenerics

Control Flow

ExampleDescription
examples/language/nl_control_if_while.nanoif/else and while loops
examples/language/nl_control_for.nanofor loops
examples/language/nl_control_match.nanoPattern matching
examples/language/nl_filter_map_fold.nanoFunctional iteration

Text Processing

ExampleDescription
examples/debug/logging_demo.nanoStructured logging
examples/debug/logging_levels_demo.nanoLog levels
examples/advanced/regex_demo.nanoRegular expressions
examples/language/nl_string_operations.nanoString manipulation

File I/O

ExampleDescription
examples/advanced/stdio_file_processor.nanoFile processing
examples/language/nl_csv_processor.nanoCSV parsing

Database

ExampleDescription
examples/advanced/sqlite_simple.nanoSQLite basics
examples/data/json_demo.nanoJSON parsing

Graphics (SDL)

ExampleDescription
examples/graphics/sdl_drawing_primitives.nanoBasic shapes and lines
examples/graphics/sdl_particles.nanoParticle system
examples/graphics/sdl_boids.nanoFlocking simulation
examples/graphics/sdl_game_of_life.nanoConway's Game of Life
examples/graphics/sdl_fire.nanoFire effect
examples/graphics/sdl_starfield.nano3D starfield
examples/graphics/sdl_raytracer.nanoRay tracing
examples/graphics/sdl_falling_sand.nanoFalling sand simulation
examples/graphics/sdl_image_demo.nanoImage loading
examples/graphics/sdl_terrain_explorer.nanoProcedural terrain

Games

ExampleDescription
examples/games/sdl_pong.nanoClassic Pong
examples/games/sdl_asteroids.nanoAsteroids clone
examples/games/sdl_checkers.nanoCheckers with AI
examples/language/nl_snake.nanoTerminal Snake
examples/language/nl_tictactoe.nanoTic-tac-toe

Audio

ExampleDescription
examples/audio/sdl_audio_player.nanoAudio playback
examples/audio/sdl_audio_wav.nanoWAV file player
examples/audio/sdl_mod_visualizer.nanoMOD file visualizer

Physics

ExampleDescription
examples/physics/bullet_bouncy_balls.nanoBouncing balls with Bullet
examples/physics/bullet_softbody_hourglass.nanoSoft body simulation
examples/physics/bullet_rigid_megastacks.nanoRigid body stacking
examples/graphics/sdl_physics_demo.nanoSimple physics

OpenGL

ExampleDescription
examples/opengl/opengl_cube.nanoRotating cube
examples/opengl/opengl_modern_hello_triangle.nanoModern OpenGL setup
examples/opengl/opengl_particle_fountain.nano3D particle system
examples/opengl/opengl_solar_system.nanoSolar system simulation
examples/opengl/opengl_teapot.nanoUtah Teapot

Terminal UI

ExampleDescription
examples/terminal/ncurses_snake.nanoSnake in ncurses
examples/terminal/ncurses_game_of_life.nanoGame of Life TUI
examples/terminal/ncurses_matrix_rain.nanoMatrix rain effect

Networking

ExampleDescription
examples/network/curl_example.nanoHTTP client
examples/network/http_hello_world.nanoSimple web server
examples/network/http_rest_api.nanoREST API server
examples/network/http_static_server.nanoStatic file server

Testing & Debug

ExampleDescription
examples/debug/coverage_demo.nanoCode coverage
examples/debug/property_test_math.nanoProperty-based testing
examples/advanced/testing_strategies.nanoTesting patterns

Advanced

ExampleDescription
examples/advanced/ffi_tutorial.nanoFFI tutorial
examples/advanced/unsafe_demo.nanoUnsafe blocks
examples/language/nl_first_class_functions.nanoFirst-class functions
examples/opl/opl_parser.nanoLanguage parser
examples/language/full_repl.nanoFull REPL implementation

Interactive Tools

ExampleDescription
examples/sdl_example_launcher.nanoGUI example launcher

---

**Previous:** Chapter 25: Contributing

**Next:** Appendix B: Quick Reference