summaryrefslogtreecommitdiff
path: root/share/hackvr/examples/chess
diff options
context:
space:
mode:
authorepoch <epoch@thebackupbox.net>2022-08-17 21:34:02 -0500
committerepoch <epoch@thebackupbox.net>2022-08-17 21:34:02 -0500
commit6492ba6b4107a4da228e18db4fc5fc871bfb0579 (patch)
tree11301c4e20d9a1448337e73b62a16ab1bfeba457 /share/hackvr/examples/chess
parent49d54d7582bdcbdcff5637e72e9f29bb5cc571bd (diff)
downloadhackvr-6492ba6b4107a4da228e18db4fc5fc871bfb0579.tar.gz
hackvr-6492ba6b4107a4da228e18db4fc5fc871bfb0579.zip
updated README to show that everything that got deleted went to an -extras repo. also, hackvr script updated to be better bashHEADmaster
Diffstat (limited to 'share/hackvr/examples/chess')
-rwxr-xr-xshare/hackvr/examples/chess/board.sh54
-rw-r--r--share/hackvr/examples/chess/camera.pos2
-rwxr-xr-xshare/hackvr/examples/chess/gnuchess-to-hackvr.sh32
-rwxr-xr-xshare/hackvr/examples/chess/hackvr-to-gnuchess.sh18
-rw-r--r--share/hackvr/examples/chess/pieces/bishop2
-rw-r--r--share/hackvr/examples/chess/pieces/king2
-rw-r--r--share/hackvr/examples/chess/pieces/knight2
-rw-r--r--share/hackvr/examples/chess/pieces/pawn1
-rw-r--r--share/hackvr/examples/chess/pieces/queen1
-rw-r--r--share/hackvr/examples/chess/pieces/rook1
-rwxr-xr-xshare/hackvr/examples/chess/run5
11 files changed, 0 insertions, 120 deletions
diff --git a/share/hackvr/examples/chess/board.sh b/share/hackvr/examples/chess/board.sh
deleted file mode 100755
index dc3fb3b..0000000
--- a/share/hackvr/examples/chess/board.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/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 %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 %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
-
-row8="rook knight bishop queen king bishop knight rook"
-row1="$row8"
-
-color="19 19 0 0 0 0 20 20"
-
-#draw pawns. triangles.
-for x in $(seq $width);do
- for y in 2 7;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 %s\n" "$locat" "$x" "$y" "$e"
-### board is on floor. use x and z.
- 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'
-### board is on wall. use x and 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 %s %s\n" "$locat" "$x" "$e" "$y"
- done
-done
diff --git a/share/hackvr/examples/chess/camera.pos b/share/hackvr/examples/chess/camera.pos
deleted file mode 100644
index 32433c2..0000000
--- a/share/hackvr/examples/chess/camera.pos
+++ /dev/null
@@ -1,2 +0,0 @@
-epoch move 5 5 -6
-derp set global.zoom 60
diff --git a/share/hackvr/examples/chess/gnuchess-to-hackvr.sh b/share/hackvr/examples/chess/gnuchess-to-hackvr.sh
deleted file mode 100755
index 841389b..0000000
--- a/share/hackvr/examples/chess/gnuchess-to-hackvr.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-e=$1
-tee /dev/stderr | while read first second third;do
- if [ "_$first" = "_feature" ];then
- printf "# just gnuchess saying what features it has: %s %s %s\n" "$first" "$second" "$third" >&2
- elif printf "%s\n" "$first" | grep '^[0-9][0-9]*\.$' >/dev/null 2>&1;then
- #we made a successful move.
- ### how to tell hackvr to move the piece now? $second should contain what the move was.
- printf "# Hey! Hackvr! do this move: %s\n" "$second" >&2
- if [ "_$second" = "_..." ];then #computer/other person made a move.
- move=$third
- else
- move=$second
- fi
- from=$(printf "%s\n" "$move" | fold -w1 | head -n2 | tr -d '\n')
- to=$(printf "%s\n" "$move" | fold -w1 | tail -n+3 | head -n2 | tr -d '\n')
- x=$(echo "a b c d e f g h" | tr ' ' '\n' | grep -n "$(printf "%s\n" "$to" | fold -w1 | head -n1)" | cut -d: -f1)
- y=$(printf "%s\n" "$to" | fold -w1 | tail -n1)
- magic=$(printf "%s\n" "$move" | fold -w1 | tail -n+5 | tr -d '\n')
-### if the board is on the wall we need to use x and y
-# printf "piece_%s move %s %s %s\n" "$from" "$x" "$y" "$e" | tee /dev/stderr
-### the board is on the floor atm. use x and z
- printf "piece_%s move %s %s %s\n" "$from" "$x" "$e" "$y" | tee /dev/stderr
-
- printf "#delete the old piece_%s group\n"
- printf "epoch deletegroup piece_%s\n" "$to"
- printf "epoch renamegroup piece_%s piece_%s\n" "$from" "$to" | tee /dev/stderr
- else
- #something else.
- printf "oops. something else happened. let's see: %s %s %s\n" "$first" "$second" "$third" >&2
- fi
-done
diff --git a/share/hackvr/examples/chess/hackvr-to-gnuchess.sh b/share/hackvr/examples/chess/hackvr-to-gnuchess.sh
deleted file mode 100755
index 94cd1ab..0000000
--- a/share/hackvr/examples/chess/hackvr-to-gnuchess.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-part1=""
-echo "sleeping 3 seconds. might have gnuchess less likely to not do anything." >&2
-sleep 3
-echo "protover 2"
-while read derp command target extra;do
- if [ "_$command" = "_action" ];then
- if printf "%s\n" "$target" | grep -v "^piece_" 2>&1 > /dev/null;then #we are ignoring clicks on pieces in favor of squares atm. when full 3d probably want pieces.
- if [ "_$part1" = "_" ];then
- part1=$target
- else
- #we have two parts. let's tell gnuchess!
- printf "%s%s\n" $part1 $target
- part1=""
- fi
- fi
- fi
-done
diff --git a/share/hackvr/examples/chess/pieces/bishop b/share/hackvr/examples/chess/pieces/bishop
deleted file mode 100644
index db6f144..0000000
--- a/share/hackvr/examples/chess/pieces/bishop
+++ /dev/null
@@ -1,2 +0,0 @@
-rook addshape 4 4 .4 .1 0 .6 .1 0 .6 .9 0 .4 .9 0
-rook addshape 4 4 .3 .6 0 .7 .6 0 .7 .8 0 .3 .8 0
diff --git a/share/hackvr/examples/chess/pieces/king b/share/hackvr/examples/chess/pieces/king
deleted file mode 100644
index 8ca79ef..0000000
--- a/share/hackvr/examples/chess/pieces/king
+++ /dev/null
@@ -1,2 +0,0 @@
-king addshape 4 4 .1 .7 0 .3 .9 0 .9 .3 0 .7 .1 0
-king addshape 4 4 .3 .1 0 .9 .7 0 .7 .9 0 .1 .3 0
diff --git a/share/hackvr/examples/chess/pieces/knight b/share/hackvr/examples/chess/pieces/knight
deleted file mode 100644
index adc7f53..0000000
--- a/share/hackvr/examples/chess/pieces/knight
+++ /dev/null
@@ -1,2 +0,0 @@
-knight addshape 4 4 .1 .1 0 .3 .1 0 .3 .9 0 .1 .9 0
-knight addshape 4 4 .1 .1 0 .9 .1 0 .9 .3 0 .1 .3 0
diff --git a/share/hackvr/examples/chess/pieces/pawn b/share/hackvr/examples/chess/pieces/pawn
deleted file mode 100644
index d7d2d29..0000000
--- a/share/hackvr/examples/chess/pieces/pawn
+++ /dev/null
@@ -1 +0,0 @@
-pawn addshape 4 3 .2 .1 0 .8 .1 0 .5 .5 0
diff --git a/share/hackvr/examples/chess/pieces/queen b/share/hackvr/examples/chess/pieces/queen
deleted file mode 100644
index 3ebb4ab..0000000
--- a/share/hackvr/examples/chess/pieces/queen
+++ /dev/null
@@ -1 +0,0 @@
-pawn addshape 4 3 .2 .1 0 .8 .1 0 .5 .9 0
diff --git a/share/hackvr/examples/chess/pieces/rook b/share/hackvr/examples/chess/pieces/rook
deleted file mode 100644
index 2550eb5..0000000
--- a/share/hackvr/examples/chess/pieces/rook
+++ /dev/null
@@ -1 +0,0 @@
-rook addshape 4 4 .4 .1 0 .6 .1 0 .6 .9 0 .4 .9 0
diff --git a/share/hackvr/examples/chess/run b/share/hackvr/examples/chess/run
deleted file mode 100755
index 1168044..0000000
--- a/share/hackvr/examples/chess/run
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-export elevation=0
-mknod p p
-stdbuf -oL cat camera.pos <(./board.sh $elevation) <(cat p | ./gnuchess-to-hackvr.sh $elevation) | hackvr "$USER" | ./hackvr-to-gnuchess.sh | gnuchess -x > p
-rm p