]> git.gir.st - VIper.git/commitdiff
rename to 'viper', new makefile master github/master
authorgirst <girst@users.noreply.github.com>
Sat, 2 Feb 2019 16:49:43 +0000 (17:49 +0100)
committergirst <girst@users.noreply.github.com>
Sat, 2 Feb 2019 16:49:43 +0000 (17:49 +0100)
Makefile
README.md
schemes.h
viper.c [moved from viiper.c with 98% similarity]
viper.h [moved from viiper.h with 97% similarity]

index c4cb5b54e241c1bf838cf2b4bfcb469e5340912a..03389b5a1e42484a4b31e6cde801a4c54c577f64 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,11 @@
 .PHONY: all clean
-all: viiper
 
-viiper: viiper.c viiper.h schemes.h
-       gcc viiper.c -o viiper -g
+CFLAGS := -Wall -Wextra -pedantic -std=c99
+
+all: viper
+
+viper: viper.c viper.h schemes.h
+       $(CC) $(CFLAGS) $< -o $@
 
 clean:
-       rm -f viiper
+       rm -f viper
index 8aa0aaace0b7804f8c1e3bf009f2c425beee37ce..1015a2d316a309b912dce2212d1260b2ae4d1388 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,13 +1,12 @@
-# VIIper - a Snake Clone for Unicode-compatible Terminals
+# VIper - a Snake Clone for Unicode-compatible Terminals
 
 terminal + emoji = snek    
 🖳 + 💩 = 🐍
 
 ## Requirements
 
-You'll need either a terminal emulator with good Unicode (Emoji) support and a
-compatible fonts to fully enjoy the graphics of this game. This is what I'd
-recommend:
+You'll need a terminal emulator with good Unicode (Emoji) support and compatible
+fonts to fully enjoy the graphics of this game. This is what I'd recommend:
 
  - A VTE based terminal (like GNOME Terminal and a whole bunch of others)
  - Google Noto's Color Emoji Font (Fedora: `google-noto-emoji-color-fonts.noarch`)
index f3ba53c8353643a6f2f54fa25be1e8752692d712..3de34c09817152d88ccc981d8d82759931eacbb1 100644 (file)
--- a/schemes.h
+++ b/schemes.h
@@ -1,7 +1,7 @@
 #ifndef __SCHEMES_H__
 #define __SCHEMES_H__
 
-#include "viiper.h" /* for enum items */
+#include "viper.h" /* for enum items */
 
 #define BORDER_T 0
 #define BORDER_C 1
similarity index 98%
rename from viiper.c
rename to viper.c
index 0cc1424e94db2d5db6e969f106b798ad73fa9095..f8c8e011e91c5d3ef61dc3f1025ecff1b91e7a61 100644 (file)
--- a/viiper.c
+++ b/viper.c
@@ -1,15 +1,15 @@
 /*******************************************************************************
- viiper 0.1
- By Tobias Girstmair, 2018
+ viper 0.2
+ By Tobias Girstmair, 2018 - 2019
 
- ./viiper 40x25
- (see ./viiper -h for full list of options)
+ ./viper 40x25
+ (see ./viper -h for full list of options)
 
  KEYBINDINGS:  - hjkl to move
                - p to pause and resume
                - r to restart
                - q to quit
-               - (see `./minesviiper -h' for all keybindings)
+               - (see `./viper -h' for all keybindings)
 
  GNU GPL v3, see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt
 *******************************************************************************/
@@ -27,7 +27,7 @@
 #include <time.h>
 #include <unistd.h>
 
-#include "viiper.h"
+#include "viper.h"
 #include "schemes.h"
 
 #define MIN(a,b) (a>b?b:a)
@@ -139,7 +139,7 @@ restart:
        switch (sigsetjmp(game_over, 1)) {
        case GAME_INIT:
        case GAME_START:
-               viiper();
+               viper();
                break; /* function doesn't return, but `-Wextra' complains */
        case GAME_OVER:
                end_screen_msg = " GAME  OVER ";
@@ -167,7 +167,7 @@ quit:
        return 0;
 }
 
-int viiper(void) {
+int viper(void) {
        init_snake();
        show_playfield ();
        g.d = EAST;
@@ -192,6 +192,7 @@ int viiper(void) {
                case 'p': pause_game(); break;
                case 'r': siglongjmp(game_over, GAME_START);
                case 'q': siglongjmp(game_over, GAME_EXIT);
+               case'\\': {static int _;spawn_item(BONUS,_++%NUM_BONI,NULL);}break;
                case CTRL_'L':
                        screen_setup(1);
                        show_playfield();
similarity index 97%
rename from viiper.h
rename to viper.h
index 5c83fd1823cca17fc4ce2c9b0d0ae96f9e3214bc..5e4f4aae51713c521d475d6b6523703cda587799 100644 (file)
--- a/viiper.h
+++ b/viper.h
@@ -1,5 +1,5 @@
-#ifndef __VIIPER_H__
-#define __VIIPER_H__
+#ifndef __VIPER_H__
+#define __VIPER_H__
 
 #define SHORTHELP "%s [OPTIONS] [FIELDSIZE]\n"
 #define LONGHELP \
@@ -72,7 +72,7 @@ enum game_state {
        GAME_EXIT,
 };
 
-int viiper(void);
+int viper(void);
 void snake_advance (void);
 void spawn_item (int type, int value, struct item* p_item);
 void consume_item (struct item* i);
Imprint / Impressum