Project Euler Problem 17
How do I make an project euler problem 17?
WIP.. What is a project euler problem 17? How do you make a project euler problem 17? This script and codes were developed by Bryan Fillmer on 11 December 2022, Sunday.
Project Euler Problem 17 - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Project Euler Problem 17</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/bootswatch/3.2.0/superhero/bootstrap.min.css'> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ body { padding: 2em;
}
div { max-width: 33em; margin: 0 auto;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div ng-app="EulerApp" ng-controller="Problem17 as problem"> <h3>Project Euler Problem 17</h3> <ul class="list-unstyled"> <li>0 through 99: {{problem.nums}}</li> </ul>
</div> <script src='http://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Project Euler Problem 17 - Script Codes CSS Codes
body { padding: 2em;
}
div { max-width: 33em; margin: 0 auto;
}
Project Euler Problem 17 - Script Codes JS Codes
(function () { angular.module('EulerApp', [ ]) .controller('Problem17', function () { /** * Thoughts: * After the first one-hundred you will have a consistent pattern * of the same length per number + the 'hundred' range you are in: * 'one' = 3 + [same length of any other within that 100 block]. * Determine length of first 100, then add the length of each * hundred range name * 100. */ var base = { 0: 'zero', 1: 'one', 2: 'two', 3: 'three', 4: 'four', 5: 'five', 6: 'six', 7: 'seven', 8: 'eight', 9: 'nine', 10: 'ten', 11: 'eleven', 12: 'twelve', 13: 'thirteen', 14: 'fourteen', 15: 'fifteen', 16: 'sixteen', 17: 'seventeen', 18: 'eighteen', 19: 'nineteen', }; var tens = { 0: '', 1: '', 2: 'twenty', 3: 'thirty', 4: 'forty', 5: 'fifty', 6: 'sixty', 7: 'seventy', 8: 'eighty', 9: 'ninety', }; var hundred = 'hundred'; var and = 'and'; var processTens = function (n) { var tensVal = tens[n.toString().charAt(0)]; return tensVal.length; }; var processNum = function (n) { var tensVal = 0; var onesVal = 0; if (n.toString().length >= 2) tensVal = processTens(n); if (n.toString().charAt(1) <= 1 ) onesVal = base[n].length; return tensVal + onesVal; }; var generateNums = function () { var theNums = 0; for (var n = 0; n <= 20; n++) { theNums += processNum(n); } return theNums; }; this.nums = generateNums(); });
})();
Developer | Bryan Fillmer |
Username | bfillmer |
Uploaded | December 11, 2022 |
Rating | 3 |
Size | 2,739 Kb |
Views | 18,216 |
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 |
Angular Animation Playground | 2,894 Kb |
Simple Number Element Controls Demo | 3,384 Kb |
Continued Angular Testbed | 2,239 Kb |
General Tax Calculator | 2,902 Kb |
JS Playground | 3,242 Kb |
Attribute Module CSS Grid Mixins | 5,014 Kb |
On A Boat | 2,615 Kb |
Basic Javascript Chaining | 2,399 Kb |
YOLO KEITH | 4,043 Kb |
Five Programming Problems | 4,091 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 |
Twitch TV | Natester13 | 4,488 Kb |
A Pen by utcwebdev | Utcwebdev | 2,856 Kb |
Resume | Rottingroom | 5,483 Kb |
CSSOff 2013 Submission | Codewunder | 14,766 Kb |
Importable Clearfix | Corysimmons | 1,411 Kb |
Jstam.com Home Page | Jstam | 10,558 Kb |
Simple Linear Regression with Editable Table | Melatonind | 3,264 Kb |
Arrow Navigation | Hinducows | 1,973 Kb |
Bootstrap Carousel Fade Transition | Rowno | 2,484 Kb |
See Through | Larrygeams | 77,410 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!