Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
nitt
- Posts: 218
- Joined: 22 Apr 2011 02:43
#1
Post
by nitt » 28 Sep 2011 14:48
Because Batch is Windows, and then Linux and Mac both use Bash. Which isn't
too different. But I think it would just be neat to have this.
OR.
A section for suggesting ideas.
Code: Select all
#!/bin/bash
function getRan {
ran=$(($RANDOM % $1 + 1));
}
function check {
input=$(($input));
if [ $input \> $ran ]; then
echo "Too high!";
fi
if [ $input \< $ran ]; then
echo "Too low!";
fi
if [ $input == $ran ]; then
echo "Correct!";
read -p "Press return to continue . . .";
getRan 100;
clear;
fi
start;
}
function start {
read input;
check $input;
start;
}
getRan 100;
start;
-
Rileyh
- Posts: 147
- Joined: 01 Sep 2011 03:54
- Location: Perth, Western Australia
#2
Post
by Rileyh » 02 Nov 2011 19:00
This is a batch forum, not a bash forum. Go to a linux forum and then post this there. They might actually want to have it.