A Pen by Eric LeRay
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 - 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);
Developer | Eric LeRay |
Username | acheron9865 |
Uploaded | July 12, 2022 |
Rating | 3 |
Size | 2,039 Kb |
Views | 22,264 |
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!
Name | Size |
Code Magnets | 1,403 Kb |
Clunk | 1,509 Kb |
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!
Name | Username | Size |
Materializecss input form | Jasonchan | 1,443 Kb |
Hoi hoi | JohnTheCat | 7,248 Kb |
A Pen by Miro Olma | Programiro | 2,342 Kb |
Learning FlexBox | Alex_rodrigues | 2,821 Kb |
AngularJS Datalist Directive | M-e-conroy | 2,366 Kb |
Font stack | Adrianjacob | 1,868 Kb |
404 Page | Saransh | 2,666 Kb |
Octopus Bar iPad App Interactions | Davidkpiano | 6,735 Kb |
Animated Logo | Shakdaniel | 2,672 Kb |
Placeholder support for contentEditable elements, without JavaScript | Flesler | 1,863 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!