summaryrefslogtreecommitdiff
path: root/share/hackvr/examples/chess/board.sh
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2019-02-06 04:55:26 -0600
committerepoch <epoch@hacking.allowed.org>2019-02-06 04:55:26 -0600
commitfcd31e10d00ae7459b084584c513dc3ab8d62d0e (patch)
treee2cb1807056735804805ec0040c275efab1548e0 /share/hackvr/examples/chess/board.sh
parentc45f918c635ea6f8d947f5e7bb7f646656c89b30 (diff)
parent30bfb25dceedcc0ad84b06194856edb28297ba83 (diff)
downloadhackvr-fcd31e10d00ae7459b084584c513dc3ab8d62d0e.tar.gz
hackvr-fcd31e10d00ae7459b084584c513dc3ab8d62d0e.zip
merged some derpage I did on the wrong branch in the wrong copy of the repo
Diffstat (limited to 'share/hackvr/examples/chess/board.sh')
-rwxr-xr-xshare/hackvr/examples/chess/board.sh28
1 files changed, 21 insertions, 7 deletions
diff --git a/share/hackvr/examples/chess/board.sh b/share/hackvr/examples/chess/board.sh
index 5848c98..dc3fb3b 100755
--- a/share/hackvr/examples/chess/board.sh
+++ b/share/hackvr/examples/chess/board.sh
@@ -1,16 +1,29 @@
#!/usr/bin/env bash
+e=$1 #elevation of board
width=8
height=8
cols="a b c d e f g h"
+printf "junk set camera.r.x -45\n"
+
for x in $(seq 1 $width);do
for y in $(seq 1 $height);do
color=$[((($y % 2) + ($x % 2))%2)+16]
### board is on the wall. draw in x and y.
-# printf "%s%s addshape %s 4 %s %s 0 %s %s 0 %s %s 0 %s %s 0\n" $(printf "%s\n" "$cols" | cut '-d ' -f$x) $y $color $x $y $[x+1] $y $[x+1] $[y+1] $x $[y+1]
+# printf "%s%s addshape %s 4 %s %s %s %s %s %s %s %s %s %s %s %s\n" \
+# $(printf "%s\n" "$cols" | cut '-d ' -f$x) $y $color \
+# $x $y $e \
+# $[x+1] $y $e \
+# $[x+1] $[y+1] $e \
+# $x $[y+1] $e
### board is on floor. draw in x and z.
- printf "%s%s addshape %s 4 %s 0 %s %s 0 %s %s 0 %s %s 0 %s\n" $(printf "%s\n" "$cols" | cut '-d ' -f$x) $y $color $x $y $[x+1] $y $[x+1] $[y+1] $x $[y+1]
+ printf "%s%s addshape %s 4 %s %s %s %s %s %s %s %s %s %s %s %s\n" \
+ $(printf "%s\n" "$cols" | cut '-d ' -f$x) $y $color \
+ $x $e $y \
+ $[x+1] $e $y \
+ $[x+1] $e $[y+1] \
+ $x $e $[y+1]
done
done
@@ -25,16 +38,17 @@ for x in $(seq $width);do
locat="$(printf "%s\n" "$cols" | cut '-d ' "-f$x")$y"
cat "./pieces/pawn" | sed 's/^[^ ][^ ]* addshape [0-9][0-9]* /piece_'"${locat}"' addshape '"$(printf "%s\n" "$color" | cut '-d ' "-f$y")"' /g'
### board is on wall. use x and y.
-# printf "piece_%s move %s %s 0\n" "$locat" "$x" "$y"
+# printf "piece_%s move %s %s %s\n" "$locat" "$x" "$y" "$e"
### board is on floor. use x and z.
- printf "piece_%s move %s 0 %s\n" "$locat" "$x" "$y"
+ printf "piece_%s move %s %s %s\n" "$locat" "$x" "$e" "$y"
done
for y in 1 8;do
locat="$(printf "%s\n" "$cols" | cut '-d ' "-f$x")$y"
- cat "./pieces/$(printf "%s\n" "$row1" | cut '-d ' "-f$x")" | sed 's/^[^ ][^ ]* addshape [0-9][0-9]* /piece_'"${locat}"' addshape '"$(printf "%s\n" "$color" | cut '-d ' "-f$y")"' /g'
+ cat "./pieces/$(printf "%s\n" "$row1" | cut '-d ' "-f$x")" \
+ | sed 's/^[^ ][^ ]* addshape [0-9][0-9]* /piece_'"${locat}"' addshape '"$(printf "%s\n" "$color" | cut '-d ' "-f$y")"' /g'
### board is on wall. use x and y.
-# printf "piece_%s move %s %s 0\n" "$locat" "$x" "$y"
+# printf "piece_%s move %s %s %s\n" "$locat" "$x" "$y" "$e"
### board is on floor. use x and z.
- printf "piece_%s move %s 0 %s\n" "$locat" "$x" "$y"
+ printf "piece_%s move %s %s %s\n" "$locat" "$x" "$e" "$y"
done
done