Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with this Assignment. Any help is appreciated. You can use notepad++ for editplus for this. You also need to use an HTML validator

Need help with this Assignment. Any help is appreciated. You can use notepad++ for editplus for this. You also need to use an HTML validator to see if theres any errors. I have the code already -You just have to put it together for me.

Use this at the beginning of the file:

Use this at the end of the file:

Here's what the output should look like:

image text in transcribed

Link for html validator: https://validator.w3.org/#validate_by_input

Heres my code below: put it all together

Poker

doCalculations.js

function getSuit(){

var suit=[0,0,0,0,0];

var number=[0,0,0,0,0];

var index=0;

while(index!=5){

var s = Math.floor(Math.random()*4);

var n = Math.floor(Math.random()*13)+1;

var found = false;

for(var i=0;i

if(suit[i]==s && number[i]==n ){

found = true;

}

}

if(!found){

suit[index] = s;

number[index] = n;

index+=1;

}

}

var suitString="";

var numberString="";

for(var i=0;i

if(number[i]==1){

numberString = "A";

}else if(number[i]==11){

numberString = "J";

}else if(number[i]==12){

numberString = "Q";

}else if(number[i]==13){

numberString = "K";

}else {

numberString = number[i];

}

if(suit[i]==0){

suitString = "♥";

document.getElementById("h"+i).style.color = "red";

}else if(suit[i]==1){

suitString = "♦";

document.getElementById("h"+i).style.color = "red";

}else if(suit[i]==2){

suitString = "♣";

document.getElementById("h"+i).style.color = "black";

}else if(suit[i]==3){

suitString = "♠";

document.getElementById("h"+i).style.color = "black";

}

document.getElementById("h"+i).innerHTML = numberString+suitString;

}

}

Poker colocalhost/2.html Assignment #2 (Poker)

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

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions