RainbowRoad1/Cgame
Free一些用C编写的小游戏, 14行贪吃蛇 22行2048 22行俄罗斯方块 25行扫雷...以及各种小玩意
About RainbowRoad1/Cgame
Cgame is an open-source collection of classic games written in the C programming language, created by GitHub user RainbowRoad1. The project emphasizes achieving maximum functionality with minimal code, featuring implementations such as a 14-line snake game, 22-line Tetris, 22-line 2048, and 24-line minesweeper. All games use no third-party libraries and are intended to run on Windows, though code can be adapted for other platforms. The repository offers multiple versions per game—tiny (minimal code with formatting), chaos (extreme compression to 80 characters per line), color (with console colors), and others—making it a versatile resource for learning C programming, code golf, and game development. The project is licensed under MIT and is accompanied by tutorial videos on Bilibili.
Key Features
Pros & Cons
- Extremely short game code (e.g., 5-line snake chaos version) demonstrates impressive compression
- High playability despite minimal lines; games are fully functional
- Educational resource: shows clever C tricks and optimizations
- Multiple versions allow learners to compare different approaches (compact vs. readable)
- Open source under MIT license with no third-party dependencies
- Windows-only for direct execution (though code can be adapted)
- Some code uses C99 features, which may not compile on older compilers without -std=c99 flag
- Reported compilation warnings (e.g., _sleep() in Visual Studio) requiring manual workarounds
- Repository organization described by author as 'messy' with multiple versions and outdated files
- Author states they no longer wish to maintain the project; updates are unlikely