I am currently trying to make Solitare for a school project and have run into an issue of trying to make a counter for the suit piles. The way I am currently trying to do this is by defining a global variable like is shown below:
var Hpilecount = "01";
var Dpilecount = "01";
var Spilecount = "01";
var Cpilecount = "01";
and I am trying to refer to this variable as is shown below:
function movecard(id) {
console.log(id[0]+pilecount);
}
How can I combine the element of the varible id and something to refer to these variables.
Thanks for the help