404: Something's gone wrong :-(
+ +You've tried to visit a page that doesn't exist. Luckily this site + has other pages.
+If you were looking for something specific, try searching: +
+ + +diff --git a/dart/README.md b/dart/README.md index 6dd30fec..61a137a1 100644 --- a/dart/README.md +++ b/dart/README.md @@ -25,3 +25,4 @@ - [phone-number](./phone-number/README.md) - [acronym](./acronym/README.md) - [luhn](./luhn/README.md) +- [pangram](./pangram/README.md) diff --git a/dart/pangram/README.md b/dart/pangram/README.md index 2748dd9d..5a06be2d 100644 --- a/dart/pangram/README.md +++ b/dart/pangram/README.md @@ -41,4 +41,9 @@ For this exercise, a sentence is a pangram if it contains each of the 26 letters ### Based on -Wikipedia - https://en.wikipedia.org/wiki/Pangram \ No newline at end of file +Wikipedia - https://en.wikipedia.org/wiki/Pangram + +### My Solution + +- [my solution](./lib/pangram.dart) +- [run-tests](./run-tests-dart.txt) diff --git a/dart/pangram/coverage/coverage.json b/dart/pangram/coverage/coverage.json new file mode 100644 index 00000000..24b31e41 --- /dev/null +++ b/dart/pangram/coverage/coverage.json @@ -0,0 +1 @@ +{"type":"CodeCoverage","coverage":[{"source":"package:pangram/pangram.dart","script":{"type":"@Script","fixedId":true,"id":"libraries/1/scripts/package%3Apangram%2Fpangram.dart","uri":"package:pangram/pangram.dart","_kind":"library"},"hits":[2,1,3,4,9,0,10,0,11,0,12,0,14,0]}]} \ No newline at end of file diff --git a/dart/pangram/coverage/lcov.info b/dart/pangram/coverage/lcov.info new file mode 100644 index 00000000..3e3c4995 --- /dev/null +++ b/dart/pangram/coverage/lcov.info @@ -0,0 +1,11 @@ +SF:/home/vpayno/git_vpayno/exercism-workspace/dart/pangram/lib/pangram.dart +DA:2,2 +DA:3,8 +DA:9,1 +DA:10,1 +DA:11,4 +DA:12,1 +DA:14,2 +LF:7 +LH:7 +end_of_record diff --git a/dart/pangram/coverage/report/amber.png b/dart/pangram/coverage/report/amber.png new file mode 100644 index 00000000..2cab170d Binary files /dev/null and b/dart/pangram/coverage/report/amber.png differ diff --git a/dart/pangram/coverage/report/emerald.png b/dart/pangram/coverage/report/emerald.png new file mode 100644 index 00000000..38ad4f40 Binary files /dev/null and b/dart/pangram/coverage/report/emerald.png differ diff --git a/dart/pangram/coverage/report/gcov.css b/dart/pangram/coverage/report/gcov.css new file mode 100644 index 00000000..0fcdff13 --- /dev/null +++ b/dart/pangram/coverage/report/gcov.css @@ -0,0 +1,519 @@ +/* All views: initial background and text color */ +body +{ + color: #000000; + background-color: #ffffff; +} + +/* All views: standard link format*/ +a:link +{ + color: #284fa8; + text-decoration: underline; +} + +/* All views: standard link - visited format */ +a:visited +{ + color: #00cb40; + text-decoration: underline; +} + +/* All views: standard link - activated format */ +a:active +{ + color: #ff0040; + text-decoration: underline; +} + +/* All views: main title format */ +td.title +{ + text-align: center; + padding-bottom: 10px; + font-family: sans-serif; + font-size: 20pt; + font-style: italic; + font-weight: bold; +} + +/* All views: header item format */ +td.headerItem +{ + text-align: right; + padding-right: 6px; + font-family: sans-serif; + font-weight: bold; + vertical-align: top; + white-space: nowrap; +} + +/* All views: header item value format */ +td.headerValue +{ + text-align: left; + color: #284fa8; + font-family: sans-serif; + font-weight: bold; + white-space: nowrap; +} + +/* All views: header item coverage table heading */ +td.headerCovTableHead +{ + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + font-size: 80%; + white-space: nowrap; +} + +/* All views: header item coverage table entry */ +td.headerCovTableEntry +{ + text-align: right; + color: #284fa8; + font-family: sans-serif; + font-weight: bold; + white-space: nowrap; + padding-left: 12px; + padding-right: 4px; + background-color: #dae7fe; +} + +/* All views: header item coverage table entry for high coverage rate */ +td.headerCovTableEntryHi +{ + text-align: right; + color: #000000; + font-family: sans-serif; + font-weight: bold; + white-space: nowrap; + padding-left: 12px; + padding-right: 4px; + background-color: #a7fc9d; +} + +/* All views: header item coverage table entry for medium coverage rate */ +td.headerCovTableEntryMed +{ + text-align: right; + color: #000000; + font-family: sans-serif; + font-weight: bold; + white-space: nowrap; + padding-left: 12px; + padding-right: 4px; + background-color: #ffea20; +} + +/* All views: header item coverage table entry for ow coverage rate */ +td.headerCovTableEntryLo +{ + text-align: right; + color: #000000; + font-family: sans-serif; + font-weight: bold; + white-space: nowrap; + padding-left: 12px; + padding-right: 4px; + background-color: #ff0000; +} + +/* All views: header legend value for legend entry */ +td.headerValueLeg +{ + text-align: left; + color: #000000; + font-family: sans-serif; + font-size: 80%; + white-space: nowrap; + padding-top: 4px; +} + +/* All views: color of horizontal ruler */ +td.ruler +{ + background-color: #6688d4; +} + +/* All views: version string format */ +td.versionInfo +{ + text-align: center; + padding-top: 2px; + font-family: sans-serif; + font-style: italic; +} + +/* Directory view/File view (all)/Test case descriptions: + table headline format */ +td.tableHead +{ + text-align: center; + color: #ffffff; + background-color: #6688d4; + font-family: sans-serif; + font-size: 120%; + font-weight: bold; + white-space: nowrap; + padding-left: 4px; + padding-right: 4px; +} + +span.tableHeadSort +{ + padding-right: 4px; +} + +/* Directory view/File view (all): filename entry format */ +td.coverFile +{ + text-align: left; + padding-left: 10px; + padding-right: 20px; + color: #284fa8; + background-color: #dae7fe; + font-family: monospace; +} + +/* Directory view/File view (all): bar-graph entry format*/ +td.coverBar +{ + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; +} + +/* Directory view/File view (all): bar-graph outline color */ +td.coverBarOutline +{ + background-color: #000000; +} + +/* Directory view/File view (all): percentage entry for files with + high coverage rate */ +td.coverPerHi +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #a7fc9d; + font-weight: bold; + font-family: sans-serif; +} + +/* Directory view/File view (all): line count entry for files with + high coverage rate */ +td.coverNumHi +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #a7fc9d; + white-space: nowrap; + font-family: sans-serif; +} + +/* Directory view/File view (all): percentage entry for files with + medium coverage rate */ +td.coverPerMed +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #ffea20; + font-weight: bold; + font-family: sans-serif; +} + +/* Directory view/File view (all): line count entry for files with + medium coverage rate */ +td.coverNumMed +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #ffea20; + white-space: nowrap; + font-family: sans-serif; +} + +/* Directory view/File view (all): percentage entry for files with + low coverage rate */ +td.coverPerLo +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #ff0000; + font-weight: bold; + font-family: sans-serif; +} + +/* Directory view/File view (all): line count entry for files with + low coverage rate */ +td.coverNumLo +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #ff0000; + white-space: nowrap; + font-family: sans-serif; +} + +/* File view (all): "show/hide details" link format */ +a.detail:link +{ + color: #B8D0FF; + font-size:80%; +} + +/* File view (all): "show/hide details" link - visited format */ +a.detail:visited +{ + color: #B8D0FF; + font-size:80%; +} + +/* File view (all): "show/hide details" link - activated format */ +a.detail:active +{ + color: #ffffff; + font-size:80%; +} + +/* File view (detail): test name entry */ +td.testName +{ + text-align: right; + padding-right: 10px; + background-color: #dae7fe; + font-family: sans-serif; +} + +/* File view (detail): test percentage entry */ +td.testPer +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; + font-family: sans-serif; +} + +/* File view (detail): test lines count entry */ +td.testNum +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; + font-family: sans-serif; +} + +/* Test case descriptions: test name format*/ +dt +{ + font-family: sans-serif; + font-weight: bold; +} + +/* Test case descriptions: description table body */ +td.testDescription +{ + padding-top: 10px; + padding-left: 30px; + padding-bottom: 10px; + padding-right: 30px; + background-color: #dae7fe; +} + +/* Source code view: function entry */ +td.coverFn +{ + text-align: left; + padding-left: 10px; + padding-right: 20px; + color: #284fa8; + background-color: #dae7fe; + font-family: monospace; +} + +/* Source code view: function entry zero count*/ +td.coverFnLo +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #ff0000; + font-weight: bold; + font-family: sans-serif; +} + +/* Source code view: function entry nonzero count*/ +td.coverFnHi +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; + font-weight: bold; + font-family: sans-serif; +} + +/* Source code view: source code format */ +pre.source +{ + font-family: monospace; + white-space: pre; + margin-top: 2px; +} + +/* Source code view: line number format */ +span.lineNum +{ + background-color: #efe383; +} + +/* Source code view: format for lines which were executed */ +td.lineCov, +span.lineCov +{ + background-color: #cad7fe; +} + +/* Source code view: format for Cov legend */ +span.coverLegendCov +{ + padding-left: 10px; + padding-right: 10px; + padding-bottom: 2px; + background-color: #cad7fe; +} + +/* Source code view: format for lines which were not executed */ +td.lineNoCov, +span.lineNoCov +{ + background-color: #ff6230; +} + +/* Source code view: format for NoCov legend */ +span.coverLegendNoCov +{ + padding-left: 10px; + padding-right: 10px; + padding-bottom: 2px; + background-color: #ff6230; +} + +/* Source code view (function table): standard link - visited format */ +td.lineNoCov > a:visited, +td.lineCov > a:visited +{ + color: #000000; + text-decoration: underline; +} + +/* Source code view: format for lines which were executed only in a + previous version */ +span.lineDiffCov +{ + background-color: #b5f7af; +} + +/* Source code view: format for branches which were executed + * and taken */ +span.branchCov +{ + background-color: #cad7fe; +} + +/* Source code view: format for branches which were executed + * but not taken */ +span.branchNoCov +{ + background-color: #ff6230; +} + +/* Source code view: format for branches which were not executed */ +span.branchNoExec +{ + background-color: #ff6230; +} + +/* Source code view: format for the source code heading line */ +pre.sourceHeading +{ + white-space: pre; + font-family: monospace; + font-weight: bold; + margin: 0px; +} + +/* All views: header legend value for low rate */ +td.headerValueLegL +{ + font-family: sans-serif; + text-align: center; + white-space: nowrap; + padding-left: 4px; + padding-right: 2px; + background-color: #ff0000; + font-size: 80%; +} + +/* All views: header legend value for med rate */ +td.headerValueLegM +{ + font-family: sans-serif; + text-align: center; + white-space: nowrap; + padding-left: 2px; + padding-right: 2px; + background-color: #ffea20; + font-size: 80%; +} + +/* All views: header legend value for hi rate */ +td.headerValueLegH +{ + font-family: sans-serif; + text-align: center; + white-space: nowrap; + padding-left: 2px; + padding-right: 4px; + background-color: #a7fc9d; + font-size: 80%; +} + +/* All views except source code view: legend format for low coverage */ +span.coverLegendCovLo +{ + padding-left: 10px; + padding-right: 10px; + padding-top: 2px; + background-color: #ff0000; +} + +/* All views except source code view: legend format for med coverage */ +span.coverLegendCovMed +{ + padding-left: 10px; + padding-right: 10px; + padding-top: 2px; + background-color: #ffea20; +} + +/* All views except source code view: legend format for hi coverage */ +span.coverLegendCovHi +{ + padding-left: 10px; + padding-right: 10px; + padding-top: 2px; + background-color: #a7fc9d; +} diff --git a/dart/pangram/coverage/report/glass.png b/dart/pangram/coverage/report/glass.png new file mode 100644 index 00000000..e1abc006 Binary files /dev/null and b/dart/pangram/coverage/report/glass.png differ diff --git a/dart/pangram/coverage/report/index-sort-f.html b/dart/pangram/coverage/report/index-sort-f.html new file mode 100644 index 00000000..ed034821 --- /dev/null +++ b/dart/pangram/coverage/report/index-sort-f.html @@ -0,0 +1,93 @@ + + + + +
+ +LCOV - code coverage report | ||||||||||||||||||||||
+
|
+ ||||||||||||||||||||||
+ | + | + | + | + | ||
Directory | +Line Coverage | +Functions | +||||
lib | +
+ |
+ 100.0 % | +7 / 7 | +- | +0 / 0 | +
Generated by: LCOV version 1.16 |
LCOV - code coverage report | ||||||||||||||||||||||
+
|
+ ||||||||||||||||||||||
+ | + | + | + | + | ||
Directory | +Line Coverage | +Functions | +||||
lib | +
+ |
+ 100.0 % | +7 / 7 | +- | +0 / 0 | +
Generated by: LCOV version 1.16 |
LCOV - code coverage report | ||||||||||||||||||||||
+
|
+ ||||||||||||||||||||||
+ | + | + | + | + | ||
Directory | +Line Coverage | +Functions | +||||
lib | +
+ |
+ 100.0 % | +7 / 7 | +- | +0 / 0 | +
Generated by: LCOV version 1.16 |
LCOV - code coverage report | ||||||||||||||||||||||
+
|
+ ||||||||||||||||||||||
+ | + | + | + | + | ||
Filename | +Line Coverage | +Functions | +||||
pangram.dart | +
+ |
+ 100.0 % | +7 / 7 | +- | +0 / 0 | +
Generated by: LCOV version 1.16 |
LCOV - code coverage report | ||||||||||||||||||||||
+
|
+ ||||||||||||||||||||||
+ | + | + | + | + | ||
Filename | +Line Coverage | +Functions | +||||
pangram.dart | +
+ |
+ 100.0 % | +7 / 7 | +- | +0 / 0 | +
Generated by: LCOV version 1.16 |
LCOV - code coverage report | ||||||||||||||||||||||
+
|
+ ||||||||||||||||||||||
+ | + | + | + | + | ||
Filename | +Line Coverage | +Functions | +||||
pangram.dart | +
+ |
+ 100.0 % | +7 / 7 | +- | +0 / 0 | +
Generated by: LCOV version 1.16 |
LCOV - code coverage report | ||||||||||||||||||||||
+
|
+ ||||||||||||||||||||||
Function Name | +Hit count | +
Generated by: LCOV version 1.16 |
LCOV - code coverage report | ||||||||||||||||||||||
+
|
+ ||||||||||||||||||||||
Function Name | +Hit count | +
Generated by: LCOV version 1.16 |
LCOV - code coverage report | ||||||||||||||||||||||
+
|
+ ||||||||||||||||||||||
+Line data Source code+ + 1 : class Pangram { + 2 2 : bool isPangram(String text) { + 3 8 : if (text.isEmpty | (text.length < 26)) { + 4 : return false; + 5 : } + 6 : + 7 : var letters = <String>{}; + 8 : letters = text + 9 1 : .toLowerCase() + 10 1 : .split('') + 11 4 : .where((rune) => RegExp(r'^[a-z]$').hasMatch(rune)) + 12 1 : .toSet(); + 13 : + 14 2 : return letters.length == 26; + 15 : } + 16 : } ++ |
+
Generated by: LCOV version 1.16 |
You've tried to visit a page that doesn't exist. Luckily this site + has other pages.
+If you were looking for something specific, try searching: +
+ + +Welcome to Pangram on Exercism's Dart Track.
+If you need help running the tests or submitting your code, check out HELP.md
.
You work for a company that sells fonts through their website. +They'd like to show a different sentence each time someone views a font on their website. +To give a comprehensive sense of the font, the random sentences should use all the letters in the English alphabet.
+They're running a competition to get suggestions for sentences that they can use. +You're in charge of checking the submissions to see if they are valid.
+Pangram comes from Greek, παν γράμμα, pan gramma, which means "every letter".
+
+The best known English pangram is:
+
+> The quick brown fox jumps over the lazy dog.
+
+Your task is to figure out if a sentence is a pangram.
+A pangram is a sentence using every letter of the alphabet at least once.
+It is case insensitive, so it doesn't matter if a letter is lower-case (e.g. k
) or upper-case (e.g. K
).
For this exercise, a sentence is a pangram if it contains each of the 26 letters in the English alphabet.
+Wikipedia - https://en.wikipedia.org/wiki/Pangram
+bool isPangram(String text) {
+ if (text.isEmpty | (text.length < 26)) {
+ return false;
+ }
+
+ var letters = <String>{};
+ letters = text
+ .toLowerCase()
+ .split('')
+ .where((rune) => RegExp(r'^[a-z]$').hasMatch(rune))
+ .toSet();
+
+ return letters.length == 26;
+}
+