> go-fish.html > > html > > body Go Fish Game 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 24 2222222222222223 33 Go Fish Your Cards: CPU's Cards: Ask for a Rank: Ask CPU Game starting... 25 26 27 28 Restart Game 29 30 31 JS go-fish.js X JS pig-game.js JS go-fish.js > [] ranks <> go-fish.html 1 // Card deck setup 2 const suits = ["Hearts", "Diamonds", "Clubs", "Spades"]; 3 const ranks = 4 "2" 5 "3" 6 7 8 9 "7" 10 "8" 11 "9" 12 13 14 15 16 17 18 ]; "10", "Jack" "Queen" "King", "Ace" 19 let deck = []; 20 let humanHand = []; 21 let cpuHand = []; 24 25 #2 ± 9922222222222222332mm let isHumanTurn = true; // DOM Elements const humanHandEl = document.getElementById("human-hand"); 26 const cpuHandEl = document.getElementById("cpu-hand"); 27 const gameLogEl = document.getElementById("game-log"); 28 const askBtn = document.getElementById("ask-btn"); const rankInput = document.getElementById("card-rank"); 30 31 // Load sounds const drawSound = new Audio("sounds/draw.mp3"); const winSound = new Audio("sounds/win.mp3"); 34 const shuffleSound = new Audio("sounds/shuffle.mp3"); 35 36 37 // Function to create and shuffle the deck function createDeck() { 38 deck = [];

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 7PE
icon
Related questions
Question

I have attached my code, under I want you to show me how to enhance it and make it more cooler and better in graphics with following the instructions. 

> go-fish.html > > html > > body
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Go Fish Game</title>
<link rel="stylesheet" href="style.css" />
1
2
3
4
5
6
7
8
</head>
9
<body>
10
11
12
13
14
15
16
17
18
19
20
21
24
2222222222222223
33
<h1>Go Fish </h1>
<div class="scoreboard">
<p>Your Cards:</p>
<div id="human-cards" class="card-container"></div>
<p>CPU's Cards:</p>
<div id="cpu-cards" class="card-container"></div>
</div>
<div class="controls">
<label for="card-rank">Ask for a Rank:</label>
<input type="text" id="card-rank" placeholder="e.g., 7, Ace, King" />
<button id="ask-btn">Ask CPU</button>
</div>
<div class="log" id="game-log" >Game starting...</div>
25
26
27
28
<button id="restart-btn">Restart Game </button>
29
30
31
<script src="go-fish.js"></script>
</body>
</html>
Transcribed Image Text:> go-fish.html > > html > > body <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Go Fish Game</title> <link rel="stylesheet" href="style.css" /> 1 2 3 4 5 6 7 8 </head> 9 <body> 10 11 12 13 14 15 16 17 18 19 20 21 24 2222222222222223 33 <h1>Go Fish </h1> <div class="scoreboard"> <p>Your Cards:</p> <div id="human-cards" class="card-container"></div> <p>CPU's Cards:</p> <div id="cpu-cards" class="card-container"></div> </div> <div class="controls"> <label for="card-rank">Ask for a Rank:</label> <input type="text" id="card-rank" placeholder="e.g., 7, Ace, King" /> <button id="ask-btn">Ask CPU</button> </div> <div class="log" id="game-log" >Game starting...</div> 25 26 27 28 <button id="restart-btn">Restart Game </button> 29 30 31 <script src="go-fish.js"></script> </body> </html>
JS go-fish.js X JS pig-game.js
JS go-fish.js > [] ranks
<> go-fish.html
1
// Card deck setup
2
const suits = ["Hearts", "Diamonds", "Clubs", "Spades"];
3 const ranks =
4
"2"
5
"3"
6
7
8
9
"7"
10
"8"
11
"9"
12
13
14
15
16
17
18
];
"10",
"Jack"
"Queen"
"King",
"Ace"
19 let deck = [];
20 let humanHand = [];
21 let cpuHand = [];
24
25
#2 ± 9922222222222222332mm
let isHumanTurn = true;
// DOM Elements
const humanHandEl = document.getElementById("human-hand");
26 const cpuHandEl = document.getElementById("cpu-hand");
27 const gameLogEl = document.getElementById("game-log");
28 const askBtn = document.getElementById("ask-btn");
const rankInput = document.getElementById("card-rank");
30
31 // Load sounds
const drawSound = new Audio("sounds/draw.mp3");
const winSound = new Audio("sounds/win.mp3");
34 const shuffleSound = new Audio("sounds/shuffle.mp3");
35
36
37
// Function to create and shuffle the deck
function createDeck() {
38
deck = [];
Transcribed Image Text:JS go-fish.js X JS pig-game.js JS go-fish.js > [] ranks <> go-fish.html 1 // Card deck setup 2 const suits = ["Hearts", "Diamonds", "Clubs", "Spades"]; 3 const ranks = 4 "2" 5 "3" 6 7 8 9 "7" 10 "8" 11 "9" 12 13 14 15 16 17 18 ]; "10", "Jack" "Queen" "King", "Ace" 19 let deck = []; 20 let humanHand = []; 21 let cpuHand = []; 24 25 #2 ± 9922222222222222332mm let isHumanTurn = true; // DOM Elements const humanHandEl = document.getElementById("human-hand"); 26 const cpuHandEl = document.getElementById("cpu-hand"); 27 const gameLogEl = document.getElementById("game-log"); 28 const askBtn = document.getElementById("ask-btn"); const rankInput = document.getElementById("card-rank"); 30 31 // Load sounds const drawSound = new Audio("sounds/draw.mp3"); const winSound = new Audio("sounds/win.mp3"); 34 const shuffleSound = new Audio("sounds/shuffle.mp3"); 35 36 37 // Function to create and shuffle the deck function createDeck() { 38 deck = [];
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning