#!/bin/bash
# little script that launches text ASCII games located and installed in /usr/games
# Allows the user to choose between a list of the games and whether game is completed quits
# writte by hip0
# http://www.pc-freak.net
# Licensed under GPLv3

trap playgame INT 
playgame () {
echo -n "Available Games";
ls /usr/games
echo "type 'exit' to quit";
echo -n "Choose Game:"
read game
ls /usr/games
if [ -f "/usr/games/$game" ]; then
/usr/games/$game
echo "$date run $gate" >> /var/log/ascii_games.txt
fi

if [ "$game" == "exit" ]; then
exit
#exit 0;
fi

exit 0;
}
playgame;
