# SED accelerated racing game shell script with bash enhancements. # Copyright (C) 2000 Jan Hubicka # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #!/bin/sh clear trap 'left="$left 1";signal=true' 3 trap 'right="$right 1";signal=true' 2 ulimit -c 0 stty -echo quit  echo "High score:" head -n 22 <~/.shscore signal=false echo $signal echo " .----. Copyright (C) 2000 Jan Hubicka .----." echo " ,-' \`-- ,-' \`--" echo "\`\`\`\`\`\`\`\`\`--o------o-' \`\`\`\`\`\`\`\`\`--o------o-'" while [ $signal = false ] do /bin/echo -e -n " oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO Press ^C to continue oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO\r" /bin/echo -e -n " Oo.oOo.oOo.oOo.oOo.oOo.oOo.oOo Press ^C to continue Oo.oOo.oOo.oOo.oOo.oOo.oOo.oOo\r" /bin/echo -e -n " o.oOo.oOo.oOo.oOo.oOo.oOo.oOo. Press ^C to continue o.oOo.oOo.oOo.oOo.oOo.oOo.oOo.\r" /bin/echo -e -n " .oOo.oOo.oOo.oOo.oOo.oOo.oOo.o Press ^C to continue .oOo.oOo.oOo.oOo.oOo.oOo.oOo.o\r" done street=" |.........$.........| " destreet=" |...................| " for x in 1 2 3 4 5 6 7 8 9 do echo "$destreet" done echo " SH-car bash version 1.0 ^Z-left ^C-right" if [ "$RANDOM" == "" ] ; then echo " (Requires BASH to be funny)" fi for x in 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 20 21 22 223 do echo "$destreet" done echo -e -n " |---------3---------| \a\r" sleep 1 echo -e -n " |---------2---------| \a\r" sleep 1 echo -e -n " |---------1---------| \a\r" sleep 1 echo -e -n " |-------------------| \a\a\a\a\a\a\r" signal=fase left="" right="" echo & start=$! while true do while true do while [ 1 = 1 ] do sedcmd="" n=0; while [[ $n -lt 10000 ]]; do a=""; n=$((n+1)); done case $RANDOM in 10*) sedcmd=$sedcmd's/[\\|\||\/]/|/g;s/[\\|\||\/][^ ]/ \\/g' ;; *[1-3]) case $street in " "*) sedcmd=$sedcmd'sX [\\|\||\/]X\/\.Xg;sX[^ ][\\|\||\/]X\/ Xg' ;; esac ;; *[4-6]) case $street in " "*) ;; *" ") sedcmd=$sedcmd'sX[\\|\||\/] X.\\Xg;sX[\\|\||\/][^ ]X \\Xg' ;; esac ;; *) sedcmd=$sedcmd's/[\\|\||\/]/|/g' ;; esac for name in $left do #echo left sedcmd=$sedcmd';s/.\$/\$\./g' done left="" for name in $right do sedcmd=$sedcmd';s/\$./\.\$/g' done right="" bstreet=$street bdestreet=$destreet signal=true while [ $signal = true ] do signal=false street=$bstreet destreet=$bdesreet street=`echo "${street}" | sed -e "$sedcmd"` destreet=`sed 's/\\$/\\./g' <>~/.shscore sort -n -r ~/.shscore >~/.shscore.$$ mv ~/.shscore.$$ ~/.shscore head <~/.shscore echo "Press enter to continue" read blb exit ;; esac done done done