-
-
Notifications
You must be signed in to change notification settings - Fork 2
Acronym #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TheRealOwenRees
wants to merge
6
commits into
exercism:main
Choose a base branch
from
TheRealOwenRees:acronym
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Acronym #7
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3987f51
exercise setup
TheRealOwenRees 8483d77
updated testTemplate checks to just make sure that it exists, and pas…
TheRealOwenRees 28e8744
re-sync exercise files
TheRealOwenRees 72d0ee0
acronym exercise tests and example
TheRealOwenRees fdf0d40
add editor file to config
TheRealOwenRees 8f7dee4
add .resi interface file. No copying of this for now and will be addr…
TheRealOwenRees File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Instructions | ||
|
|
||
| Convert a phrase to its acronym. | ||
|
|
||
| Techies love their TLA (Three Letter Acronyms)! | ||
|
|
||
| Help generate some jargon by writing a program that converts a long name like Portable Network Graphics to its acronym (PNG). | ||
|
|
||
| Punctuation is handled as follows: hyphens are word separators (like whitespace); all other punctuation can be removed from the input. | ||
|
|
||
| For example: | ||
|
|
||
| | Input | Output | | ||
| | ------------------------- | ------ | | ||
| | As Soon As Possible | ASAP | | ||
| | Liquid-crystal display | LCD | | ||
| | Thank George It's Friday! | TGIF | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| let abbreviate = (phrase: string): string => { | ||
| switch phrase->String.match(/[a-zA-Z']+/g) { | ||
| | Some(words) => | ||
| words | ||
| ->Array.filterMap(w => w) | ||
| ->Array.map(w => w->String.charAt(0)->String.toUpperCase) | ||
| ->Array.join("") | ||
| | None => "" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| let abbreviate: string => string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| { | ||
| "authors": [ | ||
| "gabrielperales", | ||
| "therealowenrees" | ||
| ], | ||
| "contributors": [ | ||
| "benreyn", | ||
| "naartjie", | ||
| "ohana54", | ||
| "stevejb71", | ||
| "tejasbubane" | ||
| ], | ||
| "files": { | ||
| "solution": [ | ||
| "src/Acronym.res" | ||
| ], | ||
| "test": [ | ||
| "tests/Acronym_test.res" | ||
| ], | ||
| "example": [ | ||
| ".meta/Acronym.res" | ||
| ], | ||
| "editor": [ | ||
| "src/Acronym.resi" | ||
| ] | ||
| }, | ||
| "blurb": "Convert a long phrase to its acronym.", | ||
| "source": "Julien Vanier", | ||
| "source_url": "https://github.com/monkbroc" | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import path from 'node:path'; | ||
| import { fileURLToPath } from 'node:url'; | ||
| import { stringEqual } from "../../../../test_generator/assertions.js"; | ||
| import { generateTests } from '../../../../test_generator/testGenerator.js'; | ||
|
|
||
| const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
| const slug = path.basename(path.resolve(__dirname, '..')) | ||
|
|
||
| // EDIT THIS WITH YOUR ASSERTIONS | ||
| export const assertionFunctions = [ stringEqual ] | ||
|
|
||
| // EDIT THIS WITH YOUR TEST TEMPLATES | ||
| export const template = (c) => { | ||
| return `stringEqual(~message="${c.description}", abbreviate("${c.input.phrase}"), "${c.expected}")` | ||
| } | ||
|
|
||
| generateTests(__dirname, slug, assertionFunctions, template) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # This is an auto-generated file. | ||
| # | ||
| # Regenerating this file via `configlet sync` will: | ||
| # - Recreate every `description` key/value pair | ||
| # - Recreate every `reimplements` key/value pair, where they exist in problem-specifications | ||
| # - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion) | ||
| # - Preserve any other key/value pair | ||
| # | ||
| # As user-added comments (using the # character) will be removed when this file | ||
| # is regenerated, comments can be added via a `comment` key. | ||
|
|
||
| [1e22cceb-c5e4-4562-9afe-aef07ad1eaf4] | ||
| description = "basic" | ||
|
|
||
| [79ae3889-a5c0-4b01-baf0-232d31180c08] | ||
| description = "lowercase words" | ||
|
|
||
| [ec7000a7-3931-4a17-890e-33ca2073a548] | ||
| description = "punctuation" | ||
|
|
||
| [32dd261c-0c92-469a-9c5c-b192e94a63b0] | ||
| description = "all caps word" | ||
|
|
||
| [ae2ac9fa-a606-4d05-8244-3bcc4659c1d4] | ||
| description = "punctuation without whitespace" | ||
|
|
||
| [0e4b1e7c-1a6d-48fb-81a7-bf65eb9e69f9] | ||
| description = "very long abbreviation" | ||
|
|
||
| [6a078f49-c68d-4b7b-89af-33a1a98c28cc] | ||
| description = "consecutive delimiters" | ||
|
|
||
| [5118b4b1-4572-434c-8d57-5b762e57973e] | ||
| description = "apostrophes" | ||
|
|
||
| [adc12eab-ec2d-414f-b48c-66a4fc06cdef] | ||
| description = "underscore emphasis" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2026 Exercism | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're missing an
editorentry for Acronym.resi here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how strange, this was automatically added for the other exercises. I will keep my eye on that to see if there is a bug.