From 6327c8444f575377277de3184102d295eece070a Mon Sep 17 00:00:00 2001 From: Ze'ev Schurmann Date: Wed, 18 Dec 2024 12:37:46 +0200 Subject: [PATCH] v1.01 Improved code for SetQ array --- matches.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/matches.sh b/matches.sh index 2d61e49..178b95e 100644 --- a/matches.sh +++ b/matches.sh @@ -1,7 +1,7 @@ #!/bin/bash ## matches.sh -## version 1.0 +## version 1.01 ## Matches is based on a two player game from the trenches of World War One. ## Author: Ze'ev Schurmann @@ -129,16 +129,20 @@ function drawFlame { function burnMatches { if [[ $1 = "A" ]]; then local q=${#setA[@]} - local setQ=($(echo ${setA[@]})) + #local setQ=($(echo ${setA[@]})) + local setQ=( "${setA[@]}" ) elif [[ $1 = "B" ]]; then local q=${#setB[@]} - local setQ=($(echo ${setB[@]})) + #local setQ=($(echo ${setB[@]})) + local setQ=( "${setB[@]}" ) elif [[ $1 = "C" ]]; then local q=${#setC[@]} - local setQ=($(echo ${setC[@]})) + #local setQ=($(echo ${setC[@]})) + local setQ=( "${setC[@]}" ) elif [[ $1 = "D" ]]; then local q=${#setD[@]} - local setQ=($(echo ${setD[@]})) + #local setQ=($(echo ${setD[@]})) + local setQ=( "${setD[@]}" ) fi local played="false" while [[ ${played} == "false" ]]; do