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 |
Simple Number Element Controls Demo | 3,384 Kb |
Useful Loading Overlay | 3,833 Kb |
JS Playground | 3,242 Kb |
Attribute Module CSS Grid Mixins | 5,014 Kb |
Toggle Overlay on UL | 2,509 Kb |
General Tax Calculator | 2,902 Kb |
Continued Angular Testbed | 2,239 Kb |
YOLO KEITH | 4,043 Kb |
Shopping Site Mockup | 6,977 Kb |
Basic Javascript Chaining | 2,399 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 |
A Pen by Kevin | Kevinkenger | 2,642 Kb |
Expert Help | SinceSidSlid | 4,064 Kb |
Haml Calendar | Katydecorah | 5,643 Kb |
A Pen by Andrea Verlicchi | Verlok | 2,018 Kb |
The Fly | GianlucaGuarini | 3,405 Kb |
Slides-07-1 POSITION | Exhtml | 1,909 Kb |
Vertically rotating text with CSS | Nopr | 2,141 Kb |
Simple Responsive Text | Fbrz | 2,282 Kb |
A Pen by Alexandru Pora | Axpro | 1,615 Kb |
Portfolio Landing Page | FDfranklin | 3,585 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!