#!/bin/bash
 
cd /media/fat/Interactive_Fiction/xyppy-master
#python -m xyppy /media/fat/Interactive_Fiction/InfocomGames/Zork 1 - The Great Underground Empire (1981)/Zork1.z3

# ----------------------------------
# function
# ----------------------------------
pause(){
  read -p "Press [Enter] key to continue..." fackEnterKey
}

one(){
	python -m xyppy /media/fat/Interactive_Fiction/InfocomGames/Zork\ 1\ -\ The\ Great\ Underground\ Empire\ \(1981\)/Zork1.z3
}

two(){
python -m xyppy /media/fat/Interactive_Fiction/InfocomGames/Zork\ 2\ -\ The\ Wizard\ of\ Frobozz\ \(1981\)/Zork2.z3
}

three(){
#        python -m xyppy /media/fat/Interactive_Fiction/InfocomGames/The\ Hitch\ Hikers\ Guide\ To\ The\ Galaxy\ \(1987\)/Hitchhik.z5
	python -m xyppy /media/fat/Interactive_Fiction/InfocomGames/Zork\ 3\ -\ The\ Dungeon\ Master\ \(1982\)/Zork3.z3
}
four(){
	python -m xyppy /media/fat/Interactive_Fiction/InfocomGames/Beyond\ Zork\ -\ The\ Coconut\ of\ Quendor\ \(1987\)/BeyondZo.z5	
}
five(){
       python -m xyppy /media/fat/Interactive_Fiction/InfocomGames/Suspect/Suspect.z3
}
six(){
	python -m xyppy /media/fat/Interactive_Fiction/InfocomGames/Leather\ Goddesses\ of\ Phobos\ \(1986\)/Leather.z3
}
seven(){
        python -m xyppy /media/fat/Interactive_Fiction/InfocomGames/The\ Hitch\ Hikers\ Guide\ To\ The\ Galaxy\ \(1987\)/Hitchhik.z5     
}
eight(){
        python -m xyppy /media/fat/Interactive_Fiction/InfocomGames/Enchanter\ \(1983\)/Enchante.z3
}

nine(){
        python -m xyppy /media/fat/Interactive_Fiction/InfocomGames/Planetfall\ \(1983\)/Planetfa.z3
}

ten(){
        python -m xyppy /media/fat/Interactive_Fiction/InfocomGames/The\ Lurking\ Horror\ \(1984\)/Lurking.z3
}



 
# Menu display
show_menus() {
	clear
	echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"	
	echo " Z-Code Interperter - M E N U"
	echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
	echo "1. Zork 1 - The Great Underground Empire (1981) "
	echo "2. Zork 2 - The Wizard of Frobozz (1981)"
	echo "3. Zork 3 - The Dungeon Master (1982)"
	echo "4. Beyond Zork - The Coconut of Quendor (1987)"
	echo "5. Suspect (1984)"
	echo "6. Leather Goddesses of Phobos (1986)"
	echo "7. Hitch Hikers Guide to the Galaxy (1987)"
	echo "8. Enchanter (1983)"
	echo "9. Planetfall (1983)"
	echo "10. The Lurking Horror (1984)"
	echo "e. Exit"
}
# read input from the keyboard and take a action
read_options(){
	local choice
	read -p "Enter choice [ 1 - 10] " choice
	case $choice in
		1) one ;;
		2) two ;;
		3) three ;;
		4) four ;;
		5) five ;;
		6) six ;;
		7) seven ;;
		8) eight ;;
		9) nine ;;
		10) ten ;;
		e) exit 0;;
		*) echo -e "${RED}Error...${STD}" && sleep 2
	esac
}
 
# ----------------------------------------------
# Trap CTRL+C, CTRL+Z and quit signal
# ----------------------------------------------
trap '' SIGINT SIGQUIT SIGTSTP
 
# -----------------------------------
# Main loop
# ------------------------------------
while true
do
 
	show_menus
	read_options
done
