1
0
Disbranĉigi 0

Optimized rendering (43 seconds to 20)

This commit is contained in:
Jaidyn Ann 2017-03-27 07:04:52 -05:00
parent 6dc5e41ecb
commit 8c2e679bee
3 changed files with 32 additions and 5 deletions

View File

@ -1,2 +1,10 @@
# unixchesscollection # unixchesscollection
UCC - A POSIX chess game that adheres to the Unix philosophy UCC - A POSIX chess game that adheres to the Unix philosophy
Don't expect much just yet.
Roadmap (in order):
* JSON interpreter read support
* Rendering chess game JSON files
* Move validation
* JSON interpreter write support
* Move writing
* Wrapper script

2
lib

@ -1 +1 @@
Subproject commit c347eb502beb52b63868f36051c0aa913f59a715 Subproject commit e68ded350c8dc035b3be24a7eb5688393b3b02d2

View File

@ -13,11 +13,30 @@ do
while [ $widthi -ne $width ] while [ $widthi -ne $width ]
do do
widthi=$((widthi+1)) widthi=$((widthi+1))
piece=$(lib/json.sh -s ${widthi},${heighti}/piece $file) if grep "${widthi},${heighti}" $file > /dev/null
team=$(lib/json.sh -s ${widthi},${heighti}/team $file)
text=$(lib/json.sh -s ${team}/pieces/${piece}/text $file)
if [ -z $text ]
then then
point_data=$(sh lib/json.sh $file | grep board/pieces/${widthi},${heighti}/ | grep =)
point_data=$(echo $point_data | sed 's/ = /=/g' | sed 's/ /^/g')
echo $point_data
string_one=$(echo $point_data | sed 's/.*^//')
echo $string_one
string_two=$(echo $point_data | sed 's/^.*//')
echo $string_two
if echo $string_one | grep team=
then
team=$string_one
piece=$string_two
elif echo $string_one | grep piece=
then
piece=$string_one
team=$string_two
fi
echo $string_one
echo $string_two
echo $piece
echo $team
text=$(sh lib/json.sh -s ${team}/pieces/${piece}/text $file)
else
text=" " text=" "
fi fi
if [ $(echo "$heighti % 2" | bc) -eq 1 ] if [ $(echo "$heighti % 2" | bc) -eq 1 ]