{"id":24740320,"url":"https://github.com/derektypist/project-euler-042","last_synced_at":"2025-12-30T23:45:01.876Z","repository":{"id":60133366,"uuid":"541177351","full_name":"derektypist/project-euler-042","owner":"derektypist","description":"Find the number of triangle words in the provided array.  A PDF File is available for viewing the words.  A triangle word is whose word value is a triangle number.  A word value is the sum of numbers corresponding to its alphabetical position.  For example, SKY has a word value of 55, because 19 + 11 + 25 = 55.  SKY is a triangle word, because 55 is a triangle number.","archived":false,"fork":false,"pushed_at":"2022-09-25T15:34:12.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-27T23:24:09.452Z","etag":null,"topics":["bootstrap5","css3","google-fonts","html5","javascript","pdf","project-euler","triangle-numbers"],"latest_commit_sha":null,"homepage":"https://derektypist.github.io/project-euler-042","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/derektypist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-25T13:17:41.000Z","updated_at":"2024-04-02T00:10:14.000Z","dependencies_parsed_at":"2022-09-25T23:25:33.852Z","dependency_job_id":null,"html_url":"https://github.com/derektypist/project-euler-042","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derektypist%2Fproject-euler-042","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derektypist%2Fproject-euler-042/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derektypist%2Fproject-euler-042/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derektypist%2Fproject-euler-042/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/derektypist","download_url":"https://codeload.github.com/derektypist/project-euler-042/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245007769,"owners_count":20546221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap5","css3","google-fonts","html5","javascript","pdf","project-euler","triangle-numbers"],"created_at":"2025-01-27T23:22:48.249Z","updated_at":"2025-12-30T23:45:01.824Z","avatar_url":"https://github.com/derektypist.png","language":"HTML","readme":"# Project Euler 042 - Coded Triangle Numbers\n\nThe nth term of sequence of triangle numbers is given by, t\u003csub\u003en\u003c/sub\u003e = (1/2)n(n+1), so the first ten triangle numbers are:\n\n    1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...\n\nBy converting each letter in a word to a number corresponding to its alphabetical position and adding these values we form a word value.  For example, the word value for SKY is 19 + 11 + 25 = 55 = t\u003csub\u003e10\u003c/sub\u003e.  If the word value is a triangle number then we shall call the word a triangle word.\n\nUsing words array of n-length, how many are triangle words?\n\nA [PDF File](pdf/words.pdf) containing the words is supplied.\n\nInformation at [Project Euler 042](https://projecteuler.net/problem=42)\n\n## UX\n\n**Getting Started**\n\nEnter a whole number between 1 and 1786, without leading zeros such as 01 and click on the Submit Button.  You will see the number of triangle words unless you have made an invalid input.  Click on the Reset Button to clear the information or to start again.  You can also view the PDF File containing the words (in alphabetical order).  Each word is in upper case (e.g. SKY).  Viewing the PDF File is not part of submitting the form, so you can view the PDF File before or after submitting your input.\n\n**User Stories**\n\nAs a user, I can view the PDF File containing a list of words.\n\nAs a user, I expect to get an error message, if I do any of:\n\n- Not enter anything in the input field\n- Entering text other than a number\n- Entering a number less than 1 or greater than 1786\n- Including leading zeros (e.g. 01)\n- Entering a number, but it is not an integer\n\nAs a user, I expect the function `codedTriangleNumbers(1400)` to return a number.\n\nAs a user, I expect the function `codedTriangleNumbers(1400)` to return 129.\n\nAs a user, I expect the function `codedTriangleNumbers(1500)` to return 137.\n\nAs a user, I expect the function `codedTriangleNumbers(1600)` to return 141.\n\nAs a user, I expect the function `codedTriangleNumbers(1786)` to return 162.\n\nUser Stories on function `codedTriangleNumbers(n)` taken from [FreeCodeCamp - Coding Interview Prep - Project Euler 042](https://www.freecodecamp.org/learn/coding-interview-prep/project-euler/problem-42-coded-triangle-numbers)\n\n**Information Architecture**\n\nThe function `codedTriangleNumbers(n)` returns a number, where n is a number.\n\n## Features\n\nAllows the user to input a number in order to find the number of triangle words in the array supplied.  Performs checks on valid user input.  If the input is not valid, an error message is displayed.  Also allows the user to view the PDF File of words, which are listed in alphabetical order.  Each word is in upper case (e.g. SKY).\n\n## Technologies\n\nUses HTML5, CSS3, JavaScript, Bootstrap 5.2.1 and Google Fonts.\n\n## Testing\n\nEnsure all user stories have been met.\n\n## Deployment\n\nDeployed on [GitHub Pages](https://derektypist.github.io/project-euler-042) at the main branch.\n\n## Credits\n\n### Content\n\nPDF File of words, taken from the Project Euler Website.\n\nThe `words` array taken from [FreeCodeCamp - Project Euler 042](https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-42-coded-triangle-numbers.md)\n\n### Acknowledgements\n\n- [Project Euler](https://projecteuler.net)\n- [FreeCodeCamp](https://www.freecodecamp.org)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderektypist%2Fproject-euler-042","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderektypist%2Fproject-euler-042","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderektypist%2Fproject-euler-042/lists"}