This commit is contained in:
sirlilpanda
2025-08-28 21:19:47 +12:00
commit d4e72630e9
12 changed files with 2829 additions and 0 deletions

22
README.md Normal file
View File

@@ -0,0 +1,22 @@
# c_command_pattern
a simple example of how to implement the state pattern in c. check [`main.c`](src/main.c) for the implementation
# how to build and run it
this demo uses a simple build system called [nob](https://github.com/tsoding/nob.h) a header only build system for c projects.
to build run these command in the root of the project:
```bash
# bootstraps the build system
> gcc nob.c -o nob
# runs the build system
> ./nob
# runs the program
> ./build/main
```
and if you have a differnt complier you want to use that is posix compliant just change the `CC` macro in the `nob.c` with your one.