https://github.com/ratfactor/ziglings Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Project management - + Integrations - + GitHub Sponsors - + Customer stories - + Security - * Team * Enterprise * Explore + Explore GitHub - Learn & contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Nonprofit - + Education - [ ] [search-key] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} ratfactor / ziglings Template * Watch 6 * Star 254 * Fork 10 Learn the Zig programming language by fixing tiny broken programs. MIT License 254 stars 10 forks Star Watch * Code * Issues 0 * Pull requests 1 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights main 1 branch 0 tags Go to file Code Clone HTTPS GitHub CLI [https://github.com/r] Use Git or checkout with SVN using the web URL. [gh repo clone ratfac] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio If nothing happens, download the GitHub extension for Visual Studio and try again. Go back Latest commit @ratfactor ratfactor Added additional inspirations for Ziglings ... f33d698 Feb 13, 2021 Added additional inspirations for Ziglings Ruby Koans is even attributed by rustlings. The Little Schemer is a personal all-time favorite programming book. f33d698 Git stats * 48 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time exercises Update 04_arrays.zig Feb 13, 2021 .gitattributes Use a zig build script to run ziglings Feb 12, 2021 .gitignore Use a zig build script to run ziglings Feb 12, 2021 LICENSE Added Ex. 2, polished script, added LICENSE Jan 3, 2021 README.md Added additional inspirations for Ziglings Feb 13, 2021 build.zig Use a zig build script to run ziglings Feb 12, 2021 View code README.md ziglings Welcome to ziglings! This project contains a series of tiny broken programs. By fixing them, you'll learn how to read and write Zig code! This project was directly inspired by the brilliant and fun rustlings project for the Rust language. Indirect inspiration comes from Ruby Koans and the Little LISPer/Little Schemer series of books. Intended Audience This will probably be difficult if you've never programmed before. But no specific programming experience is required. And in particular, you are not expected to have any prior experience with "systems programming" or a "systems" level language such as C. Each exercise is self-contained and self-explained. However, you're encouraged to also check out these Zig language resources for more detail: * https://ziglearn.org/ * https://ziglang.org/documentation/master/ Getting Started Install a master build of the Zig compiler. Verify the installation and version of zig like so: $ zig version 0.8.0-dev.1065+ Clone this repository with Git: git clone https://github.com/ratfactor/ziglings cd ziglings Then run zig build and follow the instructions to begin! zig build A Note About Compiler Versions The Zig language is under very active development. Ziglings will attempt to be current, but not bleeding-edge. However, sometimes fundamental changes will happen. Ziglings will check for a minimum version and build number (which is this one: 0.x.x-dev.) and exit if your version of Zig is too old. It is likely that you'll download a build which is greater than the number in the example shown above in this README. That's okay! Once you have a version of the Zig compiler that works with your copy of Ziglings, they'll continue to work together forever. But if you update one, keep in mind that you may need to also update the other. Manual Usage If you want to run a single file for testing, you can do so with this command: zig run exercises/01_hello.zig or, alternatively zig build 01_test To verify a single file, use zig build 01_only To prepare an executable for debugging, install it to zig-cache/bin with zig build 01_install TODO Contributions are very welcome! I'm writing this to teach myself and to create the learning resource I wished for. There will be tons of room for improvement: * Wording of explanations * Idiomatic usage of Zig * Additional exercises Planned exercises: * [*] Hello world (main needs to be public) * [*] Importing standard library * [*] Assignment * [*] Arrays * [*] Strings * [*] If * [*] While * [*] For * [*] Functions * [*] Errors (error/try/catch/if-else-err) * [*] Defer (and errdefer) * [*] Switch * [*] Unreachable * [*] Enums * [*] Structs * [*] Pointers * [ ] Multi pointers * [ ] Slices * [ ] Unions * [ ] Numeric types (integers, floats) * [ ] Labelled blocks and loops * [ ] Loops as expressions * [ ] Optionals * [ ] Comptime * [ ] Inline loops (how to DEMO this?) * [ ] Anonymous structs * [ ] Sentinel termination * [ ] Vectors * [ ] Imports * [ ] Allocators * [ ] Arraylist * [ ] Filesystem * [ ] Readers and Writers * [ ] Formatting * [ ] JSON * [ ] Random Numbers * [ ] Crypto * [ ] Threads * [ ] Hash Maps * [ ] Stacks * [ ] Sorting * [ ] Iterators * [ ] Formatting specifiers * [ ] Advanced Formatting * [ ] Suspend / Resume * [ ] Async / Await * [ ] Nosuspend * [ ] Async Frames, Suspend Blocks The initial topics for these exercises were unabashedly cribbed from ziglearn.org. I've since moved things around in an order that I think best lets each topic build upon each other. About Learn the Zig programming language by fixing tiny broken programs. Resources Readme License MIT License Releases No releases published Packages 0 No packages published Contributors 5 * @ratfactor * @Joefish * @palash25 * @SpexGuy * @tijb Languages * Zig 100.0% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.