I created this thread so people can show some interesting games made using scripting languages.
The basic rules are:
- The code must be in a scripting language, be it bash, perl, lua, python, or whatever you can think of.
- The code must fit in a single post. You are not allowed to split the game into multiple posts or add attachments.
- Also related to the above rule, the less lines the better.
- The code you post here must be written by you, and by making it available here you put it in the public domain.
That's about it I think.
Heres one to get you started.
Code: Select all
#! /bin/sh
ntries=0;
targetnum=$(((RANDOM%10)+1));
while [ $ntries -lt 10 ]; do
echo -n "Type a number between 1 and 10 inclusive:";
read num;
test "$num" || exit;
num=$((num));
ntries=$((ntries+1));
if [ "$num" -eq $targetnum ]; then
echo "Congrats pal! You got it in $ntries attempts!";
exit;
elif [ "$((num))" -gt $targetnum ]; then
echo "Target number is lower.";
else
echo "Target number is higher.";
fi
done
echo "You didn't make it in 10 attempts...";