1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

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
This commit is contained in:
Qiang Guo 2024-10-26 04:39:55 +08:00 committed by Robert Clausecker
parent 81ed0d1cd3
commit 18c77415cb
4 changed files with 42 additions and 0 deletions

View File

@ -613,6 +613,7 @@
SUBDIR += mangband
SUBDIR += marblemarcher
SUBDIR += mari0
SUBDIR += mastermind
SUBDIR += masterserver
SUBDIR += maxr
SUBDIR += meandmyshadow

27
games/mastermind/Makefile Normal file
View File

@ -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>

View File

@ -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

View File

@ -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