A Pen by Eric LeRay

Developer
Size
2,039 Kb
Views
22,264

How do I make an a pen by eric leray?

What is a a pen by eric leray? How do you make a a pen by eric leray? This script and codes were developed by Eric LeRay on 12 July 2022, Tuesday.

A Pen by Eric LeRay Previews

A Pen by Eric LeRay - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>A Pen by Eric LeRay</title>
</head>
<body> <html lang="en">
<head> <title>Battleship</title> <meta charset="utf-8">
</head>
<body> <h1>Play Battleship!</h1> <script src="battleship.js"></script>
</body </html> <script src="js/index.js"></script>
</body>
</html>

A Pen by Eric LeRay - Script Codes JS Codes

var max = prompt("How big would you like the game?");
var location2Generator = false
var location3Generator = false
var locations = []
var location1 = Math.floor(Math.random() * (max - 0) + 0);
var guess;
var hits = 0;
var guesses = 0;
var guessesMade = [ ];
var isSunk = false;
break;
locations.push(location1);
alert(locations);
var location2 = Math.floor(Math.random() * (max - 0) + 0);
locations.push(location2);
alert(locations);
while (location2Generator == false){ if (locations.indexOf(location2) > -1) { locations.splice(1,1); location2 = Math.floor(Math.random() * max); locations.push(location2); }else{ location2Generator = true; }
}
alert(locations);
var location3 = Math.floor(Math.random() * max);
locations.push(location3);
alert(locations);
while (location3Generator == false){ if (locations.indexOf(location3) > -1) { locations.splice(2,1); location3 = Math.floor(Math.random() * max); locations.push(location3); }else{ location3Generator = true; }
}
alert(locations);
var guess;
var hits = 0;
var guesses = 0;
var guessesMade = [ ];
var isSunk = true;
while (isSunk == false) { guess = prompt("Ready, aim, fire! (enter a number from 0-6) :"); if (guess = "break"){ break; } if (guess <0 || guess > max || guessesMade.indexOf(guess) > -1) { alert("Pelase enter a valid number!"); guesses = guesses + 1; } else { alert(guessesMade); guesses = guesses + 1; if (locations.indexOf(guess) > -1) { alert("HIT!!!"); guessesMade.push(guess); hits = hits + 1; if (hits == 3) { isSunk = true; alert("You sank my battleship!!!"); } } else { alert("MISS"); } } }
alert('FAT SPIDERMAN');
window.location.href = 'http://codepen.io/acheron9865/pen/jAzrpA?editors=0010';
var stats = "You took " + guesses +" guesses to sink the battleship, " + "which means your shooting accuracy was " + (3/guesses);
alert(stats);
A Pen by Eric LeRay - Script Codes
A Pen by Eric LeRay - Script Codes
Home Page Home
Developer Eric LeRay
Username acheron9865
Uploaded July 12, 2022
Rating 3
Size 2,039 Kb
Views 22,264
Do you need developer help for A Pen by Eric LeRay?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Eric LeRay (acheron9865) Script Codes
Name
Code Magnets
Clunk
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!