diff --git a/pong.sh b/pong.sh index 7cb49fb..441497c 100755 --- a/pong.sh +++ b/pong.sh @@ -1,8 +1,12 @@ #!/bin/sh -#STTY='-icanon -pendin -echo' make textpong if [ $? == 0 ]; then - stty -icanon -pendin -echo - ./textpong + if [[ $OSTYPE == darwin* ]] ; then + STTY='-icanon -pendin -echo' ./textpong + else + stty -icanon -echo + ./textpong + stty icanon echo + fi fi diff --git a/textpong.c b/textpong.c index 05a6369..f28b01f 100644 --- a/textpong.c +++ b/textpong.c @@ -43,7 +43,7 @@ 1 <= (x - bar_x) && (x - bar_x) < 7)) vy = -vy; if (y == 20) score++; } - flag = 1 - flag; + flag = !flag; usleep(60000); } printf("\n**** GAME OVER ****\n");