aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQiang Guo <bigdragonsoft@gmail.com>2024-10-25 20:39:55 +0000
committerRobert Clausecker <fuz@FreeBSD.org>2024-10-28 12:41:57 +0000
commit18c77415cbe281f35cfba61905305e0706dad3bd (patch)
tree862a99daabf339c54197b350af9cb74cae28d7ed
parent81ed0d1cd3c1e31c8da0ae323c6c6d8ba4efd5ed (diff)
games/mastermind: traditional console-based mastermind game
This is a traditional console-based Mastermind game. The rules are as follows: 1. The game will generate a 4-digit color/number code 2. The range of colors/numbers is from 1 to 8 3. The player has 10 chances to guess the code 4. After each guess, the system will provide hints: - Green plus sign (+) indicates both color and position are correct - Red minus sign (-) indicates the color is correct but the position is wrong 5. The player needs to gradually guess the correct code based on the hints 6. During the game, you can enter 'r' at any time to switch display mode (color blocks/numbers) 7. During the game, you can enter 'q' at any time to exit the game WWW: https://github.com/bigdragonsoft/mastermind
-rw-r--r--games/Makefile1
-rw-r--r--games/mastermind/Makefile27
-rw-r--r--games/mastermind/distinfo3
-rw-r--r--games/mastermind/pkg-descr11
4 files changed, 42 insertions, 0 deletions
diff --git a/games/Makefile b/games/Makefile
index f1374694258d..9b56d520fed1 100644
--- a/games/Makefile
+++ b/games/Makefile
@@ -613,6 +613,7 @@
SUBDIR += mangband
SUBDIR += marblemarcher
SUBDIR += mari0
+ SUBDIR += mastermind
SUBDIR += masterserver
SUBDIR += maxr
SUBDIR += meandmyshadow
diff --git a/games/mastermind/Makefile b/games/mastermind/Makefile
new file mode 100644
index 000000000000..6c44e78d3d47
--- /dev/null
+++ b/games/mastermind/Makefile
@@ -0,0 +1,27 @@
+PORTNAME= mastermind
+DISTVERSION= 0.1.0
+CATEGORIES= games
+
+MAINTAINER= bigdragonsoft@gmail.com
+COMMENT= Traditional console-based Mastermind game
+WWW= https://github.com/bigdragonsoft/mastermind
+
+LICENSE= BSD3CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+USE_GITHUB= yes
+GH_ACCOUNT= bigdragonsoft
+
+CFLAGS+= -std=c99
+
+PLIST_FILES= bin/mastermind \
+ share/man/man6/mastermind.6.gz
+
+do-build:
+ ${CC} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -o ${WRKSRC}/mastermind ${WRKSRC}/mastermind.c ${LIBS}
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/mastermind ${STAGEDIR}${PREFIX}/bin/
+ ${INSTALL_MAN} ${WRKSRC}/mastermind.6 ${STAGEDIR}${PREFIX}/share/man/man6/
+
+.include <bsd.port.mk>
diff --git a/games/mastermind/distinfo b/games/mastermind/distinfo
new file mode 100644
index 000000000000..9b7189c5c3d6
--- /dev/null
+++ b/games/mastermind/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1729888458
+SHA256 (bigdragonsoft-mastermind-0.1.0_GH0.tar.gz) = 88d3ea65b8b2a7c1089cd429e5c9d817c56428140be91527991c7968f967753b
+SIZE (bigdragonsoft-mastermind-0.1.0_GH0.tar.gz) = 87698
diff --git a/games/mastermind/pkg-descr b/games/mastermind/pkg-descr
new file mode 100644
index 000000000000..3b0feac91fc8
--- /dev/null
+++ b/games/mastermind/pkg-descr
@@ -0,0 +1,11 @@
+This is a traditional console-based Mastermind game. The rules are as follows:
+1. The game will generate a 4-digit color/number code
+2. The range of colors/numbers is from 1 to 8
+3. The player has 10 chances to guess the code
+4. After each guess, the system will provide hints:
+ - Green plus sign (+) indicates both color and position are correct
+ - Red minus sign (-) indicates the color is correct but the position is wrong
+5. The player needs to gradually guess the correct code based on the hints
+6. During the game, you can enter 'r' at any time to switch display mode
+ (color blocks/numbers)
+7. During the game, you can enter 'q' at any time to exit the game