Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #set is used to set variables, and assist in debugging
- #set -vx
- #keys are wasd
- w(){
- clear
- echo -e "Moving Forward\n"
- }
- a(){
- clear
- echo -e "Turning Left\n"
- }
- s(){
- clear
- echo -e "Going Back\n"
- }
- d(){
- clear
- echo -e "Turning right\n"
- }
- while true; do
- echo "w=go forward a=go left s=back d=go right"
- read -rsn1 input
- if [ "$input" = "w" ]; then
- w
- elif [ "$input" = "a" ]; then
- a
- elif [ "$input" = "s" ]; then
- s
- elif [ "$input" = "d" ]; then
- d
- else
- echo -e"something went wrong:\n" $input
- exit
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement