summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2017-11-25 21:52:48 -0600
committerepoch <epoch@hacking.allowed.org>2017-11-25 21:52:48 -0600
commit35ed48987d5511e4df4bd90e0f69303678f5c476 (patch)
tree87727b368f18509a325c91e8b00b9cc6a0693a5b
parent9deee5b1917b6f644261d040a1832a14369a567f (diff)
downloadhackvr-35ed48987d5511e4df4bd90e0f69303678f5c476.tar.gz
hackvr-35ed48987d5511e4df4bd90e0f69303678f5c476.zip
made the local-tictactoe use the same script as the multiplayer
-rw-r--r--tictactoe/board4
-rwxr-xr-xtictactoe/run23
2 files changed, 4 insertions, 23 deletions
diff --git a/tictactoe/board b/tictactoe/board
index a6e4ed9..80401a9 100644
--- a/tictactoe/board
+++ b/tictactoe/board
@@ -1,4 +1,6 @@
-junk set global.zoom 64
+junk set global.zoom 16
+
+_reset addshape 3 -4 -4 4 -5 -4 4 -4 -5 4
topleft addshape 4 -3 3 4 -1 3 4 -1 1 4 -3 1 4
topcenter addshape 4 -1 3 4 1 3 4 1 1 4 -1 1 4
diff --git a/tictactoe/run b/tictactoe/run
index 73655dd..c38c9cc 100755
--- a/tictactoe/run
+++ b/tictactoe/run
@@ -1,25 +1,4 @@
#!/bin/bash
turn=$( expr $RANDOM % 2)
echo "go. player: $turn"
-stdbuf -oL cat board p | ../src/hackvr_x11 "$USER" \
- | stdbuf -oL uniq \
- | grep --line-buffered clicked \
- | stdbuf -oL cut '-d ' -f5 | while read group;do
- if grep "_" <<<$group >/dev/null;then
-# xmessage "CUT IT OUT"
- echo CUT IT OUT > /dev/stderr
- else
- turn=$(expr \( $turn + 1 \) % 2)
- printf "# turn: %d\n" "$turn" > /dev/stderr
- printf "$USER deletegroup %s\n" "$group"
- printf "$USER deletegroup %s\n" "$group" > /dev/stderr
-#need to get the first point of the group clicked and translate the new shape by that much
- translatex="$(grep "$group" board | grep -v '^#' | tr -s ' ' | cut '-d ' -f4)"
- translatey="$(grep "$group" board | grep -v '^#' | tr -s ' ' | cut '-d ' -f5)"
- cat "marker$turn"
- printf "%s move %s %s 0\n" "_marker" "$(expr "$translatex")" "$(expr "$translatey" - 2 )"
- printf "%s move %s %s 0\n" "_marker" "$(expr "$translatex")" "$(expr "$translatey" - 2 )" >/dev/stderr
- grep "$group" board | sed "s/$group/_marker2/g"
- printf "%s renamegroup _marker _marker%s%s\n" "$USER" "$(date +%s)" "$RANDOM"
- fi
- done > p
+stdbuf -oL cat board p | ../src/hackvr_x11 "$USER" | ./game.sh > p