: ' Changes
Fri Jan 30 2026 Added Nethack
Thu Jan 29 2026 Added slots
Thu Jan 29 2026 Added iyhat
Mon Jun 02 2025 Added nethack
Sat Mar 22 2025 Added TUI Battleship
Tue Mar 04 2025 fixed list output
'
trap "continue" 2
[ "$1" == "-D" ] && DEBUG=1 && shift 1
DATE=$(date +"%a %b %d")
PS4='$SECONDS $LINENO: '
OS=$(uname -s)
NAME=${0##*/}
TMOUT=60
export PATH=/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin:$PATH
R=$(tput setaf 1)
BR=$(tput setaf 1; tput bold)
G=$(tput setaf 2)
BG=$(tput setaf 2; tput bold)
Y=$(tput setaf 3)
BY=$(tput setaf 3; tput bold)
B=$(tput setaf 4)
BM=$(tput setaf 5; tput bold)
BC=$(tput setaf 6; tput bold)
BL=$(tput setaf 7; tput bold)
BLD=$(tput bold)
N=$(tput sgr0)
SIT=$(tput sitm)
RIT=$(tput ritm)
UL=$(tput smul)
NL=$(tput rmul)
RV=$(tput rev)
html(){
vim -f +"syn on" +"set nonu" +"set foldenable!" +"set nospell" +"run! syntax/2html.vim" +"wq" +"q" $1
}
pause(){
echo " "
echo -n "Hit any key to continue: "
read -n 1 x
}
xtitle(){
[ "$DEBUG" == "1" ] && set -x
printf "\033]0;${*}🌀${HOSTNAME}\007"
}
log(){
[ "$DEBUG" == "1" ] && set -x
logger -i -t "$NAME" "$*"
}
version(){
grep -E '^# Updated' $0
echo " "
sed -n "/' Changes/,/^ *$/p" <$0 |grep -E -v 'sed -n|exit 0|}'
exit 0
}
if [ "$1" == "-E" ]
then
vim $0
sed -i -e "7s/.*/# Updated....: $(date)/" $0
log "Updated $0"
html $0
cp $0 /var/www/unix
mv $0.html /var/www/unix
log "Updated $0"
exit
fi
if [ "$1" == "-v" ] || [ "$1" == "--version" ]
then
version
fi
command -v klondike2 >/dev/null || wget http://crn.hopto.org/unix/klondike2
command -v boxes >/dev/null || sudo apt install boxes -yy
command -v rogue >/dev/null || sudo apt install bsdgames-nonfree -yy
command -v nettoe >/dev/null || sudo apt install nettoe -yy
command -v freesweep >/dev/null || sudo apt install freesweep -yy
command -v vitetris >/dev/null || sudo apt install vitetris -yy
command -v ninvaders >/dev/null || sudo apt install ninvaders
command -v nethack >/dev/null || sudo apt install nethack-console
[ "$DEBUG" == "1" ] && set -x
while :
do
if [ $# -lt 1 ]
then
clear
xtitle "Games"
echo "-[ ${UL}Games${NL} ]-${N}
${BY}$(fclock)${BC}
2. 🎴 Blackjack
b. 🟠 Backgammon
B. 🚢 TUI Battleship
h. 🤓 Hangman
i. 👾 Invaders
k. 🎴 Klondike
m. 💣 Minesweeper
n. ⚔️ Nethack
p. 🎴 Poker
r. 🏹 Roguelike (Nethack or BSD rogue)
s. 🎴 Solitaire
S. 🎰 Slots
t. 🔳 Tetris
T. 🔖 Tic-Tac-Toe
y. 🎲 Yahtzee
w. 🔍 Word Search
$([ -d ~/Windows ] && echo 'W. 🪟 Windows games')
${UL} ${NL}
${BR}q. Quit${N}
"
read -p Selection: -n 1 CHOICE
else
CHOICE=$(echo "$1" |cut -d'-' -f2)
[ "$1" == "-E" ] && CHOICE=E
fi
case $CHOICE in
b)
xtitle "🟠 Backgammon"
clear
echo $BC
/usr/games/backgammon -n -w
echo ${N}
;;
B)
clear
cd ~/bin/bs-2.13 && ./bs
cd -
clear
;;
2)
xtitle "🎴 21"
cd ~/bin/blackjack-py
python3 blackjack.py
cd -
;;
h)
xtitle "🤓 Hangman"
clear
echo "${Y}"
/usr/games/hangman -d ~/etc/words.txt
echo ${N}
;;
i)
xtitle "👾 Ninvaders"
ninvaders
;;
k)
xtitle "🎴 Klondike"
klondike2
;;
l)
clear
if [ -d ~/Windows ]
then
grep ') #' $0| egrep -v '[q!=*]'| sed 's/^[ \t]*//'|tr -d ')#' |grep -v grep | /home/mitch/.local/bin/tte -R
else
grep ') #' $0| egrep -v '[q!=*]|Windows'| sed 's/^[ \t]*//'|tr -d ')#' |grep -v grep | /home/mitch/.local/bin/tte -R
fi
;;
m)
xtitle "💣 Minesweeper"
minesweeper
;;
n)
nethack
pause
;;
p)
xtitle "🎴 Poker"
clear
videopoker -mh
pause
;;
r)
xtitle "🏹 Rogue"
clear
echo "$BC"
cd ~/etc
if [ -f rogue.save ]
then
vim -c RogueRestore -c :q!
else
vim -c Rogue -c :q!
fi
if [ -f rogue.save ]
then
ft "Game saved!"
else
ft "RIP fallen hero!"
fi
sleep 3
;;
s)
xtitle "🎴 Solitaire"
cd ~/bin/csol-master && ./csol 2>/dev/null
cd - >/dev/null
;;
S)
~/bin/slots
pause
;;
t)
xtitle "🔳 Tetris"
clear
vitetris
pause
;;
T)
xtitle "🔖 tic-tac-toe"
clear
nettoe
clear
;;
y)
xtitle "🎲 Yahtzee"
clear;echo ${BC}
iyaht
pause
;;
q)
clear
ft Bye
echo -e "\n"
exit
;;
w)
xtitle "🔍 Word Search"
clear
cd ~/bin/wordsearch-master
./wordsearch -t black 2>/dev/null
./wordsearch -s
pause
cd -
;;
W)
xtitle "🪟 Windows games"
cd ~/Windows
CHOICE=$(\ls -F| grep '*$' |tr -d '*' |fzf --ansi --reverse --color fg:-1,bg:-1,hl:46,fg+:40,bg+:233,hl+:46 --color prompt:166,border:46 --height 70% --border=sharp --prompt="➤ " --pointer="➤ " --marker="➤ ");
clear
echo -n "Now playing: $CHOICE "
spinit ./${CHOICE}
cd -
clear
;;
!)
clear
echo "${C}Hit return with no command to end.${N}"
while :
do
echo -n "[menu] $PWD $ "
read EXEC
[ -z "$EXEC" ] && break
eval "$EXEC"
done
pause
;;
=)
reset
exec $0
;;
*)
xtitle "🌘 Screen saver"
xs
;;
esac
[ $# -eq 1 ] && exit
done