Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help coding the following? Create a new pokerCard object named myStarterCard. Apply the shift() method to the cards array of myDeck to store the

Need help coding the following?

Create a new pokerCard object named myStarterCard. Apply the shift() method to the cards array of myDeck to store the first card from the deck in myStarterCard. Change the srcattribute of the newCard inline image by calling the cardImage() method for the myStarterCard object.

my js:

"use strict";

/*

New Perspectives on HTML5, CSS3, and JavaScript 6th Edition

Tutorial 14

Review Assignment

Author:

Date:

Filename: ag_squares.js

*/

window.addEventListener("load", playPokerSquares);

function playPokerSquares() {

var newCard = document.getElementById("newCard");

var startButton = document.getElementById("startButton");

var rowSumCells = document.querySelectorAll("table#grid th.rowsum");

var colSumCells = document.querySelectorAll("table#grid th.colsum");

var cardImages = document.querySelectorAll("table#grid tr td img");

var gameScore = document.getElementById("gameScore");

var gameResult = document.getElementById("gameResult");

}

// sets up the game

startButton.addEventListener("click", function() {

squareGame.gameTotal = 0;

squareGame.gameScore = "";

squareGame.gameResult = "";

for ( var i =0; i

rowSumCells, colSumCells[i] = '';

}

for ( var i =0; i

}

// method to randomly sort the deck

this.shuffle = function(){

this.cards.sort(function) {

return 0.5 - math.random();

})

// create a new deck of cards and shuffle it

var myDeck = new pockerDeck();

myDeck.shuffle();

console.log(myDeck);

});

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems Uropean Conference Adbis 2020 Lyon France August 25 27 2020 Proceedings Lncs 12245

Authors: Jerome Darmont ,Boris Novikov ,Robert Wrembel

1st Edition

3030548317, 978-3030548315

More Books

Students also viewed these Databases questions

Question

Modeling Communication

Answered: 1 week ago

Question

Solve the integral:

Answered: 1 week ago

Question

What is meant by Non-programmed decision?

Answered: 1 week ago

Question

What are the different techniques used in decision making?

Answered: 1 week ago

Question

1. Which position would you take?

Answered: 1 week ago