diff --git a/config.json b/config.json index 2456708..04357c2 100644 --- a/config.json +++ b/config.json @@ -520,6 +520,14 @@ "practices": [], "prerequisites": [], "difficulty": 2 + }, + { + "slug": "acronym", + "name": "Acronym", + "uuid": "8a470aa6-6a54-4a37-83a8-f86c35f6b567", + "practices": [], + "prerequisites": [], + "difficulty": 2 } ] }, diff --git a/exercises/practice/acronym/.docs/instructions.md b/exercises/practice/acronym/.docs/instructions.md new file mode 100644 index 0000000..133bd2c --- /dev/null +++ b/exercises/practice/acronym/.docs/instructions.md @@ -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 | diff --git a/exercises/practice/acronym/.meta/config.json b/exercises/practice/acronym/.meta/config.json new file mode 100644 index 0000000..e4421c6 --- /dev/null +++ b/exercises/practice/acronym/.meta/config.json @@ -0,0 +1,22 @@ +{ + "authors": [ + "BNAndras" + ], + "contributors": [ + "BethanyG" + ], + "files": { + "solution": [ + "source/acronym.d" + ], + "test": [ + "source/acronym.d" + ], + "example": [ + "example/acronym.d" + ] + }, + "blurb": "Convert a long phrase to its acronym.", + "source": "Julien Vanier", + "source_url": "https://github.com/monkbroc" +} diff --git a/exercises/practice/acronym/.meta/tests.toml b/exercises/practice/acronym/.meta/tests.toml new file mode 100644 index 0000000..6e3277c --- /dev/null +++ b/exercises/practice/acronym/.meta/tests.toml @@ -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" diff --git a/exercises/practice/acronym/dub.sdl b/exercises/practice/acronym/dub.sdl new file mode 100644 index 0000000..a3070fb --- /dev/null +++ b/exercises/practice/acronym/dub.sdl @@ -0,0 +1,2 @@ +name "acronym" +buildRequirements "disallowDeprecations" diff --git a/exercises/practice/acronym/example/acronym.d b/exercises/practice/acronym/example/acronym.d new file mode 100644 index 0000000..e6598d5 --- /dev/null +++ b/exercises/practice/acronym/example/acronym.d @@ -0,0 +1,11 @@ +module acronym; + +import std.regex; +import std.string; + +immutable r = regex(r"(?