Small snake game in C
Commit 294521773ddf
tarball5 files changed+61-5
@@ -1 +1,2 @@
11
snake2
+build@@ -4,12 +4,24 @@ project(snake C)
44
55
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})66
7
+include(FetchContent)8
+9
+FetchContent_Declare(10
+ jag_parse11
+ GIT_REPOSITORY https://codeberg.org/Jaglekon/jag_parse.git12
+ GIT_TAG v1.1.013
+)14
+15
+FetchContent_MakeAvailable(jag_parse)16
+717
add_executable(snake818
source/main.c919
source/logic.c1020
source/draw.c1121
)1222
23
+target_link_libraries(snake PRIVATE jag_parse)24
+1325
target_compile_options(snake PRIVATE1426
$<$<CONFIG:Debug>:-Wall -Wextra -Wpedantic>1527
)@@ -1,5 +1,23 @@
11
{22
"nodes": {3
+ "jag-parse": {4
+ "inputs": {5
+ "nixpkgs": "nixpkgs"6
+ },7
+ "locked": {8
+ "lastModified": 1787944495,9
+ "narHash": "sha256-EDasKwNIx2w2L51toJgGpJvtnb906UdFlx+S8WIs/Go=",10
+ "ref": "refs/heads/main",11
+ "rev": "677d9ec0386139f175763a1b4877c857e68f8db5",12
+ "revCount": 8,13
+ "type": "git",14
+ "url": "https://codeberg.org/Jaglekon/jag_parse.git"15
+ },16
+ "original": {17
+ "type": "git",18
+ "url": "https://codeberg.org/Jaglekon/jag_parse.git"19
+ }20
+ },321
"nixpkgs": {422
"locked": {523
"lastModified": 1787498568,@@ -16,9 +34,26 @@
1634
"type": "github"1735
}1836
},37
+ "nixpkgs_2": {38
+ "locked": {39
+ "lastModified": 1787498568,40
+ "narHash": "sha256-9i/VTdusq/+NM/tz+J1Re+ojkMB8MBf0QshnYfzHz30=",41
+ "owner": "NixOS",42
+ "repo": "nixpkgs",43
+ "rev": "56c02bc00adcf003215cc4bd996d6efaf4cff188",44
+ "type": "github"45
+ },46
+ "original": {47
+ "owner": "NixOS",48
+ "ref": "nixos-unstable",49
+ "repo": "nixpkgs",50
+ "type": "github"51
+ }52
+ },1953
"root": {2054
"inputs": {21
- "nixpkgs": "nixpkgs"55
+ "jag-parse": "jag-parse",56
+ "nixpkgs": "nixpkgs_2"2257
}2358
}2459
},@@ -3,14 +3,18 @@
33
44
inputs = {55
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";6
+7
+ jag-parse.url = "git+https://codeberg.org/Jaglekon/jag_parse.git";68
};79
810
outputs = {911
self,12
+ jag-parse,1013
nixpkgs,1114
}: let1215
system = "x86_64-linux";1316
pkgs = import nixpkgs {inherit system;};17
+ jag-parse-lib = jag-parse.packages.${system}.default;1418
in {1519
packages.${system}.default = pkgs.stdenv.mkDerivation {1620
pname = "snake";@@ -20,10 +24,13 @@
2024
2125
buildPhase = ''2226
$CC \23
- main.c \24
- draw.c \25
- logic.c \26
- -o snake27
+ main.c \28
+ draw.c \29
+ logic.c \30
+ -I${jag-parse-lib}/include \31
+ -L${jag-parse-lib}/lib \32
+ -ljag_parse \33
+ -o snake2734
'';2835
2936
installPhase = ''@@ -1,4 +1,5 @@
11
#include "snake.h"2
+//#include <jag_parse.h>23
34
45
int main(int argc, char *args[]) {