Subj : A new project
To : Andrew Haworth
From : Sean Dennis
Date : Mon May 07 2018 06:28 pm
Hello Andrew,
07 May 18 18:13 at you wrote to me:
AH> That sounds really cool. What did the game do?
Check out
http://outpostbbs.net/cheepware.html -- look for "The Magic Oracle".
All of my doors are DOS right now. However, when the dust settles for me
personally (I am in the middle of a ninety-day probation period in a new job),
I'm very close to finishing up a working Linux-based Pascal doorkit. I have
released doors that run under Linux in a beta form but they are not true doors
as they don't monitor time online nor use a FOSSIL but instead use stdio under
Linux.
Here's the "door" if you're wondering. The ANSWERS.DAT file is just a simple
text files with a single line per answer.
The codes in the output lines are just ANSI color codes that are "bash-ified".
=== Cut ===
#!/bin/bash
FILE=answers.dat
if [ ! -f "$FILE" ]
then
echo "ANSWERS.DAT not found!"
echo "Program aborting."
exit 1
fi
clear
echo -e "\e[92mThe Magic Oracle/BASH"
echo -e "\e[36mWritten by and (C)2017 Sean Dennis."
echo
echo -e "\e[96mWhat is your question for the Oracle?\e[37m"
read QUESTION
echo
echo -e "\e[92mYour question was:"
echo -e "\e[37m$QUESTION"
echo
echo -e "\e[95mAfter consulting the Oracle, his answer is...\e[33m"
# Pick and display a random line in ANSWERS.DAT.
sort --random-sort $FILE | head -n 1
echo -e "\e[39m"
=== Cut ===
The real trick is in the second to the last line. ;)
Later,
Sean
... A verbal contract isn't worth the paper it's written on.
--- GoldED+/LNX 1.1.5-b20170303
* Origin: Outpost BBS * Limestone, TN, USA (1:18/200)