Repository of Zig code examples that I have cooked up learning Zig.
To run the examples use the following command: zig run .\src\<filename>.zig
To run the tests use the following command: zig test .\src\<filename>.zig
File | Description | Explanation | |
---|---|---|---|
1 | fizzbuzz.zig | An example implementation of Fizz Buzz. | Fizz Buzz |
2 | string_reverse.zig | Reverse a string by iterating half way through and swapping values. Should be able to reverse any string of any length. | Reverse String |
3 | guess.zig | A simple number guessing game. You must guess a number between 1 and 100. Uses the current timestamp to seed the random number generator. | |
4 | pathgen.zig | A simple path generation program. Writes the letters A-Z until it reaches Z or hits a wall. From C Programming: A Modern Approach. |