Official examples, community projects, and Rosetta Code implementations for the Zen C programming language.
This repository serves as the primary collection of examples for Zen C. It demonstrates the language's modern features, ergonomics, and seamless C interoperability across various domains, from simple algorithms to systems programming.
rosetta/: A wide collection of Rosetta Code implementations showcasing idiomatic Zen C solutions to common programming tasks.internal/: Internal feature demos, including networking, SIMD, graphics, and more.
Many of the examples in this repository are extracted from the Zen C category on Rosetta Code.
We are always looking to expand our presence there! All additions and improvements to Zen C tasks on Rosetta Code are greatly appreciated and help showcase the language's capabilities to the wider programming community.
- FizzBuzz: The classic programming interview task.
- Fibonacci Sequence: Demonstrating recursion and iteration.
- Ternary Logic: Implementing non-binary logic systems.
- Echo Server: Simple networking implementation.
- Caesar Cipher: Basic text manipulation and pattern matching.
- SIMD: Leveraging hardware acceleration for performance.
- Networking: Real-world communication examples.
- Games: Interactive demos built with Zen C.
To run any example, ensure you have the Zen C compiler installed. Since this repository is intended to be used as a submodule at examples/ in the Zen C root, you can run examples like this:
# From Zen-C root zc run examples/rosetta/Hello_world_Newbie.zcTip
You can also compile these examples to standalone executables:
zc build examples/rosetta/FizzBuzz.zc -o fizzbuzz ./fizzbuzzFound a bug or want to add a new example? Contributions are welcome! Please feel free to open a Pull Request or report an Issue.