summaryrefslogtreecommitdiffstats
path: root/cholerab/max_dirty_hack.sh
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2013-06-07 00:46:36 +0200
committermakefu <github@syntax-fehler.de>2013-06-07 00:46:36 +0200
commit83baf76c734a5c9471fd9ab4dd90c952aba4e6a0 (patch)
treef2c429cb79f7f3937e43130a50241a2e7c81950b /cholerab/max_dirty_hack.sh
parentb0273180da89e11cd6a7346ed1a72e9f17fbf230 (diff)
parent5a428d4646b73f16b890f6c089a67dbc710df533 (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'cholerab/max_dirty_hack.sh')
-rwxr-xr-xcholerab/max_dirty_hack.sh102
1 files changed, 0 insertions, 102 deletions
diff --git a/cholerab/max_dirty_hack.sh b/cholerab/max_dirty_hack.sh
deleted file mode 100755
index 7183a760..00000000
--- a/cholerab/max_dirty_hack.sh
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/bin/sh
-stty -echo cbreak -ofdel
-x_max=90
-y_max=10
-x_cur=1
-y_cur=1
-y=
-t=1
-outputfile=/tmp/cholerab_out
-inputfile=/tmp/cholerab_in
-echo -n "c"
-
-while [ $t -lt $(( y_max+2 )) ];do
- echo -e "[$t;$(( x_max+1 ))Hx"
- t=$(( t+1 ))
-done
-t=1
-while [ $t -lt $(( x_max+2 )) ];do
- echo -e "[$(( y_max+1 ));${t}Hx"
- t=$(( t+1 ))
-done
-
-echo -n "[$y_cur;${x_cur}H"
-#Main Loop
-while x="`dd bs=1 count=1 2>/dev/null`"; do
- y="$y$x"
- case "$y" in
- (*"")
- if [[ $y_cur -le 1 ]];then
- y_cur=$y_max
- echo -n "[$y_cur;${x_cur}H"
- else
- echo -n ""
- y_cur=$(( y_cur-1 ))
- fi
- y=
- ;;
- (*"")
- if [[ $y_cur -ge $y_max ]];then
- y_cur=1
- echo -n "[$y_cur;${x_cur}H"
- else
- echo -n ""
- y_cur=$(( y_cur+1 ))
- fi
- y=
- ;;
- (*"")
- if [[ $x_cur -ge $x_max ]];then
- x_cur=1
- echo -n "[$y_cur;${x_cur}H"
- else
- echo -n ""
- x_cur=$(( x_cur+1 ))
- fi
- y=
- ;;
- (*"")
- if [[ $x_cur -le 1 ]];then
- x_cur=$x_max
- echo -n "[$y_cur;${x_cur}H"
- else
- echo -n ""
- x_cur=$(( x_cur-1 ))
- fi
- y=
- ;;
- (*"")
- if [[ $x_cur -le 1 ]];then
- x_cur=$x_max
- echo -n "[$y_cur;${x_cur}H"
- else
- echo -n " "
- x_cur=$(( x_cur-1 ))
- fi
- y=
- ;;
- (|\[)
- :
- ;;
- (*)
- if [[ $x_cur -ge $x_max ]];then
- x_cur=1
- echo -n "[$y_cur;${x_cur}H"
- else
- echo -n "$x"
- echo "<0 $x $x_cur $y_cur>" >> $outputfile
- x_cur=$(( x_cur+1 ))
- fi
- y=
- ;;
- esac
- while [[ -s $inputfile ]]; do
- cat $inputfile | head -n 1 | sed 's,[<>],,g' | { read MODE CHAR XN YN ; echo -n "7[$YN;${XN}H$CHAR8"; }
- sed -i -e "1d" $inputfile
- done
-
- state=`echo -n "$x" | od -An -tx | tr -d "[$IFS]"`
- echo -n "7[1;$(( x_max+2 ))H$state8"
- echo -n "7[2;$(( x_max+2 ))H 8"
- echo -n "7[2;$(( x_max+2 ))H$x_cur:$y_cur8"
-done