Content added Content deleted
imported>mutante m (Created page with '<pre> #!/bin/bash # "Weltraumrennen" in Bash - Linux Magazin 03/11 Listing 2 - S.113 pos=40 width=80 while true; do read -t1 -s -n1 x case "$x" in g) pos=$(($pos - 1)) ;…') |
(No difference)
|
Latest revision as of 10:34, 15 February 2011
#!/bin/bash # "Weltraumrennen" in Bash - Linux Magazin 03/11 Listing 2 - S.113 pos=40 width=80 while true; do read -t1 -s -n1 x case "$x" in g) pos=$(($pos - 1)) ;; h) pos=$(($pos +1 )); esac for ((i=0; i < $width; i++)) do if [ $i -eq $pos ]; then echo -n 'V' elif [ $(($RANDOM % 9)) -eq 0 ]; then echo -n '*' else echo -n ' ' fi done echo done