const getRadioValue = () => {
const radioBtns = document.getElementsByName("difficulty");
let result;
radioBtns.forEach(radio => {
if (radio.checked) {
result = radio.value;
}
});
return parseInt(result);
};
const shuffleCards = (cards) => {
for (let i = cards.length - 1; i > 0; i--) {
let j = Math.floor(Math.random() * (i + 1));
let temp = cards[i];
cards[i] = cards[j];
cards[j] = temp;
}
return cards;
};
const colorsArray = [
'#CD5C5C', '#CD5C5C', '#DC143C', '#DC143C',
'#FF0000', '#FF0000', '#8B0000', '#8B0000',
'#FFC0CB', '#FFC0CB', '#FF69B4', '#FF69B4',
'#C71585', '#C71585', '#DB7093', '#DB7093',
'#FFA07A', '#FFA07A', '#FF8C00', '#FF8C00',
'#FFFF00', '#FFFF00', '#FFFACD', '#FFFACD',
'#F0E68C', '#F0E68C', '#D8BFD8', '#D8BFD8',
'#3CB371', '#3CB371', '#40E0D0', '#40E0D0',
'#9370DB', '#9370DB', '#9932CC', '#9932CC',
'#6A5ACD', '#6A5ACD', '#D2691E', '#D2691E',
'#000000', '#000000', '#C0C0C0', '#C0C0C0',
'#191970', '#191970', '#ADFF2F', '#ADFF2F',
'#FFFF00', '#FFFF00', '#0000FF', '#0000FF' ,
'#FF00FF', '#FF00FF', '#BC8F8F', '#BC8F8F',
'#B8860B', '#B8860B', '#A52A2A', '#A52A2A',
'#D2B48C', '#D2B48C', '#00FF7F', '#00FF7F'
];
let card = new CardClass();
card.createBoard();