An open API service indexing awesome lists of open source software.

https://github.com/sven4500/cnake

Console version of the Snake video game
https://github.com/sven4500/cnake

c c-programming c-programming-language console console-application console-games snake snake-game snake-video-game video-game

Last synced: 3 months ago
JSON representation

Console version of the Snake video game

Awesome Lists containing this project

README

        

# cnake
Console version of the Snake video game. Written in pure C, straightforward linked list is implemented, adjustable screen size. Unit tests are implemented using gtest testing framework.

```console
+------------------------------------------------------+
| | 3
| |
| |
| |
| |
| o |
| |
| |
| |
| <.? |
| |
| |
| |
| |
+------------------------------------------------------+
```

## Testing

Unit tests are included in this repository. Run cmake providing `GTEST_INCLUDE`, `GTEST_LIB` and `GTEST_MAIN` definitions.

```bash
mkdir build
cd build
cmake -DGTEST_INCLUDE= -DGTEST_LIB= -DGTEST_MAIN= ..
```

`GTEST_INCLUDE` is location where gtest headers are stored. This directory should contain gtest folder with header files so that path to `#include ` is resolved.

`GTEST_LIB` points out for gtest library where all of gtest functionality is implemented.

`GTEST_MAIN` points out for gtest main library where entry point for running test is implemented. Size of this library is little. This library provides `int main` entry point to run tests.