v1.01 Improved code for SetQ array
This commit is contained in:
parent
8292462ebe
commit
6327c8444f
14
matches.sh
14
matches.sh
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
## matches.sh
|
## matches.sh
|
||||||
## version 1.0
|
## version 1.01
|
||||||
## Matches is based on a two player game from the trenches of World War One.
|
## Matches is based on a two player game from the trenches of World War One.
|
||||||
|
|
||||||
## Author: Ze'ev Schurmann
|
## Author: Ze'ev Schurmann
|
||||||
|
@ -129,16 +129,20 @@ function drawFlame {
|
||||||
function burnMatches {
|
function burnMatches {
|
||||||
if [[ $1 = "A" ]]; then
|
if [[ $1 = "A" ]]; then
|
||||||
local q=${#setA[@]}
|
local q=${#setA[@]}
|
||||||
local setQ=($(echo ${setA[@]}))
|
#local setQ=($(echo ${setA[@]}))
|
||||||
|
local setQ=( "${setA[@]}" )
|
||||||
elif [[ $1 = "B" ]]; then
|
elif [[ $1 = "B" ]]; then
|
||||||
local q=${#setB[@]}
|
local q=${#setB[@]}
|
||||||
local setQ=($(echo ${setB[@]}))
|
#local setQ=($(echo ${setB[@]}))
|
||||||
|
local setQ=( "${setB[@]}" )
|
||||||
elif [[ $1 = "C" ]]; then
|
elif [[ $1 = "C" ]]; then
|
||||||
local q=${#setC[@]}
|
local q=${#setC[@]}
|
||||||
local setQ=($(echo ${setC[@]}))
|
#local setQ=($(echo ${setC[@]}))
|
||||||
|
local setQ=( "${setC[@]}" )
|
||||||
elif [[ $1 = "D" ]]; then
|
elif [[ $1 = "D" ]]; then
|
||||||
local q=${#setD[@]}
|
local q=${#setD[@]}
|
||||||
local setQ=($(echo ${setD[@]}))
|
#local setQ=($(echo ${setD[@]}))
|
||||||
|
local setQ=( "${setD[@]}" )
|
||||||
fi
|
fi
|
||||||
local played="false"
|
local played="false"
|
||||||
while [[ ${played} == "false" ]]; do
|
while [[ ${played} == "false" ]]; do
|
||||||
|
|
Loading…
Reference in New Issue