diff --git a/README.md b/README.md index 9c131a4..06def9f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ # unixchesscollection 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 diff --git a/lib b/lib index c347eb5..e68ded3 160000 --- a/lib +++ b/lib @@ -1 +1 @@ -Subproject commit c347eb502beb52b63868f36051c0aa913f59a715 +Subproject commit e68ded350c8dc035b3be24a7eb5688393b3b02d2 diff --git a/render.sh b/render.sh index 7df8925..ef7749f 100644 --- a/render.sh +++ b/render.sh @@ -13,11 +13,30 @@ do while [ $widthi -ne $width ] do widthi=$((widthi+1)) - piece=$(lib/json.sh -s ${widthi},${heighti}/piece $file) - team=$(lib/json.sh -s ${widthi},${heighti}/team $file) - text=$(lib/json.sh -s ${team}/pieces/${piece}/text $file) - if [ -z $text ] + if grep "${widthi},${heighti}" $file > /dev/null 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=" " fi if [ $(echo "$heighti % 2" | bc) -eq 1 ]