diff --git a/config/exercise_readme.go.tmpl b/config/exercise_readme.go.tmpl new file mode 100644 index 00000000..2b26f494 --- /dev/null +++ b/config/exercise_readme.go.tmpl @@ -0,0 +1,16 @@ +# {{ .Spec.Name }} + +{{ .Spec.Description -}} +{{- with .Hints }} +{{ . }} +{{ end }} +{{- with .TrackInsert }} +{{ . }} +{{ end }} +{{- with .Spec.Credits -}} +## Source + +{{ . }} +{{ end }} +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/allergies/README.md b/exercises/allergies/README.md new file mode 100644 index 00000000..a893bc4a --- /dev/null +++ b/exercises/allergies/README.md @@ -0,0 +1,58 @@ +# Allergies + +Given a person's allergy score, determine whether or not they're allergic to a given item, and their full list of allergies. + +An allergy test produces a single numeric score which contains the +information about all the allergies the person has (that they were +tested for). + +The list of items (and their value) that were tested are: + +* eggs (1) +* peanuts (2) +* shellfish (4) +* strawberries (8) +* tomatoes (16) +* chocolate (32) +* pollen (64) +* cats (128) + +So if Tom is allergic to peanuts and chocolate, he gets a score of 34. + +Now, given just that score of 34, your program should be able to say: + +- Whether Tom is allergic to any one of those allergens listed above. +- All the allergens Tom is allergic to. + +Note: a given score may include allergens **not** listed above (i.e. +allergens that score 256, 512, 1024, etc.). Your program should +ignore those components of the score. For example, if the allergy +score is 257, your program should only report the eggs (1) allergy. + + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +Jumpstart Lab Warm-up [http://jumpstartlab.com](http://jumpstartlab.com) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/bank-account/README.md b/exercises/bank-account/README.md new file mode 100644 index 00000000..38d12781 --- /dev/null +++ b/exercises/bank-account/README.md @@ -0,0 +1,51 @@ +# Bank Account + +Simulate a bank account supporting opening/closing, withdrawals, and deposits +of money. Watch out for concurrent transactions! + +A bank account can be accessed in multiple ways. Clients can make +deposits and withdrawals using the internet, mobile phones, etc. Shops +can charge against the account. + +Create an account that can be accessed from multiple threads/processes +(terminology depends on your programming language). + +It should be possible to close an account; operations against a closed +account must fail. + +## Instructions + +Run the test file, and fix each of the errors in turn. When you get the +first test to pass, go to the first pending or skipped test, and make +that pass as well. When all of the tests are passing, feel free to +submit. + +Remember that passing code is just the first step. The goal is to work +towards a solution that is as readable and expressive as you can make +it. + +Have fun! + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/beer-song/README.md b/exercises/beer-song/README.md new file mode 100644 index 00000000..f1ce20f8 --- /dev/null +++ b/exercises/beer-song/README.md @@ -0,0 +1,348 @@ +# Beer Song + +Produce the lyrics to that beloved classic, that field-trip favorite: 99 Bottles of Beer on the Wall. + +Note that not all verses are identical. + +```plain +99 bottles of beer on the wall, 99 bottles of beer. +Take one down and pass it around, 98 bottles of beer on the wall. + +98 bottles of beer on the wall, 98 bottles of beer. +Take one down and pass it around, 97 bottles of beer on the wall. + +97 bottles of beer on the wall, 97 bottles of beer. +Take one down and pass it around, 96 bottles of beer on the wall. + +96 bottles of beer on the wall, 96 bottles of beer. +Take one down and pass it around, 95 bottles of beer on the wall. + +95 bottles of beer on the wall, 95 bottles of beer. +Take one down and pass it around, 94 bottles of beer on the wall. + +94 bottles of beer on the wall, 94 bottles of beer. +Take one down and pass it around, 93 bottles of beer on the wall. + +93 bottles of beer on the wall, 93 bottles of beer. +Take one down and pass it around, 92 bottles of beer on the wall. + +92 bottles of beer on the wall, 92 bottles of beer. +Take one down and pass it around, 91 bottles of beer on the wall. + +91 bottles of beer on the wall, 91 bottles of beer. +Take one down and pass it around, 90 bottles of beer on the wall. + +90 bottles of beer on the wall, 90 bottles of beer. +Take one down and pass it around, 89 bottles of beer on the wall. + +89 bottles of beer on the wall, 89 bottles of beer. +Take one down and pass it around, 88 bottles of beer on the wall. + +88 bottles of beer on the wall, 88 bottles of beer. +Take one down and pass it around, 87 bottles of beer on the wall. + +87 bottles of beer on the wall, 87 bottles of beer. +Take one down and pass it around, 86 bottles of beer on the wall. + +86 bottles of beer on the wall, 86 bottles of beer. +Take one down and pass it around, 85 bottles of beer on the wall. + +85 bottles of beer on the wall, 85 bottles of beer. +Take one down and pass it around, 84 bottles of beer on the wall. + +84 bottles of beer on the wall, 84 bottles of beer. +Take one down and pass it around, 83 bottles of beer on the wall. + +83 bottles of beer on the wall, 83 bottles of beer. +Take one down and pass it around, 82 bottles of beer on the wall. + +82 bottles of beer on the wall, 82 bottles of beer. +Take one down and pass it around, 81 bottles of beer on the wall. + +81 bottles of beer on the wall, 81 bottles of beer. +Take one down and pass it around, 80 bottles of beer on the wall. + +80 bottles of beer on the wall, 80 bottles of beer. +Take one down and pass it around, 79 bottles of beer on the wall. + +79 bottles of beer on the wall, 79 bottles of beer. +Take one down and pass it around, 78 bottles of beer on the wall. + +78 bottles of beer on the wall, 78 bottles of beer. +Take one down and pass it around, 77 bottles of beer on the wall. + +77 bottles of beer on the wall, 77 bottles of beer. +Take one down and pass it around, 76 bottles of beer on the wall. + +76 bottles of beer on the wall, 76 bottles of beer. +Take one down and pass it around, 75 bottles of beer on the wall. + +75 bottles of beer on the wall, 75 bottles of beer. +Take one down and pass it around, 74 bottles of beer on the wall. + +74 bottles of beer on the wall, 74 bottles of beer. +Take one down and pass it around, 73 bottles of beer on the wall. + +73 bottles of beer on the wall, 73 bottles of beer. +Take one down and pass it around, 72 bottles of beer on the wall. + +72 bottles of beer on the wall, 72 bottles of beer. +Take one down and pass it around, 71 bottles of beer on the wall. + +71 bottles of beer on the wall, 71 bottles of beer. +Take one down and pass it around, 70 bottles of beer on the wall. + +70 bottles of beer on the wall, 70 bottles of beer. +Take one down and pass it around, 69 bottles of beer on the wall. + +69 bottles of beer on the wall, 69 bottles of beer. +Take one down and pass it around, 68 bottles of beer on the wall. + +68 bottles of beer on the wall, 68 bottles of beer. +Take one down and pass it around, 67 bottles of beer on the wall. + +67 bottles of beer on the wall, 67 bottles of beer. +Take one down and pass it around, 66 bottles of beer on the wall. + +66 bottles of beer on the wall, 66 bottles of beer. +Take one down and pass it around, 65 bottles of beer on the wall. + +65 bottles of beer on the wall, 65 bottles of beer. +Take one down and pass it around, 64 bottles of beer on the wall. + +64 bottles of beer on the wall, 64 bottles of beer. +Take one down and pass it around, 63 bottles of beer on the wall. + +63 bottles of beer on the wall, 63 bottles of beer. +Take one down and pass it around, 62 bottles of beer on the wall. + +62 bottles of beer on the wall, 62 bottles of beer. +Take one down and pass it around, 61 bottles of beer on the wall. + +61 bottles of beer on the wall, 61 bottles of beer. +Take one down and pass it around, 60 bottles of beer on the wall. + +60 bottles of beer on the wall, 60 bottles of beer. +Take one down and pass it around, 59 bottles of beer on the wall. + +59 bottles of beer on the wall, 59 bottles of beer. +Take one down and pass it around, 58 bottles of beer on the wall. + +58 bottles of beer on the wall, 58 bottles of beer. +Take one down and pass it around, 57 bottles of beer on the wall. + +57 bottles of beer on the wall, 57 bottles of beer. +Take one down and pass it around, 56 bottles of beer on the wall. + +56 bottles of beer on the wall, 56 bottles of beer. +Take one down and pass it around, 55 bottles of beer on the wall. + +55 bottles of beer on the wall, 55 bottles of beer. +Take one down and pass it around, 54 bottles of beer on the wall. + +54 bottles of beer on the wall, 54 bottles of beer. +Take one down and pass it around, 53 bottles of beer on the wall. + +53 bottles of beer on the wall, 53 bottles of beer. +Take one down and pass it around, 52 bottles of beer on the wall. + +52 bottles of beer on the wall, 52 bottles of beer. +Take one down and pass it around, 51 bottles of beer on the wall. + +51 bottles of beer on the wall, 51 bottles of beer. +Take one down and pass it around, 50 bottles of beer on the wall. + +50 bottles of beer on the wall, 50 bottles of beer. +Take one down and pass it around, 49 bottles of beer on the wall. + +49 bottles of beer on the wall, 49 bottles of beer. +Take one down and pass it around, 48 bottles of beer on the wall. + +48 bottles of beer on the wall, 48 bottles of beer. +Take one down and pass it around, 47 bottles of beer on the wall. + +47 bottles of beer on the wall, 47 bottles of beer. +Take one down and pass it around, 46 bottles of beer on the wall. + +46 bottles of beer on the wall, 46 bottles of beer. +Take one down and pass it around, 45 bottles of beer on the wall. + +45 bottles of beer on the wall, 45 bottles of beer. +Take one down and pass it around, 44 bottles of beer on the wall. + +44 bottles of beer on the wall, 44 bottles of beer. +Take one down and pass it around, 43 bottles of beer on the wall. + +43 bottles of beer on the wall, 43 bottles of beer. +Take one down and pass it around, 42 bottles of beer on the wall. + +42 bottles of beer on the wall, 42 bottles of beer. +Take one down and pass it around, 41 bottles of beer on the wall. + +41 bottles of beer on the wall, 41 bottles of beer. +Take one down and pass it around, 40 bottles of beer on the wall. + +40 bottles of beer on the wall, 40 bottles of beer. +Take one down and pass it around, 39 bottles of beer on the wall. + +39 bottles of beer on the wall, 39 bottles of beer. +Take one down and pass it around, 38 bottles of beer on the wall. + +38 bottles of beer on the wall, 38 bottles of beer. +Take one down and pass it around, 37 bottles of beer on the wall. + +37 bottles of beer on the wall, 37 bottles of beer. +Take one down and pass it around, 36 bottles of beer on the wall. + +36 bottles of beer on the wall, 36 bottles of beer. +Take one down and pass it around, 35 bottles of beer on the wall. + +35 bottles of beer on the wall, 35 bottles of beer. +Take one down and pass it around, 34 bottles of beer on the wall. + +34 bottles of beer on the wall, 34 bottles of beer. +Take one down and pass it around, 33 bottles of beer on the wall. + +33 bottles of beer on the wall, 33 bottles of beer. +Take one down and pass it around, 32 bottles of beer on the wall. + +32 bottles of beer on the wall, 32 bottles of beer. +Take one down and pass it around, 31 bottles of beer on the wall. + +31 bottles of beer on the wall, 31 bottles of beer. +Take one down and pass it around, 30 bottles of beer on the wall. + +30 bottles of beer on the wall, 30 bottles of beer. +Take one down and pass it around, 29 bottles of beer on the wall. + +29 bottles of beer on the wall, 29 bottles of beer. +Take one down and pass it around, 28 bottles of beer on the wall. + +28 bottles of beer on the wall, 28 bottles of beer. +Take one down and pass it around, 27 bottles of beer on the wall. + +27 bottles of beer on the wall, 27 bottles of beer. +Take one down and pass it around, 26 bottles of beer on the wall. + +26 bottles of beer on the wall, 26 bottles of beer. +Take one down and pass it around, 25 bottles of beer on the wall. + +25 bottles of beer on the wall, 25 bottles of beer. +Take one down and pass it around, 24 bottles of beer on the wall. + +24 bottles of beer on the wall, 24 bottles of beer. +Take one down and pass it around, 23 bottles of beer on the wall. + +23 bottles of beer on the wall, 23 bottles of beer. +Take one down and pass it around, 22 bottles of beer on the wall. + +22 bottles of beer on the wall, 22 bottles of beer. +Take one down and pass it around, 21 bottles of beer on the wall. + +21 bottles of beer on the wall, 21 bottles of beer. +Take one down and pass it around, 20 bottles of beer on the wall. + +20 bottles of beer on the wall, 20 bottles of beer. +Take one down and pass it around, 19 bottles of beer on the wall. + +19 bottles of beer on the wall, 19 bottles of beer. +Take one down and pass it around, 18 bottles of beer on the wall. + +18 bottles of beer on the wall, 18 bottles of beer. +Take one down and pass it around, 17 bottles of beer on the wall. + +17 bottles of beer on the wall, 17 bottles of beer. +Take one down and pass it around, 16 bottles of beer on the wall. + +16 bottles of beer on the wall, 16 bottles of beer. +Take one down and pass it around, 15 bottles of beer on the wall. + +15 bottles of beer on the wall, 15 bottles of beer. +Take one down and pass it around, 14 bottles of beer on the wall. + +14 bottles of beer on the wall, 14 bottles of beer. +Take one down and pass it around, 13 bottles of beer on the wall. + +13 bottles of beer on the wall, 13 bottles of beer. +Take one down and pass it around, 12 bottles of beer on the wall. + +12 bottles of beer on the wall, 12 bottles of beer. +Take one down and pass it around, 11 bottles of beer on the wall. + +11 bottles of beer on the wall, 11 bottles of beer. +Take one down and pass it around, 10 bottles of beer on the wall. + +10 bottles of beer on the wall, 10 bottles of beer. +Take one down and pass it around, 9 bottles of beer on the wall. + +9 bottles of beer on the wall, 9 bottles of beer. +Take one down and pass it around, 8 bottles of beer on the wall. + +8 bottles of beer on the wall, 8 bottles of beer. +Take one down and pass it around, 7 bottles of beer on the wall. + +7 bottles of beer on the wall, 7 bottles of beer. +Take one down and pass it around, 6 bottles of beer on the wall. + +6 bottles of beer on the wall, 6 bottles of beer. +Take one down and pass it around, 5 bottles of beer on the wall. + +5 bottles of beer on the wall, 5 bottles of beer. +Take one down and pass it around, 4 bottles of beer on the wall. + +4 bottles of beer on the wall, 4 bottles of beer. +Take one down and pass it around, 3 bottles of beer on the wall. + +3 bottles of beer on the wall, 3 bottles of beer. +Take one down and pass it around, 2 bottles of beer on the wall. + +2 bottles of beer on the wall, 2 bottles of beer. +Take one down and pass it around, 1 bottle of beer on the wall. + +1 bottle of beer on the wall, 1 bottle of beer. +Take it down and pass it around, no more bottles of beer on the wall. + +No more bottles of beer on the wall, no more bottles of beer. +Go to the store and buy some more, 99 bottles of beer on the wall. +``` + +## For bonus points + +Did you get the tests passing and the code clean? If you want to, these +are some additional things you could try: + +* Remove as much duplication as you possibly can. +* Optimize for readability, even if it means introducing duplication. +* If you've removed all the duplication, do you have a lot of + conditionals? Try replacing the conditionals with polymorphism, if it + applies in this language. How readable is it? + +Then please share your thoughts in a comment on the submission. Did this +experiment make the code better? Worse? Did you learn anything from it? + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +Learn to Program by Chris Pine [http://pine.fm/LearnToProgram/?Chapter=06](http://pine.fm/LearnToProgram/?Chapter=06) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/binary-search/README.md b/exercises/binary-search/README.md new file mode 100644 index 00000000..0b1bbbd5 --- /dev/null +++ b/exercises/binary-search/README.md @@ -0,0 +1,62 @@ +# Binary Search + +Implement a binary search algorithm. + +Searching a sorted collection is a common task. A dictionary is a sorted +list of word definitions. Given a word, one can find its definition. A +telephone book is a sorted list of people's names, addresses, and +telephone numbers. Knowing someone's name allows one to quickly find +their telephone number and address. + +If the list to be searched contains more than a few items (a dozen, say) +a binary search will require far fewer comparisons than a linear search, +but it imposes the requirement that the list be sorted. + +In computer science, a binary search or half-interval search algorithm +finds the position of a specified input value (the search "key") within +an array sorted by key value. + +In each step, the algorithm compares the search key value with the key +value of the middle element of the array. + +If the keys match, then a matching element has been found and its index, +or position, is returned. + +Otherwise, if the search key is less than the middle element's key, then +the algorithm repeats its action on the sub-array to the left of the +middle element or, if the search key is greater, on the sub-array to the +right. + +If the remaining array to be searched is empty, then the key cannot be +found in the array and a special "not found" indication is returned. + +A binary search halves the number of items to check with each iteration, +so locating an item (or determining its absence) takes logarithmic time. +A binary search is a dichotomic divide and conquer search algorithm. + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +Wikipedia [http://en.wikipedia.org/wiki/Binary_search_algorithm](http://en.wikipedia.org/wiki/Binary_search_algorithm) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/bob/README.md b/exercises/bob/README.md new file mode 100644 index 00000000..6e9e1436 --- /dev/null +++ b/exercises/bob/README.md @@ -0,0 +1,39 @@ +# Bob + +Bob is a lackadaisical teenager. In conversation, his responses are very limited. + +Bob answers 'Sure.' if you ask him a question. + +He answers 'Whoa, chill out!' if you yell at him. + +He says 'Fine. Be that way!' if you address him without actually saying +anything. + +He answers 'Whatever.' to anything else. + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +Inspired by the 'Deaf Grandma' exercise in Chris Pine's Learn to Program tutorial. [http://pine.fm/LearnToProgram/?Chapter=06](http://pine.fm/LearnToProgram/?Chapter=06) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/book-store/README.md b/exercises/book-store/README.md new file mode 100644 index 00000000..75ccb1d9 --- /dev/null +++ b/exercises/book-store/README.md @@ -0,0 +1,95 @@ +# Book Store + +To try and encourage more sales of different books from a popular 5 book +series, a bookshop has decided to offer discounts on multiple book purchases. + +One copy of any of the five books costs $8. + +If, however, you buy two different books, you get a 5% +discount on those two books. + +If you buy 3 different books, you get a 10% discount. + +If you buy 4 different books, you get a 20% discount. + +If you buy all 5, you get a 25% discount. + +Note: that if you buy four books, of which 3 are +different titles, you get a 10% discount on the 3 that +form part of a set, but the fourth book still costs $8. + +Your mission is to write a piece of code to calculate the +price of any conceivable shopping basket (containing only +books of the same series), giving as big a discount as +possible. + +For example, how much does this basket of books cost? + +- 2 copies of the first book +- 2 copies of the second book +- 2 copies of the third book +- 1 copy of the fourth book +- 1 copy of the fifth book + +One way of grouping these 8 books is: + +- 1 group of 5 --> 25% discount (1st,2nd,3rd,4th,5th) +- +1 group of 3 --> 10% discount (1st,2nd,3rd) + +This would give a total of: + +- 5 books at a 25% discount +- +3 books at a 10% discount + +Resulting in: + +- 5 x (8 - 2.00) == 5 x 6.00 == $30.00 +- +3 x (8 - 0.80) == 3 x 7.20 == $21.60 + +For a total of $51.60 + +However, a different way to group these 8 books is: + +- 1 group of 4 books --> 20% discount (1st,2nd,3rd,4th) +- +1 group of 4 books --> 20% discount (1st,2nd,3rd,5th) + +This would give a total of: + +- 4 books at a 20% discount +- +4 books at a 20% discount + +Resulting in: + +- 4 x (8 - 1.60) == 4 x 6.40 == $25.60 +- +4 x (8 - 1.60) == 4 x 6.40 == $25.60 + +For a total of $51.20 + +And $51.20 is the price with the biggest discount. + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +Inspired by the harry potter kata from Cyber-Dojo. [http://cyber-dojo.org](http://cyber-dojo.org) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/bowling/README.md b/exercises/bowling/README.md new file mode 100644 index 00000000..144dcd52 --- /dev/null +++ b/exercises/bowling/README.md @@ -0,0 +1,74 @@ +# Bowling + +Score a bowling game. + +Bowling is game where players roll a heavy ball to knock down pins +arranged in a triangle. Write code to keep track of the score +of a game of bowling. + +## Scoring Bowling + +The game consists of 10 frames. A frame is composed of one or two ball throws with 10 pins standing at frame initialization. There are three cases for the tabulation of a frame. + +* An open frame is where a score of less than 10 is recorded for the frame. In this case the score for the frame is the number of pins knocked down. + +* A spare is where all ten pins are knocked down after the second throw. The total value of a spare is 10 plus the number of pins knocked down in their next throw. + +* A strike is where all ten pins are knocked down after the first throw. The total value of a strike is 10 plus the number of pins knocked down in their next two throws. If a strike is immediately followed by a second strike, then we can not total the value of first strike until they throw the ball one more time. + +Here is a three frame example: + +| Frame 1 | Frame 2 | Frame 3 | +| :-------------: |:-------------:| :---------------------:| +| X (strike) | 5/ (spare) | 9 0 (open frame) | + +Frame 1 is (10 + 5 + 5) = 20 + +Frame 2 is (5 + 5 + 9) = 19 + +Frame 3 is (9 + 0) = 9 + +This means the current running total is 48. + +The tenth frame in the game is a special case. If someone throws a strike or a spare then they get a fill ball. Fill balls exist to calculate the total of the 10th frame. Scoring a strike or spare on the fill ball does not give the player more fill balls. The total value of the 10th frame is the total number of pins knocked down. + +For a tenth frame of X1/ (strike and a spare), the total value is 20. + +For a tenth frame of XXX (three strikes), the total value is 30. + +## Requirements + +Write code to keep track of the score of a game of bowling. It should +support two operations: + +* `roll(pins : int)` is called each time the player rolls a ball. The + argument is the number of pins knocked down. +* `score() : int` is called only at the very end of the game. It + returns the total score for that game. + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +The Bowling Game Kata at but UncleBob [http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata](http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/circular-buffer/README.md b/exercises/circular-buffer/README.md new file mode 100644 index 00000000..e2072449 --- /dev/null +++ b/exercises/circular-buffer/README.md @@ -0,0 +1,71 @@ +# Circular Buffer + +A circular buffer, cyclic buffer or ring buffer is a data structure that +uses a single, fixed-size buffer as if it were connected end-to-end. + +A circular buffer first starts empty and of some predefined length. For +example, this is a 7-element buffer: + + [ ][ ][ ][ ][ ][ ][ ] + +Assume that a 1 is written into the middle of the buffer (exact starting +location does not matter in a circular buffer): + + [ ][ ][ ][1][ ][ ][ ] + +Then assume that two more elements are added — 2 & 3 — which get +appended after the 1: + + [ ][ ][ ][1][2][3][ ] + +If two elements are then removed from the buffer, the oldest values +inside the buffer are removed. The two elements removed, in this case, +are 1 & 2, leaving the buffer with just a 3: + + [ ][ ][ ][ ][ ][3][ ] + +If the buffer has 7 elements then it is completely full: + + [6][7][8][9][3][4][5] + +When the buffer is full an error will be raised, alerting the client +that further writes are blocked until a slot becomes free. + +The client can opt to overwrite the oldest data with a forced write. In +this case, two more elements — A & B — are added and they overwrite the +3 & 4: + + [6][7][8][9][A][B][5] + +Finally, if two elements are now removed then what would be returned is +not 3 & 4 but 5 & 6 because A & B overwrote the 3 & the 4 yielding the +buffer with: + + [ ][7][8][9][A][B][ ] + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +Wikipedia [http://en.wikipedia.org/wiki/Circular_buffer](http://en.wikipedia.org/wiki/Circular_buffer) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/clock/README.md b/exercises/clock/README.md new file mode 100644 index 00000000..b3bd5154 --- /dev/null +++ b/exercises/clock/README.md @@ -0,0 +1,34 @@ +# Clock + +Implement a clock that handles times without dates. + +You should be able to add and subtract minutes to it. + +Two clocks that represent the same time should be equal to each other. + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +Pairing session with Erin Drummond [https://twitter.com/ebdrummond](https://twitter.com/ebdrummond) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/collatz-conjecture/README.md b/exercises/collatz-conjecture/README.md new file mode 100644 index 00000000..c425a231 --- /dev/null +++ b/exercises/collatz-conjecture/README.md @@ -0,0 +1,54 @@ +# Collatz Conjecture + +The Collatz Conjecture or 3x+1 problem can be summarized as follows: + +Take any positive integer n. If n is even, divide n by 2 to get n / 2. If n is +odd, multiply n by 3 and add 1 to get 3n + 1. Repeat the process indefinitely. +The conjecture states that no matter which number you start with, you will +always reach 1 eventually. + +Given a number n, return the number of steps required to reach 1. + +## Examples +Starting with n = 12, the steps would be as follows: + +0. 12 +1. 6 +2. 3 +3. 10 +4. 5 +5. 16 +6. 8 +7. 4 +8. 2 +9. 1 + +Resulting in 9 steps. So for input n = 12, the return value would be 9. + + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +An unsolved problem in mathematics named after mathematician Lothar Collatz [https://en.wikipedia.org/wiki/3x_%2B_1_problem](https://en.wikipedia.org/wiki/3x_%2B_1_problem) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/etl/README.md b/exercises/etl/README.md new file mode 100644 index 00000000..dedbc8a2 --- /dev/null +++ b/exercises/etl/README.md @@ -0,0 +1,72 @@ +# Etl + +We are going to do the `Transform` step of an Extract-Transform-Load. + +### ETL +Extract-Transform-Load (ETL) is a fancy way of saying, "We have some crufty, legacy data over in this system, and now we need it in this shiny new system over here, so +we're going to migrate this." + +(Typically, this is followed by, "We're only going to need to run this +once." That's then typically followed by much forehead slapping and +moaning about how stupid we could possibly be.) + +### The goal +We're going to extract some scrabble scores from a legacy system. + +The old system stored a list of letters per score: + +- 1 point: "A", "E", "I", "O", "U", "L", "N", "R", "S", "T", +- 2 points: "D", "G", +- 3 points: "B", "C", "M", "P", +- 4 points: "F", "H", "V", "W", "Y", +- 5 points: "K", +- 8 points: "J", "X", +- 10 points: "Q", "Z", + +The shiny new scrabble system instead stores the score per letter, which +makes it much faster and easier to calculate the score for a word. It +also stores the letters in lower-case regardless of the case of the +input letters: + +- "a" is worth 1 point. +- "b" is worth 3 points. +- "c" is worth 3 points. +- "d" is worth 2 points. +- Etc. + +Your mission, should you choose to accept it, is to transform the legacy data +format to the shiny new format. + +### Notes + +A final note about scoring, Scrabble is played around the world in a +variety of languages, each with its own unique scoring table. For +example, an "E" is scored at 2 in the Māori-language version of the +game while being scored at 4 in the Hawaiian-language version. + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +The Jumpstart Lab team [http://jumpstartlab.com](http://jumpstartlab.com) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/grains/README.md b/exercises/grains/README.md new file mode 100644 index 00000000..9b906785 --- /dev/null +++ b/exercises/grains/README.md @@ -0,0 +1,55 @@ +# Grains + +Calculate the number of grains of wheat on a chessboard given that the number +on each square doubles. + +There once was a wise servant who saved the life of a prince. The king +promised to pay whatever the servant could dream up. Knowing that the +king loved chess, the servant told the king he would like to have grains +of wheat. One grain on the first square of a chess board. Two grains on +the next. Four on the third, and so on. + +There are 64 squares on a chessboard. + +Write code that shows: +- how many grains were on each square, and +- the total number of grains + + +## For bonus points + +Did you get the tests passing and the code clean? If you want to, these +are some additional things you could try: + +- Optimize for speed. +- Optimize for readability. + +Then please share your thoughts in a comment on the submission. Did this +experiment make the code better? Worse? Did you learn anything from it? + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +JavaRanch Cattle Drive, exercise 6 [http://www.javaranch.com/grains.jsp](http://www.javaranch.com/grains.jsp) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/hamming/README.md b/exercises/hamming/README.md new file mode 100644 index 00000000..61ae553d --- /dev/null +++ b/exercises/hamming/README.md @@ -0,0 +1,63 @@ +# Hamming + +Calculate the Hamming difference between two DNA strands. + +A mutation is simply a mistake that occurs during the creation or +copying of a nucleic acid, in particular DNA. Because nucleic acids are +vital to cellular functions, mutations tend to cause a ripple effect +throughout the cell. Although mutations are technically mistakes, a very +rare mutation may equip the cell with a beneficial attribute. In fact, +the macro effects of evolution are attributable by the accumulated +result of beneficial microscopic mutations over many generations. + +The simplest and most common type of nucleic acid mutation is a point +mutation, which replaces one base with another at a single nucleotide. + +By counting the number of differences between two homologous DNA strands +taken from different genomes with a common ancestor, we get a measure of +the minimum number of point mutations that could have occurred on the +evolutionary path between the two strands. + +This is called the 'Hamming distance'. + +It is found by comparing two DNA strands and counting how many of the +nucleotides are different from their equivalent in the other string. + + GAGCCTACTAACGGGAT + CATCGTAATGACGGCCT + ^ ^ ^ ^ ^ ^^ + +The Hamming distance between these two DNA strands is 7. + +# Implementation notes + +The Hamming distance is only defined for sequences of equal length. This means +that based on the definition, each language could deal with getting sequences +of equal length differently. + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +The Calculating Point Mutations problem at Rosalind [http://rosalind.info/problems/hamm/](http://rosalind.info/problems/hamm/) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/hello-world/README.md b/exercises/hello-world/README.md new file mode 100644 index 00000000..b48498b5 --- /dev/null +++ b/exercises/hello-world/README.md @@ -0,0 +1,42 @@ +# Hello World + +The classical introductory exercise. Just say "Hello, World!". + +["Hello, World!"](http://en.wikipedia.org/wiki/%22Hello,_world!%22_program) is +the traditional first program for beginning programming in a new language +or environment. + +The objectives are simple: + +- Write a function that returns the string "Hello, World!". +- Run the test suite and make sure that it succeeds. +- Submit your solution and check it at the website. + +If everything goes well, you will be ready to fetch your first real exercise. + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +This is an exercise to introduce users to using Exercism [http://en.wikipedia.org/wiki/%22Hello,_world!%22_program](http://en.wikipedia.org/wiki/%22Hello,_world!%22_program) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/leap/README.md b/exercises/leap/README.md new file mode 100644 index 00000000..ee6776f7 --- /dev/null +++ b/exercises/leap/README.md @@ -0,0 +1,54 @@ +# Leap + +Given a year, report if it is a leap year. + +The tricky thing here is that a leap year in the Gregorian calendar occurs: + +```plain +on every year that is evenly divisible by 4 + except every year that is evenly divisible by 100 + unless the year is also evenly divisible by 400 +``` + +For example, 1997 is not a leap year, but 1996 is. 1900 is not a leap +year, but 2000 is. + +If your language provides a method in the standard library that does +this look-up, pretend it doesn't exist and implement it yourself. + +## Notes + +Though our exercise adopts some very simple rules, there is more to +learn! + +For a delightful, four minute explanation of the whole leap year +phenomenon, go watch [this youtube video][video]. + +[video]: http://www.youtube.com/watch?v=xX96xng7sAE + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +JavaRanch Cattle Drive, exercise 3 [http://www.javaranch.com/leap.jsp](http://www.javaranch.com/leap.jsp) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/minesweeper/README.md b/exercises/minesweeper/README.md new file mode 100644 index 00000000..8e4ad4af --- /dev/null +++ b/exercises/minesweeper/README.md @@ -0,0 +1,51 @@ +# Minesweeper + +Add the numbers to a minesweeper board. + +Minesweeper is a popular game where the user has to find the mines using +numeric hints that indicate how many mines are directly adjacent +(horizontally, vertically, diagonally) to a square. + +In this exercise you have to create some code that counts the number of +mines adjacent to a square and transforms boards like this (where `*` +indicates a mine): + + +-----+ + | * * | + | * | + | * | + | | + +-----+ + +into this: + + +-----+ + |1*3*1| + |13*31| + | 2*2 | + | 111 | + +-----+ + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/nucleotide-count/README.md b/exercises/nucleotide-count/README.md new file mode 100644 index 00000000..06aa8ab5 --- /dev/null +++ b/exercises/nucleotide-count/README.md @@ -0,0 +1,54 @@ +# Nucleotide Count + +Given a DNA string, compute how many times each nucleotide occurs in the string. + +DNA is represented by an alphabet of the following symbols: 'A', 'C', +'G', and 'T'. + +Each symbol represents a nucleotide, which is a fancy name for the +particular molecules that happen to make up a large part of DNA. + +Shortest intro to biochemistry EVAR: + +- twigs are to birds nests as +- nucleotides are to DNA and RNA as +- amino acids are to proteins as +- sugar is to starch as +- oh crap lipids + +I'm not going to talk about lipids because they're crazy complex. + +So back to nucleotides. + +DNA contains four types of them: adenine (`A`), cytosine (`C`), guanine +(`G`), and thymine (`T`). + +RNA contains a slightly different set of nucleotides, but we don't care +about that for now. + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +The Calculating DNA Nucleotides_problem at Rosalind [http://rosalind.info/problems/dna/](http://rosalind.info/problems/dna/) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/perfect-numbers/README.md b/exercises/perfect-numbers/README.md new file mode 100644 index 00000000..3636aeda --- /dev/null +++ b/exercises/perfect-numbers/README.md @@ -0,0 +1,45 @@ +# Perfect Numbers + +Determine if a number is perfect, abundant, or deficient based on +Nicomachus' (60 - 120 CE) classification scheme for natural numbers. + +The Greek mathematician [Nicomachus](https://en.wikipedia.org/wiki/Nicomachus) devised a classification scheme for natural numbers, identifying each as belonging uniquely to the categories of **perfect**, **abundant**, or **deficient** based on their [aliquot sum](https://en.wikipedia.org/wiki/Aliquot_sum). The aliquot sum is defined as the sum of the factors of a number not including the number itself. For example, the aliquot sum of 15 is (1 + 3 + 5) = 9 + +- **Perfect**: aliquot sum = number + - 6 is a perfect number because (1 + 2 + 3) = 6 + - 28 is a perfect number because (1 + 2 + 4 + 7 + 14) = 28 +- **Abundant**: aliquot sum > number + - 12 is an abundant number because (1 + 2 + 3 + 4 + 6) = 16 + - 24 is an abundant number because (1 + 2 + 3 + 4 + 6 + 8 + 12) = 36 +- **Deficient**: aliquot sum < number + - 8 is a deficient number because (1 + 2 + 4) = 7 + - Prime numbers are deficient + +Implement a way to determine whether a given number is **perfect**. Depending on your language track, you may also need to implement a way to determine whether a given number is **abundant** or **deficient**. + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +Taken from Chapter 2 of Functional Thinking by Neal Ford. [http://shop.oreilly.com/product/0636920029687.do](http://shop.oreilly.com/product/0636920029687.do) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/phone-number/README.md b/exercises/phone-number/README.md new file mode 100644 index 00000000..943128f4 --- /dev/null +++ b/exercises/phone-number/README.md @@ -0,0 +1,55 @@ +# Phone Number + +Clean up user-entered phone numbers so that they can be sent SMS messages. + +The **North American Numbering Plan (NANP)** is a telephone numbering system used by many countries in North America like the United States, Canada or Bermuda. All NANP-countries share the same international country code: `1`. + +NANP numbers are ten-digit numbers consisting of a three-digit Numbering Plan Area code, commonly known as *area code*, followed by a seven-digit local number. The first three digits of the local number represent the *exchange code*, followed by the unique four-digit number which is the *subscriber number*. + + +The format is usually represented as +``` +(NXX)-NXX-XXXX +``` +where `N` is any digit from 2 through 9 and `X` is any digit from 0 through 9. + +Your task is to clean up differently formated telephone numbers by removing punctuation and the country code (1) if present. + +For example, the inputs +- `+1 (613)-995-0253` +- `613-995-0253` +- `1 613 995 0253` +- `613.995.0253` + +should all produce the output + +`6139950253` + +**Note:** As this exercise only deals with telephone numbers used in NANP-countries, only 1 is considered a valid country code. + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +Event Manager by JumpstartLab [http://tutorials.jumpstartlab.com/projects/eventmanager.html](http://tutorials.jumpstartlab.com/projects/eventmanager.html) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/poker/README.md b/exercises/poker/README.md new file mode 100644 index 00000000..62dfb962 --- /dev/null +++ b/exercises/poker/README.md @@ -0,0 +1,33 @@ +# Poker + +Pick the best hand(s) from a list of poker hands. + +See [wikipedia](https://en.wikipedia.org/wiki/List_of_poker_hands) for an +overview of poker hands. + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +Inspired by the training course from Udacity. [https://www.udacity.com/course/viewer#!/c-cs212/](https://www.udacity.com/course/viewer#!/c-cs212/) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/raindrops/README.md b/exercises/raindrops/README.md new file mode 100644 index 00000000..6f0a12eb --- /dev/null +++ b/exercises/raindrops/README.md @@ -0,0 +1,45 @@ +# Raindrops + +Convert a number to a string, the contents of which depend on the number's factors. + +- If the number has 3 as a factor, output 'Pling'. +- If the number has 5 as a factor, output 'Plang'. +- If the number has 7 as a factor, output 'Plong'. +- If the number does not have 3, 5, or 7 as a factor, + just pass the number's digits straight through. + +## Examples + +- 28's factors are 1, 2, 4, **7**, 14, 28. + - In raindrop-speak, this would be a simple "Plong". +- 30's factors are 1, 2, **3**, **5**, 6, 10, 15, 30. + - In raindrop-speak, this would be a "PlingPlang". +- 34 has four factors: 1, 2, 17, and 34. + - In raindrop-speak, this would be "34". + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +A variation on a famous interview question intended to weed out potential candidates. [http://jumpstartlab.com](http://jumpstartlab.com) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/rna-transcription/README.md b/exercises/rna-transcription/README.md new file mode 100644 index 00000000..cc46c19f --- /dev/null +++ b/exercises/rna-transcription/README.md @@ -0,0 +1,46 @@ +# Rna Transcription + +Given a DNA strand, return its RNA complement (per RNA transcription). + +Both DNA and RNA strands are a sequence of nucleotides. + +The four nucleotides found in DNA are adenine (**A**), cytosine (**C**), +guanine (**G**) and thymine (**T**). + +The four nucleotides found in RNA are adenine (**A**), cytosine (**C**), +guanine (**G**) and uracil (**U**). + +Given a DNA strand, its transcribed RNA strand is formed by replacing +each nucleotide with its complement: + +* `G` -> `C` +* `C` -> `G` +* `T` -> `A` +* `A` -> `U` + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +Rosalind [http://rosalind.info/problems/rna](http://rosalind.info/problems/rna) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/roman-numerals/README.md b/exercises/roman-numerals/README.md new file mode 100644 index 00000000..99e81e0c --- /dev/null +++ b/exercises/roman-numerals/README.md @@ -0,0 +1,70 @@ +# Roman Numerals + +Write a function to convert from normal numbers to Roman Numerals. + +The Romans were a clever bunch. They conquered most of Europe and ruled +it for hundreds of years. They invented concrete and straight roads and +even bikinis. One thing they never discovered though was the number +zero. This made writing and dating extensive histories of their exploits +slightly more challenging, but the system of numbers they came up with +is still in use today. For example the BBC uses Roman numerals to date +their programmes. + +The Romans wrote numbers using letters - I, V, X, L, C, D, M. (notice +these letters have lots of straight lines and are hence easy to hack +into stone tablets). + +``` + 1 => I +10 => X + 7 => VII +``` + +There is no need to be able to convert numbers larger than about 3000. +(The Romans themselves didn't tend to go any higher) + +Wikipedia says: Modern Roman numerals ... are written by expressing each +digit separately starting with the left most digit and skipping any +digit with a value of zero. + +To see this in practice, consider the example of 1990. + +In Roman numerals 1990 is MCMXC: + +1000=M +900=CM +90=XC + +2008 is written as MMVIII: + +2000=MM +8=VIII + +See also: http://www.novaroma.org/via_romana/numbers.html + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +The Roman Numeral Kata [http://codingdojo.org/cgi-bin/index.pl?KataRomanNumerals](http://codingdojo.org/cgi-bin/index.pl?KataRomanNumerals) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/saddle-points/README.md b/exercises/saddle-points/README.md new file mode 100644 index 00000000..eef9c88f --- /dev/null +++ b/exercises/saddle-points/README.md @@ -0,0 +1,54 @@ +# Saddle Points + +Detect saddle points in a matrix. + +So say you have a matrix like so: + +```plain + 0 1 2 + |--------- +0 | 9 8 7 +1 | 5 3 2 <--- saddle point at (1,0) +2 | 6 6 7 +``` + +It has a saddle point at (1, 0). + +It's called a "saddle point" because it is greater than or equal to +every element in its row and the less than or equal to every element in +its column. + +A matrix may have zero or more saddle points. + +Your code should be able to provide the (possibly empty) list of all the +saddle points for any given matrix. + +Note that you may find other definitions of matrix saddle points online, +but the tests for this exercise follow the above unambiguous definition. + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +J Dalbey's Programming Practice problems [http://users.csc.calpoly.edu/~jdalbey/103/Projects/ProgrammingPractice.html](http://users.csc.calpoly.edu/~jdalbey/103/Projects/ProgrammingPractice.html) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/triangle/README.md b/exercises/triangle/README.md new file mode 100644 index 00000000..8a3d2fd4 --- /dev/null +++ b/exercises/triangle/README.md @@ -0,0 +1,47 @@ +# Triangle + +Determine if a triangle is equilateral, isosceles, or scalene. + +An _equilateral_ triangle has all three sides the same length.
+An _isosceles_ triangle has at least two sides the same length. (It is sometimes +specified as having exactly two sides the same length, but for the purposes of +this exercise we'll say at least two.)
+A _scalene_ triangle has all sides of different lengths. + +## Note + +For a shape to be a triangle at all, all sides have to be of length > 0, and +the sum of the lengths of any two sides must be greater than or equal to the +length of the third side. See [Triangle Inequality](https://en.wikipedia.org/wiki/Triangle_inequality). + +## Dig Deeper + +The case where the sum of the lengths of two sides _equals_ that of the +third is known as a _degenerate_ triangle - it has zero area and looks like +a single line. Feel free to add your own code/tests to check for degenerate triangles. +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +The Ruby Koans triangle project, parts 1 & 2 [http://rubykoans.com](http://rubykoans.com) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/two-fer/README.md b/exercises/two-fer/README.md new file mode 100644 index 00000000..bfc71b2d --- /dev/null +++ b/exercises/two-fer/README.md @@ -0,0 +1,69 @@ +# Two Fer + +`Two-fer` or `2-fer` is short for two for one. One for you and one for me. + +``` +"One for X, one for me." +``` + +When X is a name or "you". + +If the given name is "Alice", the result should be "One for Alice, one for me." +If no name is given, the result should be "One for you, one for me." + + +## Test-Driven Development + +As programmers mature, they eventually want to test their code. + +Here at Exercism we simulate [Test-Driven +Development](http://en.wikipedia.org/wiki/Test-driven_development) (TDD), where +you write your tests before writing any functionality. The simulation comes in +the form of a pre-written test suite, which will signal that you have solved +the problem. + +It will also provide you with a safety net to explore other solutions without +breaking the functionality. + +### A typical TDD workflow on Exercism: + +1. Run the test file and pick one test that's failing. +2. Write some code to fix the test you picked. +3. Re-run the tests to confirm the test is now passing. +4. Repeat from step 1. +5. Submit your solution (`exercism submit /path/to/file`) + +## Instructions + +Submissions are encouraged to be general, within reason. Having said that, it's +also important not to over-engineer a solution. + +It's important to remember that the goal is to make code as expressive and +readable as we can. + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +This is an exercise to introduce users to basic programming constructs, just after hello World. [https://en.wikipedia.org/wiki/Two-fer](https://en.wikipedia.org/wiki/Two-fer) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/wordy/README.md b/exercises/wordy/README.md new file mode 100644 index 00000000..8f80255b --- /dev/null +++ b/exercises/wordy/README.md @@ -0,0 +1,84 @@ +# Wordy + +Parse and evaluate simple math word problems returning the answer as an integer. + + +## Iteration 1 — Addition + +Add two numbers together. + +> What is 5 plus 13? + +Evaluates to 18. + +Handle large numbers and negative numbers. + + +## Iteration 2 — Subtraction, Multiplication and Division + +Now, perform the other three operations. + +> What is 7 minus 5? + +2 + +> What is 6 multiplied by 4? + +24 + +> What is 25 divided by 5? + +5 + + +## Iteration 3 — Multiple Operations + +Handle a set of operations, in sequence. + +Since these are verbal word problems, evaluate the expression from +left-to-right, _ignoring the typical order of operations._ + +> What is 5 plus 13 plus 6? + +24 + +> What is 3 plus 2 multiplied by 3? + +15 (i.e. not 9) + + +## Bonus — Exponentials + +If you'd like, handle exponentials. + +> What is 2 raised to the 5th power? + +32 + + +## Testing + +In order to run the tests for this track, you will need to install +DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information. + +### Loading Exercises into Delphi + +If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project. + +Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu. + +### When Questions Come Up +We monitor the [Pascal-Delphi](https://gitter.im/exercism/Pascal-Delphi) support room on [gitter.im](https://gitter.im) to help you with any questions that might arise. + +### Submitting Exercises + +Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/` directory. + +For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit /delphi/bob/ubob.pas`. + +## Source + +Inspired by one of the generated questions in the Extreme Startup game. [https://github.com/rchatley/extreme_startup](https://github.com/rchatley/extreme_startup) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise.