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(); });
})();
![Project Euler Problem 17 - Script Codes](http://shots.codepen.io/bfillmer/pen/ahlwo-512.jpg)
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 |
Prototype Angular JS Workout Log | 2,599 Kb |
Attribute Module CSS Grid Mixins | 5,014 Kb |
YOLO KEITH | 4,043 Kb |
Continued Angular Testbed | 2,239 Kb |
Five Programming Problems | 4,091 Kb |
On A Boat | 2,615 Kb |
Regex Sensei | 1,551 Kb |
Toggle Overlay on UL | 2,509 Kb |
Useful Loading Overlay | 3,833 Kb |
Simple Number Element Controls Demo | 3,384 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 |
Coming Soon | MariamMassadeh | 1,680 Kb |
A Pen by Adrien Clerbois | AClerbois | 6,501 Kb |
Ghost | Mghayour | 11,738 Kb |
Intake Form Page 2 | Ijantje | 4,983 Kb |
Sticky footer testing | 75th | 1,649 Kb |
Addthis_button | Esambino | 1,691 Kb |
Infractions - Attitude | Kylie_Joseph | 7,672 Kb |
UI Challenge - Budget Selector | AgentRR007 | 3,547 Kb |
CSS Hover Effects | Alen | 3,613 Kb |
Gradient-ui-button-mark-fx | Tabspace | 1,881 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!