// Calculate the power score of the deck var total_cards = card_a_count + card_b_count + card_c_count + ramp_count + draw_count + removal_count + wipe_count + synergy_count; var total_cmc = (1 * card_a_count) + (2 * card_b_count) + (3 * card_c_count); var avg_cmc = total_cmc / total_cards; var ramp_score = ramp_count / total_cards; var draw_score = draw_count / total_cards; var removal_score = removal_count / total_cards; var wipe_score = wipe_count / total_cards; var synergy_score = Math.sqrt(synergy_count) / total_cards; var power_score = (avg_cmc * 2) + (ramp_score * 5) + (draw_score * 5) + (removal_score * 3) + (wipe_score * 3) + (synergy_score * 10);
// Display the power score on the page document.getElementById('power_score').innerHTML = 'The power score of the deck is ' + power_score.toFixed(2) + '.'; }