diff --git a/concepts/arrays/about.md b/concepts/arrays/about.md index 0950a5960..812afecb6 100644 --- a/concepts/arrays/about.md +++ b/concepts/arrays/about.md @@ -1,3 +1,5 @@ +# About + An [`array`][arrays] in F# is a mutable collection of zero or more values with a fixed length. This means that once an array has been created, its size cannot change, but its values can. The values in an array must all have the same type. [Arrays can be defined as follows][creating-arrays]: ```fsharp diff --git a/concepts/arrays/introduction.md b/concepts/arrays/introduction.md index dd1e3a494..1161fd48b 100644 --- a/concepts/arrays/introduction.md +++ b/concepts/arrays/introduction.md @@ -1,3 +1,5 @@ +# Introduction + An `array` in F# is a mutable collection of zero or more values with a fixed length. This means that once an array has been created, its size cannot change, but its values can. The values in an array must all have the same type. Arrays can be defined as follows: ```fsharp diff --git a/concepts/basics/about.md b/concepts/basics/about.md index fed09bcca..d5271df44 100644 --- a/concepts/basics/about.md +++ b/concepts/basics/about.md @@ -1,3 +1,5 @@ +# About + In F#, everything that has a type and can be defined is known as a _value_. That includes booleans, integers and lists, but also functions. Integer values are defined as one or more (consecutive) digits and support the [default mathematical operators][operators]. Assigning a value to a name is referred to as a _binding_. [Bindings][bindings] are immutable, which makes them similar to constants in other languages. Bindings are defined using the `let` keyword. diff --git a/concepts/basics/introduction.md b/concepts/basics/introduction.md index 759e5b483..60bc25383 100644 --- a/concepts/basics/introduction.md +++ b/concepts/basics/introduction.md @@ -1,3 +1,5 @@ +# Introduction + In F#, assigning a value to a name is referred to as a _binding_. Bindings are immutable, which makes them similar to constants in other languages. As F# is a statically-typed language, each binding has a type at compile-time. Bindings are defined using the `let` keyword. Specifying a binding's type is optional for most bindings, as F#'s _type inference_ can usually infer the type based on their value. A binding looks like this: diff --git a/concepts/booleans/about.md b/concepts/booleans/about.md index 6e8fe54ad..6b3690f51 100644 --- a/concepts/booleans/about.md +++ b/concepts/booleans/about.md @@ -1,3 +1,5 @@ +# About + Booleans in F# are represented by the `bool` type, which values can be either `true` or `false`. F# supports three [boolean operators][operators]: `not` (NOT), `&&` (AND), and `||` (OR). The `&&` and `||` operators use _short-circuit evaluation_, which means that the right-hand side of the operator is only evaluated when needed. diff --git a/concepts/booleans/introduction.md b/concepts/booleans/introduction.md index 233d49dac..be6ea1aac 100644 --- a/concepts/booleans/introduction.md +++ b/concepts/booleans/introduction.md @@ -1,3 +1,5 @@ +# Introduction + Booleans in F# are represented by the `bool` type, which values can be either `true` or `false`. F# supports three boolean operators: `not` (NOT), `&&` (AND), and `||` (OR). diff --git a/concepts/classes/about.md b/concepts/classes/about.md index 608d2f539..1b0197980 100644 --- a/concepts/classes/about.md +++ b/concepts/classes/about.md @@ -1 +1,3 @@ +# About + TODO: add information on classes concept diff --git a/concepts/classes/introduction.md b/concepts/classes/introduction.md index cacf37183..69919723e 100644 --- a/concepts/classes/introduction.md +++ b/concepts/classes/introduction.md @@ -1 +1,3 @@ +# Introduction + TODO: add introduction for classes concept diff --git a/concepts/conditionals/about.md b/concepts/conditionals/about.md index 2ae908c93..6bd5240f1 100644 --- a/concepts/conditionals/about.md +++ b/concepts/conditionals/about.md @@ -1,3 +1,5 @@ +# About + Conditionally executing code can be done using [`if/elif/else` expressions][conditional-expression]. The condition(s) used in an `if/elif/else` expression must be of type `bool`. F# has no concept of _truthy_ values. ```fsharp diff --git a/concepts/conditionals/introduction.md b/concepts/conditionals/introduction.md index 77d1f98ea..1bd09a1c8 100644 --- a/concepts/conditionals/introduction.md +++ b/concepts/conditionals/introduction.md @@ -1,3 +1,5 @@ +# Introduction + In this exercise you must conditionally execute logic. The most common way to do this in F# is by using an `if/elif/else` statement: ```fsharp diff --git a/concepts/datetimes/about.md b/concepts/datetimes/about.md index d425a6cad..3076f2c7c 100644 --- a/concepts/datetimes/about.md +++ b/concepts/datetimes/about.md @@ -1,3 +1,5 @@ +# About + A `DateTime` in F# is an immutable object that contains both date _and_ time information. The date and time information can be accessed through its built-in [properties][properties]. Manipulating a `DateTime` can be done by calling one of its [methods][methods]. As `DateTime` values can never change after having been defined, all methods that appear to modify a `DateTime` will actually return a new `DateTime`. diff --git a/concepts/datetimes/introduction.md b/concepts/datetimes/introduction.md index f15dcdd02..bebd91521 100644 --- a/concepts/datetimes/introduction.md +++ b/concepts/datetimes/introduction.md @@ -1,3 +1,5 @@ +# Introduction + A `DateTime` in F# is an immutable object that contains both date _and_ time information. `DateTime` instances are manipulated by calling their methods. Once a `DateTime` has been constructed, its value can never change. Any methods/functions that appear to modify a `DateTime` will actually return a new `DateTime`. The textual representation of dates and times is dependent on the _culture_. Consider a `DateTime` with its date set to March 28 2019 and its time set to 14:30:59. Converting this `DateTime` to a `string` when using the `en-US` culture (American English) returns `"3/28/19 2:30:59 PM"`. When using the `fr-BE` culture (Belgian French), the same code returns a different value: `"28/03/19 14:30:59"`. diff --git a/concepts/discriminated-unions/about.md b/concepts/discriminated-unions/about.md index b8fba1731..9a7cff657 100644 --- a/concepts/discriminated-unions/about.md +++ b/concepts/discriminated-unions/about.md @@ -1,3 +1,5 @@ +# About + The [discriminated union][define] type represents a fixed number of named cases. Each value of a discriminated union corresponds to exactly one of the named cases. This type of data type is known as a _sum type_. Each case of a discriminated union can optionally have data associated with it, and different cases can have different types of data. If none of the cases have data associated with them, the discriminated union is similar to what other languages usually refer to as an _enumeration_ (or _enum_). diff --git a/concepts/discriminated-unions/introduction.md b/concepts/discriminated-unions/introduction.md index 443ac1f4a..badbaf16f 100644 --- a/concepts/discriminated-unions/introduction.md +++ b/concepts/discriminated-unions/introduction.md @@ -1,3 +1,5 @@ +# Introduction + The discriminated union type represents a fixed number of named cases. Each value of a discriminated union corresponds to exactly one of the named cases. A discriminated union is defined using the `type` keyword, with cases separated by pipe (`|`) characters: diff --git a/concepts/floating-point-numbers/about.md b/concepts/floating-point-numbers/about.md index 5bc91c9a3..bb7095d6b 100644 --- a/concepts/floating-point-numbers/about.md +++ b/concepts/floating-point-numbers/about.md @@ -1,3 +1,5 @@ +# About + A floating-point number is a number with zero or more digits behind the decimal separator. Examples are `-2.4`, `0.1`, `3.14`, `16.984025` and `1024.0`. F# has three floating-point types: diff --git a/concepts/floating-point-numbers/introduction.md b/concepts/floating-point-numbers/introduction.md index 7f41d708f..01629e0dd 100644 --- a/concepts/floating-point-numbers/introduction.md +++ b/concepts/floating-point-numbers/introduction.md @@ -1,3 +1,5 @@ +# Introduction + A floating-point number is a number with zero or more digits behind the decimal separator. Examples are `-2.4`, `0.1`, `3.14`, `16.984025` and `1024.0`. F# has three floating-point types: diff --git a/concepts/higher-order-functions/about.md b/concepts/higher-order-functions/about.md index 68b793e4a..744b4bc12 100644 --- a/concepts/higher-order-functions/about.md +++ b/concepts/higher-order-functions/about.md @@ -1 +1,3 @@ +# About + TODO: add information on higher-order-functions concept diff --git a/concepts/higher-order-functions/introduction.md b/concepts/higher-order-functions/introduction.md index 82b116e46..9bbce60cf 100644 --- a/concepts/higher-order-functions/introduction.md +++ b/concepts/higher-order-functions/introduction.md @@ -1 +1,3 @@ +# Introduction + TODO: add introduction for higher-order-functions concept diff --git a/concepts/lists/about.md b/concepts/lists/about.md index 3b65efed8..2ec1ecccc 100644 --- a/concepts/lists/about.md +++ b/concepts/lists/about.md @@ -1,3 +1,5 @@ +# About + A [`list`][lists] in F# is an immutable collection of zero or more values. The values in a list must all have the same type. As lists are immutable, once a list has been constructed, its value can never change. F# list have a _head_ (the first element) and a _tail_ (everything after the first element). The tail of a list is itself a list. Lists can be defined as follows: diff --git a/concepts/lists/introduction.md b/concepts/lists/introduction.md index b50d2cc58..193f05eca 100644 --- a/concepts/lists/introduction.md +++ b/concepts/lists/introduction.md @@ -1,3 +1,5 @@ +# Introduction + A `list` in F# is an immutable collection of zero or more values. The values in a list must all have the same type. As lists are immutable, once a list has been constructed, its value can never change. Any functions/operators that appear to modify a list (such as adding an element), will actually return a new list. Lists can be defined as follows: diff --git a/concepts/numbers/about.md b/concepts/numbers/about.md index 2d56851d5..c861ca78d 100644 --- a/concepts/numbers/about.md +++ b/concepts/numbers/about.md @@ -1,3 +1,5 @@ +# About + One of the key aspects of working with numbers in F# is the distinction between integers (numbers with no digits after the decimal separator) and floating-point numbers (numbers with zero or more digits after the decimal separator). The two most commonly used numeric types in F# are `int` (a 32-bit integer) and `float` (a 64-bit floating-point number). diff --git a/concepts/numbers/introduction.md b/concepts/numbers/introduction.md index 5ee39ca6d..7a4669081 100644 --- a/concepts/numbers/introduction.md +++ b/concepts/numbers/introduction.md @@ -1,3 +1,5 @@ +# Introduction + There are two different types of numbers in F#: - Integers: numbers with no digits behind the decimal separator (whole numbers). Examples are `-6`, `0`, `1`, `25`, `976` and `500000`. diff --git a/concepts/pattern-matching/about.md b/concepts/pattern-matching/about.md index 93a3e806a..b2fcae795 100644 --- a/concepts/pattern-matching/about.md +++ b/concepts/pattern-matching/about.md @@ -1,3 +1,5 @@ +# About + An `if/elif/else` expression can be used to conditionally execute logic. F# also has another, more powerful way to conditionally execute logic: [pattern matching][pattern-matching]. With pattern matching, a value can be tested against one or more _patterns_. An example of such a pattern is the [_constant pattern_][constant-pattern], which matches a value against a constant (e.g. `1` or `"hello"`). In F#, pattern matching is done through the `match` keyword: diff --git a/concepts/pattern-matching/introduction.md b/concepts/pattern-matching/introduction.md index 6c2e7a8cd..0f4f7698f 100644 --- a/concepts/pattern-matching/introduction.md +++ b/concepts/pattern-matching/introduction.md @@ -1,3 +1,5 @@ +# Introduction + An `if/elif/else` expression can be used to conditionally execute logic. F# also has another, more powerful way to conditionally execute logic: pattern matching. With pattern matching, a value can be tested against one or more _patterns_. An example of such a pattern is the _constant pattern_, which matches a value against a constant (e.g. `1` or `"hello"`). In F#, pattern matching is done through the `match` keyword: diff --git a/concepts/records/about.md b/concepts/records/about.md index 49f73d232..90936a3c1 100644 --- a/concepts/records/about.md +++ b/concepts/records/about.md @@ -1,3 +1,5 @@ +# About + A [record][records] is a collection of fields (which can be of different types) that belong together. To [define a record][define] the `type` keyword is used. A record's fields are defined between `{` and `}` characters, and each field has a name _and_ a type. ```fsharp diff --git a/concepts/records/introduction.md b/concepts/records/introduction.md index 3dd816203..85fae2430 100644 --- a/concepts/records/introduction.md +++ b/concepts/records/introduction.md @@ -1,3 +1,5 @@ +# Introduction + A record is a collection of fields (which can be of different types) that belong together. To define a record the `type` keyword is used. A record's fields are defined between `{` and `}` characters, and each field has a name _and_ a type. To create a record, specify the names of the fields and assign a value to them between `{` and `}` characters. All fields must be assigned a value when creating a record. A record instance's field values can be accessed using dot-notation. When defining/create a record, each field must either be on a separate line or separated by semicolons (`;`) when on a single line. diff --git a/concepts/recursion/about.md b/concepts/recursion/about.md index acce64e06..3ece337f6 100644 --- a/concepts/recursion/about.md +++ b/concepts/recursion/about.md @@ -1,3 +1,5 @@ +# About + The ability for something to be defined in terms of itself is called recursion. In F#, recursion is most commonly found in [recursive functions][recursive-functions], which are functions that call themselves. A recursive function needs to have at least one _base case_ and at least one _recursive case_. A _base case_ returns a value without calling the function again. A _recursive case_ calls the function again, modifying the input so that it will at some point match the base case. diff --git a/concepts/recursion/introduction.md b/concepts/recursion/introduction.md index 321019894..2820328d5 100644 --- a/concepts/recursion/introduction.md +++ b/concepts/recursion/introduction.md @@ -1,3 +1,5 @@ +# Introduction + The ability for something to be defined in terms of itself is called recursion. In F#, recursion is most commonly found in recursive functions, which are functions that call themselves. A recursive function needs to have at least one _base case_ and at least one _recursive case_. A _base case_ returns a value without calling the function again. A _recursive case_ calls the function again, modifying the input so that it will at some point match the base case. diff --git a/concepts/strings/about.md b/concepts/strings/about.md index 3d16377f1..1ce432b72 100644 --- a/concepts/strings/about.md +++ b/concepts/strings/about.md @@ -1,3 +1,5 @@ +# About + F# strings are immutable objects representing text as a sequence of Unicode characters (letters, digits, punctuation, etc.). Double quotes are used to define a `string` instance: ```fsharp diff --git a/concepts/strings/introduction.md b/concepts/strings/introduction.md index 5150f630e..e6bf04a1a 100644 --- a/concepts/strings/introduction.md +++ b/concepts/strings/introduction.md @@ -1,3 +1,5 @@ +# Introduction + A `string` in F# is an object that represents immutable text as a sequence of Unicode characters (letters, digits, punctuation, etc.) and is defined as follows: ```fsharp diff --git a/config.json b/config.json index c2afd9c21..638ce0ca9 100644 --- a/config.json +++ b/config.json @@ -177,6 +177,7 @@ "slug": "hello-world", "name": "Hello World", "uuid": "302312cc-bd15-4ba0-8f2f-cbf411c40186", + "practices": [], "prerequisites": [], "difficulty": 1, "topics": [ @@ -187,6 +188,7 @@ "slug": "two-fer", "name": "Two Fer", "uuid": "2ee3cc7a-db3f-4668-9983-ed6d0fea95d1", + "practices": [], "prerequisites": [], "difficulty": 1, "topics": [ @@ -198,6 +200,7 @@ "slug": "leap", "name": "Leap", "uuid": "66d974b5-18fc-4993-b5f2-7beda4f4afa3", + "practices": [], "prerequisites": [], "difficulty": 1, "topics": [ @@ -209,6 +212,7 @@ "slug": "queen-attack", "name": "Queen Attack", "uuid": "528a0023-8687-4524-8318-516d1e432d0d", + "practices": [], "prerequisites": [], "difficulty": 3, "topics": [ @@ -219,6 +223,7 @@ "slug": "raindrops", "name": "Raindrops", "uuid": "0c953a84-e726-4b9f-a964-1950ac2f95f2", + "practices": [], "prerequisites": [], "difficulty": 2, "topics": [ @@ -230,6 +235,7 @@ "slug": "accumulate", "name": "Accumulate", "uuid": "e7085050-1611-4773-9032-0e0ffb56c20e", + "practices": [], "prerequisites": [], "difficulty": 2, "topics": [ @@ -241,6 +247,7 @@ "slug": "space-age", "name": "Space Age", "uuid": "277d05db-0ba0-4de6-b5f8-090c251afffc", + "practices": [], "prerequisites": [], "difficulty": 1, "topics": [ @@ -252,6 +259,7 @@ "slug": "grade-school", "name": "Grade School", "uuid": "cf058dc8-db6f-4034-ac5b-22f1d8d0decc", + "practices": [], "prerequisites": [], "difficulty": 2, "topics": [ @@ -263,6 +271,7 @@ "slug": "clock", "name": "Clock", "uuid": "30c3a38e-1e44-4711-887e-fca301c26c1b", + "practices": [], "prerequisites": [], "difficulty": 3, "topics": [ @@ -274,6 +283,7 @@ "slug": "bob", "name": "Bob", "uuid": "b3c4d578-10c8-47bc-b0ae-149ed8da530a", + "practices": [], "prerequisites": [], "difficulty": 1, "topics": [ @@ -285,6 +295,7 @@ "slug": "beer-song", "name": "Beer Song", "uuid": "0ea0d92f-5510-4ba9-b419-3f5ad029b74f", + "practices": [], "prerequisites": [], "difficulty": 3, "topics": [ @@ -296,6 +307,7 @@ "slug": "kindergarten-garden", "name": "Kindergarten Garden", "uuid": "cf64cddf-63e2-4c71-ac15-0af617f82856", + "practices": [], "prerequisites": [], "difficulty": 3, "topics": [ @@ -307,6 +319,7 @@ "slug": "robot-simulator", "name": "Robot Simulator", "uuid": "ecae4faa-c516-4a71-8d55-9c53403d8826", + "practices": [], "prerequisites": [], "difficulty": 3, "topics": [ @@ -318,6 +331,7 @@ "slug": "allergies", "name": "Allergies", "uuid": "221dff26-0495-4d4b-9363-14a5d7263271", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -330,6 +344,7 @@ "slug": "ocr-numbers", "name": "Ocr Numbers", "uuid": "eca7e334-f549-4601-a515-9d1467d3d0ea", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -341,6 +356,7 @@ "slug": "pig-latin", "name": "Pig Latin", "uuid": "a002e3db-8e9c-4cbf-b00f-f2090bae5d5a", + "practices": [], "prerequisites": [], "difficulty": 6, "topics": [ @@ -352,6 +368,7 @@ "slug": "hamming", "name": "Hamming", "uuid": "1dadf8c0-b15c-413f-987e-187d043910f0", + "practices": [], "prerequisites": [], "difficulty": 2, "topics": [ @@ -363,6 +380,7 @@ "slug": "pangram", "name": "Pangram", "uuid": "dc133087-0548-49b4-8f17-0c26cf53bcdf", + "practices": [], "prerequisites": [], "difficulty": 2, "topics": [ @@ -373,6 +391,7 @@ "slug": "isogram", "name": "Isogram", "uuid": "61404a27-62c3-43dc-93b7-7e4547e0a0d9", + "practices": [], "prerequisites": [], "difficulty": 3, "topics": [ @@ -384,6 +403,7 @@ "slug": "twelve-days", "name": "Twelve Days", "uuid": "89cd6eb1-9671-42bd-a619-59013fb721b0", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -395,6 +415,7 @@ "slug": "phone-number", "name": "Phone Number", "uuid": "929f98e4-a16c-464b-ac6c-59ca86dbd2b6", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -406,6 +427,7 @@ "slug": "high-scores", "name": "High Scores", "uuid": "c67d7118-2388-4421-baa1-cc3e4f0e2867", + "practices": [], "prerequisites": [], "difficulty": 2, "topics": [ @@ -417,6 +439,7 @@ "slug": "bank-account", "name": "Bank Account", "uuid": "cb629d30-0351-4023-bd51-423267164c24", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -428,6 +451,7 @@ "slug": "binary-search-tree", "name": "Binary Search Tree", "uuid": "4e786e56-2658-445f-ac91-64dd9c38dbb3", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -440,6 +464,7 @@ "slug": "pov", "name": "Pov", "uuid": "a6082751-98ca-45dc-aeed-cdd19a8da0ca", + "practices": [], "prerequisites": [], "difficulty": 10, "topics": [ @@ -452,6 +477,7 @@ "slug": "zipper", "name": "Zipper", "uuid": "5369eea9-00c8-4044-b272-1ce8d0590ecf", + "practices": [], "prerequisites": [], "difficulty": 10, "topics": [ @@ -464,6 +490,7 @@ "slug": "darts", "name": "Darts", "uuid": "fb3b73e1-673b-4907-821c-f85a157f53c1", + "practices": [], "prerequisites": [], "difficulty": 2, "topics": [ @@ -475,6 +502,7 @@ "slug": "grains", "name": "Grains", "uuid": "e3751098-5a15-4350-bf5d-507583de3386", + "practices": [], "prerequisites": [], "difficulty": 2, "topics": [ @@ -485,6 +513,7 @@ "slug": "all-your-base", "name": "All Your Base", "uuid": "01e394ee-23d5-44e6-a37e-149ffaf5375e", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -497,6 +526,7 @@ "slug": "largest-series-product", "name": "Largest Series Product", "uuid": "b3643992-583b-4e7a-a970-94bc7ae6739a", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -510,6 +540,7 @@ "slug": "complex-numbers", "name": "Complex Numbers", "uuid": "d993508d-b4d2-4f3f-a46d-35b753bf90a9", + "practices": [], "prerequisites": [], "difficulty": 6, "topics": [ @@ -520,6 +551,7 @@ "slug": "nth-prime", "name": "Nth Prime", "uuid": "220cbe7e-e781-4ab9-84ec-2b89a3c97670", + "practices": [], "prerequisites": [], "difficulty": 6, "topics": [ @@ -530,6 +562,7 @@ "slug": "rational-numbers", "name": "Rational Numbers", "uuid": "913ce020-32ae-4b65-ae64-c924d25295dc", + "practices": [], "prerequisites": [], "difficulty": 6, "topics": [ @@ -540,6 +573,7 @@ "slug": "diffie-hellman", "name": "Diffie Hellman", "uuid": "2a7e3e78-ab94-40f3-8f16-1d5aa84c2f85", + "practices": [], "prerequisites": [], "difficulty": 7, "topics": [ @@ -553,6 +587,7 @@ "slug": "custom-set", "name": "Custom Set", "uuid": "ecee74aa-41f5-42aa-b99e-31e9589378e3", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -563,6 +598,7 @@ "slug": "run-length-encoding", "name": "Run Length Encoding", "uuid": "0a10cd0b-ea37-4c78-a6a4-223203ac1c37", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -574,6 +610,7 @@ "slug": "palindrome-products", "name": "Palindrome Products", "uuid": "471c89f9-8b27-4898-8e98-58e4b2921616", + "practices": [], "prerequisites": [], "difficulty": 6, "topics": [ @@ -587,6 +624,7 @@ "slug": "word-search", "name": "Word Search", "uuid": "8f8a79d1-78ed-4cdd-adcc-5cd6c6781dcd", + "practices": [], "prerequisites": [], "difficulty": 6, "topics": [ @@ -599,6 +637,7 @@ "slug": "dominoes", "name": "Dominoes", "uuid": "f09d34d3-f12c-4c9a-9083-68172478278e", + "practices": [], "prerequisites": [], "difficulty": 7, "topics": [ @@ -610,6 +649,7 @@ "slug": "sieve", "name": "Sieve", "uuid": "a6511471-bc2c-4734-92fe-c6c5cf447efd", + "practices": [], "prerequisites": [], "difficulty": 3, "topics": [ @@ -621,6 +661,7 @@ "slug": "strain", "name": "Strain", "uuid": "48ac8887-28db-4566-a415-c2d338dea104", + "practices": [], "prerequisites": [], "difficulty": 3, "topics": [ @@ -632,6 +673,7 @@ "slug": "robot-name", "name": "Robot Name", "uuid": "3fbd466a-caf4-48ac-9a1e-796bc406ff1e", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -643,6 +685,7 @@ "slug": "food-chain", "name": "Food Chain", "uuid": "f4dee9ea-fcdf-4623-8ae1-13bdf995f2cb", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -654,6 +697,7 @@ "slug": "grep", "name": "Grep", "uuid": "da48b422-1c23-4272-87a4-415620d4e857", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -666,6 +710,7 @@ "slug": "ledger", "name": "Ledger", "uuid": "e860ad86-cd1f-474b-9e8e-d8a72ff4315c", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -678,6 +723,7 @@ "slug": "list-ops", "name": "List Ops", "uuid": "47602465-a92d-43a5-9e9a-8ef09ce2104d", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -689,6 +735,7 @@ "slug": "pascals-triangle", "name": "Pascals Triangle", "uuid": "fef76c19-db3c-442d-b2f5-b0dfae19ee43", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -701,6 +748,7 @@ "slug": "book-store", "name": "Book Store", "uuid": "3741977a-adff-47bb-a9c5-c2e444805bac", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -711,6 +759,7 @@ "slug": "roman-numerals", "name": "Roman Numerals", "uuid": "2e88193d-9f80-4d83-901b-bb5ac4b0804c", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -722,6 +771,7 @@ "slug": "change", "name": "Change", "uuid": "03a1c773-5c48-4f70-a2de-b742197fa9d2", + "practices": [], "prerequisites": [], "difficulty": 7, "topics": [ @@ -733,6 +783,7 @@ "slug": "armstrong-numbers", "name": "Armstrong Numbers", "uuid": "e7f74f6c-16ea-40d8-94f7-7034bc6ee938", + "practices": [], "prerequisites": [], "difficulty": 2, "topics": [ @@ -744,6 +795,7 @@ "slug": "collatz-conjecture", "name": "Collatz Conjecture", "uuid": "8b66e691-508f-40d9-8cee-1d6aec27366e", + "practices": [], "prerequisites": [], "difficulty": 2, "topics": [ @@ -758,6 +810,7 @@ "slug": "binary-search", "name": "Binary Search", "uuid": "c5b38251-14ba-4d98-a420-7a930f06167f", + "practices": [], "prerequisites": [], "difficulty": 3, "topics": [ @@ -769,6 +822,7 @@ "slug": "error-handling", "name": "Error Handling", "uuid": "fc7935f9-bffa-4eb1-b447-49379b45aac7", + "practices": [], "prerequisites": [], "difficulty": 3, "topics": [ @@ -781,6 +835,7 @@ "slug": "perfect-numbers", "name": "Perfect Numbers", "uuid": "45fcf742-1b3a-422a-b476-5ee81d80057a", + "practices": [], "prerequisites": [], "difficulty": 3, "topics": [ @@ -793,6 +848,7 @@ "slug": "protein-translation", "name": "Protein Translation", "uuid": "612395a5-238e-4be0-8ce0-4ac66f57056e", + "practices": [], "prerequisites": [], "difficulty": 3, "topics": [ @@ -805,6 +861,7 @@ "slug": "triangle", "name": "Triangle", "uuid": "47fd8f98-20d3-43fe-825f-27745e13908d", + "practices": [], "prerequisites": [], "difficulty": 3, "topics": [ @@ -815,6 +872,7 @@ "slug": "saddle-points", "name": "Saddle Points", "uuid": "526fc5b4-e96b-419a-8987-9b78e9bddc19", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -826,6 +884,7 @@ "slug": "simple-linked-list", "name": "Simple Linked List", "uuid": "e86e88a0-802c-41f4-b2a1-c7a81b8e87de", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -836,6 +895,7 @@ "slug": "linked-list", "name": "Linked List", "uuid": "253f040d-35c2-4e1c-8651-d7a7410d7d0d", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -846,6 +906,7 @@ "slug": "yacht", "name": "Yacht", "uuid": "005721ef-264e-4f81-ae63-ae72b0e5310f", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -858,6 +919,7 @@ "slug": "poker", "name": "Poker", "uuid": "411b93d0-214d-4d46-9081-16b9dd376174", + "practices": [], "prerequisites": [], "difficulty": 8, "topics": [ @@ -871,6 +933,7 @@ "slug": "etl", "name": "Etl", "uuid": "95e592a8-6663-4b07-894a-86a5cc310c67", + "practices": [], "prerequisites": [], "difficulty": 2, "topics": [ @@ -882,6 +945,7 @@ "slug": "nucleotide-count", "name": "Nucleotide Count", "uuid": "e6f92e96-b26a-4eba-8759-e8976a8a9097", + "practices": [], "prerequisites": [], "difficulty": 2, "topics": [ @@ -893,6 +957,7 @@ "slug": "word-count", "name": "Word Count", "uuid": "0c7a2f06-1e53-4043-9e1a-386e90e945b4", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -905,6 +970,7 @@ "slug": "scrabble-score", "name": "Scrabble Score", "uuid": "e22fcca5-b23c-4feb-972f-9795dd1bd946", + "practices": [], "prerequisites": [], "difficulty": 3, "topics": [ @@ -915,6 +981,7 @@ "slug": "meetup", "name": "Meetup", "uuid": "3ce04665-95d1-4608-9763-5ee1b5f2584c", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -925,6 +992,7 @@ "slug": "dot-dsl", "name": "Dot Dsl", "uuid": "dc50364b-b5b6-4e0b-ba58-32fb7d60a93b", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -935,6 +1003,7 @@ "slug": "parallel-letter-frequency", "name": "Parallel Letter Frequency", "uuid": "c0d0ae0f-83fb-433a-8778-d38e8a6645aa", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -946,6 +1015,7 @@ "slug": "rest-api", "name": "Rest Api", "uuid": "b0aaf5ac-f94d-4995-af4a-b27068cf540e", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -957,6 +1027,7 @@ "slug": "bowling", "name": "Bowling", "uuid": "1c8ad2ca-4aec-47af-94b1-ef7e2830b463", + "practices": [], "prerequisites": [], "difficulty": 6, "topics": [ @@ -967,6 +1038,7 @@ "slug": "affine-cipher", "name": "Affine Cipher", "uuid": "ae2f8b66-1d5f-4c19-ad84-b9a7e9e87d0e", + "practices": [], "prerequisites": [], "difficulty": 3, "topics": [ @@ -979,6 +1051,7 @@ "slug": "proverb", "name": "Proverb", "uuid": "5ca0e0ba-20ac-4d48-b2dc-0cdde06a8f3e", + "practices": [], "prerequisites": [], "difficulty": 3, "topics": [ @@ -990,6 +1063,7 @@ "slug": "acronym", "name": "Acronym", "uuid": "926f9309-e0bb-457a-8f1d-8fa947ed5ce7", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -1001,6 +1075,7 @@ "slug": "anagram", "name": "Anagram", "uuid": "cffcb076-295f-497f-8ef1-059a8fa65536", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -1012,6 +1087,7 @@ "slug": "house", "name": "House", "uuid": "7d339c98-74ea-49d5-a97c-c0417e28468a", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -1023,6 +1099,7 @@ "slug": "isbn-verifier", "name": "Isbn Verifier", "uuid": "c339c32c-3310-4b8c-b4e6-0f9f651064b7", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -1034,6 +1111,7 @@ "slug": "series", "name": "Series", "uuid": "4b07842c-dcef-4be0-a842-0b3b7a30c499", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -1046,6 +1124,7 @@ "slug": "atbash-cipher", "name": "Atbash Cipher", "uuid": "3fb37bef-a754-4a64-8493-ba4254518017", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -1058,6 +1137,7 @@ "slug": "crypto-square", "name": "Crypto Square", "uuid": "8d381a54-04a1-45d3-84d3-933b0d94f440", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -1070,6 +1150,7 @@ "slug": "luhn", "name": "Luhn", "uuid": "85ab318f-7842-486d-88de-f0ff7fbef069", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -1082,6 +1163,7 @@ "slug": "rotational-cipher", "name": "Rotational Cipher", "uuid": "26b00c8d-6282-48a8-b017-2ed3e6d48267", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -1094,6 +1176,7 @@ "slug": "simple-cipher", "name": "Simple Cipher", "uuid": "df6f311b-9deb-4d07-9a29-3d881556513e", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -1106,6 +1189,7 @@ "slug": "tournament", "name": "Tournament", "uuid": "b5672a0c-aac5-4274-a458-39d018b74750", + "practices": [], "prerequisites": [], "difficulty": 6, "topics": [ @@ -1117,6 +1201,7 @@ "slug": "diamond", "name": "Diamond", "uuid": "736a470f-412c-41fc-b92d-9bd59ef3bcce", + "practices": [], "prerequisites": [], "difficulty": 8, "topics": [ @@ -1128,6 +1213,7 @@ "slug": "matrix", "name": "Matrix", "uuid": "632417fa-7bf7-4228-9b71-dbdd6738b223", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -1139,6 +1225,7 @@ "slug": "markdown", "name": "Markdown", "uuid": "0688eb10-9581-45c0-a69a-13f20d534cb0", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -1151,6 +1238,7 @@ "slug": "scale-generator", "name": "Scale Generator", "uuid": "02a8e767-7449-48a9-8d6b-f2cac708de50", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -1162,6 +1250,7 @@ "slug": "spiral-matrix", "name": "Spiral Matrix", "uuid": "52f8f299-b93b-4f44-bd5b-b445741b285d", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -1173,6 +1262,7 @@ "slug": "matching-brackets", "name": "Matching Brackets", "uuid": "677ca063-70fe-4cfc-8112-c5d78bd1ea44", + "practices": [], "prerequisites": [], "difficulty": 7, "topics": [ @@ -1184,6 +1274,7 @@ "slug": "minesweeper", "name": "Minesweeper", "uuid": "9e3fc78d-ac3b-4195-ad4c-9f99b0ee2678", + "practices": [], "prerequisites": [], "difficulty": 7, "topics": [ @@ -1195,6 +1286,7 @@ "slug": "rectangles", "name": "Rectangles", "uuid": "d3f364e0-9866-4ec4-8197-dc248b96042b", + "practices": [], "prerequisites": [], "difficulty": 7, "topics": [ @@ -1206,6 +1298,7 @@ "slug": "wordy", "name": "Wordy", "uuid": "c721b3f2-4afc-4a30-bad5-77bd002c2819", + "practices": [], "prerequisites": [], "difficulty": 7, "topics": [ @@ -1218,6 +1311,7 @@ "slug": "prime-factors", "name": "Prime Factors", "uuid": "18652e46-6dd2-4030-84af-be0965c92991", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -1229,6 +1323,7 @@ "slug": "pythagorean-triplet", "name": "Pythagorean Triplet", "uuid": "6bcde851-71ad-4985-b335-8ca67f99c22f", + "practices": [], "prerequisites": [], "difficulty": 4, "topics": [ @@ -1241,6 +1336,7 @@ "slug": "circular-buffer", "name": "Circular Buffer", "uuid": "b62f8574-9bac-4b95-a76c-f13789ae2663", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ @@ -1252,6 +1348,7 @@ "slug": "say", "name": "Say", "uuid": "7af901ca-24ea-4c24-a660-99b1f4338e01", + "practices": [], "prerequisites": [], "difficulty": 8, "topics": [ @@ -1264,6 +1361,7 @@ "slug": "two-bucket", "name": "Two Bucket", "uuid": "78472676-26f0-4bef-813b-9b958c4c35df", + "practices": [], "prerequisites": [], "difficulty": 8, "topics": [ @@ -1274,6 +1372,7 @@ "slug": "zebra-puzzle", "name": "Zebra Puzzle", "uuid": "ee021156-5520-4386-8b5d-9c648f30287c", + "practices": [], "prerequisites": [], "difficulty": 8, "topics": [ @@ -1284,6 +1383,7 @@ "slug": "secret-handshake", "name": "Secret Handshake", "uuid": "ae78a960-2c55-44cb-9fd0-49b4bd5729c5", + "practices": [], "prerequisites": [], "difficulty": 3, "topics": [ @@ -1295,6 +1395,7 @@ "slug": "variable-length-quantity", "name": "Variable Length Quantity", "uuid": "ef86703b-9e78-43f8-aa4c-203492ac622c", + "practices": [], "prerequisites": [], "difficulty": 9, "topics": [ @@ -1306,6 +1407,7 @@ "slug": "connect", "name": "Connect", "uuid": "dead8124-6942-4205-9ea8-3cb926c0dc47", + "practices": [], "prerequisites": [], "difficulty": 8, "topics": [ @@ -1317,6 +1419,7 @@ "slug": "alphametics", "name": "Alphametics", "uuid": "3d682945-5fa1-4121-9d5b-7bac60660de9", + "practices": [], "prerequisites": [], "difficulty": 9, "topics": [ @@ -1328,6 +1431,7 @@ "slug": "go-counting", "name": "Go Counting", "uuid": "01ffa95c-1966-4031-b0d2-64f254d85b82", + "practices": [], "prerequisites": [], "difficulty": 9, "topics": [ @@ -1340,6 +1444,7 @@ "slug": "sgf-parsing", "name": "Sgf Parsing", "uuid": "fe0e98b3-d0d3-4bf6-bfaa-8aa0e61aa625", + "practices": [], "prerequisites": [], "difficulty": 9, "topics": [ @@ -1351,6 +1456,7 @@ "slug": "forth", "name": "Forth", "uuid": "533981a1-632c-4ca8-a4ae-05f3ad1a810b", + "practices": [], "prerequisites": [], "difficulty": 10, "topics": [ @@ -1362,6 +1468,7 @@ "slug": "rail-fence-cipher", "name": "Rail Fence Cipher", "uuid": "c418bba8-2185-4b45-92f1-0cfafbbe8ce5", + "practices": [], "prerequisites": [], "difficulty": 6, "topics": [ @@ -1374,6 +1481,7 @@ "slug": "transpose", "name": "Transpose", "uuid": "3dfedd37-8159-446d-a332-e9d356f484ca", + "practices": [], "prerequisites": [], "difficulty": 6, "topics": [ @@ -1385,6 +1493,7 @@ "slug": "sublist", "name": "Sublist", "uuid": "d17b0c35-49a7-4ea6-b68c-7b2b56dc5968", + "practices": [], "prerequisites": [], "difficulty": 7, "topics": [ @@ -1396,6 +1505,7 @@ "slug": "hangman", "name": "Hangman", "uuid": "ab0f1b66-011f-4aa3-89c5-c89427121279", + "practices": [], "prerequisites": [], "difficulty": 8, "topics": [ @@ -1406,6 +1516,7 @@ "slug": "lens-person", "name": "Lens Person", "uuid": "443fdb8c-1a97-4086-be6a-b541faa961a5", + "practices": [], "prerequisites": [], "difficulty": 9, "topics": [ @@ -1416,6 +1527,7 @@ "slug": "react", "name": "React", "uuid": "8eef5619-f331-46b3-a2c1-d581f523a815", + "practices": [], "prerequisites": [], "difficulty": 9, "topics": [ @@ -1428,6 +1540,7 @@ "slug": "binary", "name": "Binary", "uuid": "df8f4106-c1ce-4c33-86b2-ad61ba5ccc4a", + "practices": [], "prerequisites": [], "difficulty": 0, "topics": null, @@ -1437,6 +1550,7 @@ "slug": "hexadecimal", "name": "Hexadecimal", "uuid": "f4f80d57-a248-49d3-9329-587eb2643d4f", + "practices": [], "prerequisites": [], "difficulty": 0, "topics": null, @@ -1446,6 +1560,7 @@ "slug": "octal", "name": "Octal", "uuid": "f29f9e56-c79b-4ae4-a0d0-29db78c677e4", + "practices": [], "prerequisites": [], "difficulty": 0, "topics": null, @@ -1455,6 +1570,7 @@ "slug": "trinary", "name": "Trinary", "uuid": "81904afe-a893-45be-99f8-2e074a6f1ad5", + "practices": [], "prerequisites": [], "difficulty": 0, "topics": null, @@ -1464,6 +1580,7 @@ "slug": "difference-of-squares", "name": "Difference Of Squares", "uuid": "3969fb29-5997-4050-adb0-8c6e95f48013", + "practices": [], "prerequisites": [], "difficulty": 1, "topics": [ @@ -1475,6 +1592,7 @@ "slug": "gigasecond", "name": "Gigasecond", "uuid": "1d377268-8892-460b-a84b-011fde1ff06b", + "practices": [], "prerequisites": [], "difficulty": 1, "topics": [ @@ -1485,6 +1603,7 @@ "slug": "reverse-string", "name": "Reverse String", "uuid": "08be451e-65c1-4306-860e-ac0c4a02a546", + "practices": [], "prerequisites": [], "difficulty": 1, "topics": [ @@ -1495,6 +1614,7 @@ "slug": "rna-transcription", "name": "Rna Transcription", "uuid": "3a015501-58bf-427c-8c4c-2197321f4a34", + "practices": [], "prerequisites": [], "difficulty": 1, "topics": [ @@ -1506,6 +1626,7 @@ "slug": "sum-of-multiples", "name": "Sum Of Multiples", "uuid": "e702b75e-4c9e-40ef-bcb1-674a87222c23", + "practices": [], "prerequisites": [], "difficulty": 1, "topics": [ @@ -1518,6 +1639,7 @@ "slug": "dnd-character", "name": "Dnd Character", "uuid": "93550ca5-cd8c-42e3-88f3-e6ce41608342", + "practices": [], "prerequisites": [], "difficulty": 3, "topics": [ @@ -1528,6 +1650,7 @@ "slug": "tree-building", "name": "Tree Building", "uuid": "a53fa908-f983-4da5-b1c1-3989bd2ea2f9", + "practices": [], "prerequisites": [], "difficulty": 5, "topics": [ diff --git a/docs/ABOUT.md b/docs/ABOUT.md index dd9194f87..0dfaec84b 100644 --- a/docs/ABOUT.md +++ b/docs/ABOUT.md @@ -1,3 +1,5 @@ +# About + [F#](http://www.tryfsharp.org/Explore) is a strongly-typed, functional language that is part of Microsoft's .NET language stack. Although F# is great for data science problems, it can elegantly handle almost every problem you throw at it. diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index ff47830e7..99578b523 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -1,3 +1,5 @@ +# Installation + ### Installing .NET Core The F# track is built on top of the [.NET Core](https://www.microsoft.com/net/core/platform) platform, which runs on Windows, Linux and macOS. To build .NET Core projects, you can use the .NET Core Command Line Interface (CLI). This CLI is part of the .NET Core SDK, which you can install by following the [installation instructions](https://www.microsoft.com/net/download/core). Note: the F# track requires SDK version 3.0 or greater. diff --git a/docs/LEARNING.md b/docs/LEARNING.md index 591606d7a..4802ecd5d 100644 --- a/docs/LEARNING.md +++ b/docs/LEARNING.md @@ -1,4 +1,4 @@ -## Learning F# +# Learning F# ### Websites * The [F# Hello World tutorial](https://dotnet.microsoft.com/learn/languages/fsharp-hello-world-tutorial/intro) is a nice and gentle introduction to working with F#. diff --git a/docs/RESOURCES.md b/docs/RESOURCES.md index 6e89d063a..9b7eb8db6 100644 --- a/docs/RESOURCES.md +++ b/docs/RESOURCES.md @@ -1,4 +1,4 @@ -## Recommended Learning Resources +# Resources ### Blogs * Sergey Tihon's [F# Weekly blog](https://sergeytihon.wordpress.com/) is a weekly-updated website that lists recent F# news and articles. diff --git a/docs/TESTS.md b/docs/TESTS.md index d069053ae..85f7e2b0e 100644 --- a/docs/TESTS.md +++ b/docs/TESTS.md @@ -1,3 +1,5 @@ +# Tests + ## Running Tests To run the tests, execute the following command: diff --git a/exercises/concept/annalyns-infiltration/.docs/hints.md b/exercises/concept/annalyns-infiltration/.docs/hints.md index 053d53e42..38e3a1da8 100644 --- a/exercises/concept/annalyns-infiltration/.docs/hints.md +++ b/exercises/concept/annalyns-infiltration/.docs/hints.md @@ -1,3 +1,5 @@ +# Hints + ## General - There are three [boolean operators][operators] to work with boolean values. diff --git a/exercises/concept/annalyns-infiltration/.docs/instructions.md b/exercises/concept/annalyns-infiltration/.docs/instructions.md index b0e6d5ec8..c8768dd1f 100644 --- a/exercises/concept/annalyns-infiltration/.docs/instructions.md +++ b/exercises/concept/annalyns-infiltration/.docs/instructions.md @@ -1,3 +1,5 @@ +# Instructions + In this exercise, you'll be implementing the quest logic for a new RPG game a friend is developing. The game's main character is Annalyn, a brave girl with a fierce and loyal pet dog. Unfortunately, disaster strikes, as her best friend was kidnapped while searching for berries in the forest. Annalyn will try to find and free her best friend, optionally taking her dog with her on this quest. After some time spent following her best friend's trail, she finds the camp in which her best friend is imprisoned. It turns out there are two kidnappers: a mighty knight and a cunning archer. diff --git a/exercises/concept/annalyns-infiltration/.docs/introduction.md b/exercises/concept/annalyns-infiltration/.docs/introduction.md index 233d49dac..be6ea1aac 100644 --- a/exercises/concept/annalyns-infiltration/.docs/introduction.md +++ b/exercises/concept/annalyns-infiltration/.docs/introduction.md @@ -1,3 +1,5 @@ +# Introduction + Booleans in F# are represented by the `bool` type, which values can be either `true` or `false`. F# supports three boolean operators: `not` (NOT), `&&` (AND), and `||` (OR). diff --git a/exercises/concept/annalyns-infiltration/.meta/design.md b/exercises/concept/annalyns-infiltration/.meta/design.md index b7405f686..3f2094e5c 100644 --- a/exercises/concept/annalyns-infiltration/.meta/design.md +++ b/exercises/concept/annalyns-infiltration/.meta/design.md @@ -1,3 +1,5 @@ +# Design + ## Learning objectives - Know of the existence of the `bool` type and its two values. diff --git a/exercises/concept/bandwagoner/.docs/hints.md b/exercises/concept/bandwagoner/.docs/hints.md index 5de631bf2..222f42e84 100644 --- a/exercises/concept/bandwagoner/.docs/hints.md +++ b/exercises/concept/bandwagoner/.docs/hints.md @@ -1,3 +1,5 @@ +# Hints + ### 1. Define the model - [This page][define] shows how to define a discriminated union. diff --git a/exercises/concept/bandwagoner/.docs/instructions.md b/exercises/concept/bandwagoner/.docs/instructions.md index ddcfec3d2..0d5cbe025 100644 --- a/exercises/concept/bandwagoner/.docs/instructions.md +++ b/exercises/concept/bandwagoner/.docs/instructions.md @@ -1,3 +1,5 @@ +# Instructions + In this exercise you're a big sports fan and you've just discovered a passion for NBA basketball. Being new to NBA basketball, you're doing a deep dive into NBA history, keeping track of teams, coaches, their win/loss stats and comparing them against each other. As you don't yet have a favorite team, you'll also be developing an algorithm to figure out whether to root for a particular team. diff --git a/exercises/concept/bandwagoner/.docs/introduction.md b/exercises/concept/bandwagoner/.docs/introduction.md index 3dd816203..85fae2430 100644 --- a/exercises/concept/bandwagoner/.docs/introduction.md +++ b/exercises/concept/bandwagoner/.docs/introduction.md @@ -1,3 +1,5 @@ +# Introduction + A record is a collection of fields (which can be of different types) that belong together. To define a record the `type` keyword is used. A record's fields are defined between `{` and `}` characters, and each field has a name _and_ a type. To create a record, specify the names of the fields and assign a value to them between `{` and `}` characters. All fields must be assigned a value when creating a record. A record instance's field values can be accessed using dot-notation. When defining/create a record, each field must either be on a separate line or separated by semicolons (`;`) when on a single line. diff --git a/exercises/concept/bandwagoner/.meta/design.md b/exercises/concept/bandwagoner/.meta/design.md index edac49750..2fe111b88 100644 --- a/exercises/concept/bandwagoner/.meta/design.md +++ b/exercises/concept/bandwagoner/.meta/design.md @@ -1,3 +1,5 @@ +# Design + ## Learning objectives - Know what a record is diff --git a/exercises/concept/bird-watcher/.docs/hints.md b/exercises/concept/bird-watcher/.docs/hints.md index 39edab784..4397c8026 100644 --- a/exercises/concept/bird-watcher/.docs/hints.md +++ b/exercises/concept/bird-watcher/.docs/hints.md @@ -1,3 +1,5 @@ +# Hints + ## General - The bird counts arrays always contain exactly 7 integers. diff --git a/exercises/concept/bird-watcher/.docs/instructions.md b/exercises/concept/bird-watcher/.docs/instructions.md index be49b3939..d80872b20 100644 --- a/exercises/concept/bird-watcher/.docs/instructions.md +++ b/exercises/concept/bird-watcher/.docs/instructions.md @@ -1,3 +1,5 @@ +# Instructions + You're an avid bird watcher that keeps track of how many birds have visited your garden in the last seven days. You have six tasks, all dealing with the numbers of birds that visited your garden. diff --git a/exercises/concept/bird-watcher/.docs/introduction.md b/exercises/concept/bird-watcher/.docs/introduction.md index dd1e3a494..1161fd48b 100644 --- a/exercises/concept/bird-watcher/.docs/introduction.md +++ b/exercises/concept/bird-watcher/.docs/introduction.md @@ -1,3 +1,5 @@ +# Introduction + An `array` in F# is a mutable collection of zero or more values with a fixed length. This means that once an array has been created, its size cannot change, but its values can. The values in an array must all have the same type. Arrays can be defined as follows: ```fsharp diff --git a/exercises/concept/bird-watcher/.meta/design.md b/exercises/concept/bird-watcher/.meta/design.md index 9dc614630..28698257c 100644 --- a/exercises/concept/bird-watcher/.meta/design.md +++ b/exercises/concept/bird-watcher/.meta/design.md @@ -1,3 +1,5 @@ +# Design + ## Learning objectives - Know of the existence of the `Array` type diff --git a/exercises/concept/booking-up-for-beauty/.docs/hints.md b/exercises/concept/booking-up-for-beauty/.docs/hints.md index e0290e093..2eebf7fe1 100644 --- a/exercises/concept/booking-up-for-beauty/.docs/hints.md +++ b/exercises/concept/booking-up-for-beauty/.docs/hints.md @@ -1,3 +1,5 @@ +# Hints + ## General - To work with the `DateTime` class, the `System` namespace has to be _opened_. diff --git a/exercises/concept/booking-up-for-beauty/.docs/instructions.md b/exercises/concept/booking-up-for-beauty/.docs/instructions.md index bba1fb3ad..409f731f3 100644 --- a/exercises/concept/booking-up-for-beauty/.docs/instructions.md +++ b/exercises/concept/booking-up-for-beauty/.docs/instructions.md @@ -1,3 +1,5 @@ +# Instructions + In this exercise you'll be working on an appointment scheduler for a beauty salon in New York that opened on September 15th in 2012. You have four tasks, which will all involve appointment dates. The dates and times will use one of the following three formats: diff --git a/exercises/concept/booking-up-for-beauty/.docs/introduction.md b/exercises/concept/booking-up-for-beauty/.docs/introduction.md index f15dcdd02..bebd91521 100644 --- a/exercises/concept/booking-up-for-beauty/.docs/introduction.md +++ b/exercises/concept/booking-up-for-beauty/.docs/introduction.md @@ -1,3 +1,5 @@ +# Introduction + A `DateTime` in F# is an immutable object that contains both date _and_ time information. `DateTime` instances are manipulated by calling their methods. Once a `DateTime` has been constructed, its value can never change. Any methods/functions that appear to modify a `DateTime` will actually return a new `DateTime`. The textual representation of dates and times is dependent on the _culture_. Consider a `DateTime` with its date set to March 28 2019 and its time set to 14:30:59. Converting this `DateTime` to a `string` when using the `en-US` culture (American English) returns `"3/28/19 2:30:59 PM"`. When using the `fr-BE` culture (Belgian French), the same code returns a different value: `"28/03/19 14:30:59"`. diff --git a/exercises/concept/booking-up-for-beauty/.meta/design.md b/exercises/concept/booking-up-for-beauty/.meta/design.md index 9ac5d0e30..a40e44224 100644 --- a/exercises/concept/booking-up-for-beauty/.meta/design.md +++ b/exercises/concept/booking-up-for-beauty/.meta/design.md @@ -1,3 +1,5 @@ +# Design + ## Learning objectives - Know of the existence of the `DateTime` type. diff --git a/exercises/concept/cars-assemble/.docs/hints.md b/exercises/concept/cars-assemble/.docs/hints.md index 17e17a1b0..78c0815d7 100644 --- a/exercises/concept/cars-assemble/.docs/hints.md +++ b/exercises/concept/cars-assemble/.docs/hints.md @@ -1,3 +1,5 @@ +# Hints + ## 1. Calculate the production rate per second - Determining the success rate can be done through a [conditional expression][conditional-expression]. diff --git a/exercises/concept/cars-assemble/.docs/instructions.md b/exercises/concept/cars-assemble/.docs/instructions.md index 83fa7d779..9a7e807ae 100644 --- a/exercises/concept/cars-assemble/.docs/instructions.md +++ b/exercises/concept/cars-assemble/.docs/instructions.md @@ -1,3 +1,5 @@ +# Instructions + In this exercise you'll be writing code to analyze the production of an assembly line in a car factory. The assembly line's speed can range from `0` (off) to `10` (maximum). At its lowest speed (`1`), `221` cars are produced each hour. The production increases linearly with the speed. So with the speed set to `4`, it should produce `4 * 221 = 884` cars per hour. However, higher speeds increase the likelihood that faulty cars are produced, which then have to be discarded. The following table shows how speed influences the success rate: diff --git a/exercises/concept/cars-assemble/.docs/introduction.md b/exercises/concept/cars-assemble/.docs/introduction.md index 5ad9cf4cc..38a41d262 100644 --- a/exercises/concept/cars-assemble/.docs/introduction.md +++ b/exercises/concept/cars-assemble/.docs/introduction.md @@ -1,3 +1,5 @@ +# Introduction + ## Numbers There are two different types of numbers in F#: diff --git a/exercises/concept/cars-assemble/.meta/design.md b/exercises/concept/cars-assemble/.meta/design.md index 3576c8896..a3cf6e9cd 100644 --- a/exercises/concept/cars-assemble/.meta/design.md +++ b/exercises/concept/cars-assemble/.meta/design.md @@ -1,3 +1,5 @@ +# Design + ## Learning objectives - Know of the existence of the two most commonly used number types, `int` and `float`. diff --git a/exercises/concept/guessing-game/.docs/hints.md b/exercises/concept/guessing-game/.docs/hints.md index cb421336f..9799d2453 100644 --- a/exercises/concept/guessing-game/.docs/hints.md +++ b/exercises/concept/guessing-game/.docs/hints.md @@ -1,3 +1,5 @@ +# Hints + ## General - [This page][pattern-matching] has a nice introduction to pattern matching in F#. diff --git a/exercises/concept/guessing-game/.docs/instructions.md b/exercises/concept/guessing-game/.docs/instructions.md index 78e810a7a..626ec44a1 100644 --- a/exercises/concept/guessing-game/.docs/instructions.md +++ b/exercises/concept/guessing-game/.docs/instructions.md @@ -1,3 +1,5 @@ +# Instructions + In this exercise, you are playing a number guessing game with a friend. The rules are simple: you secretly choose a number between `1` and `100` and your friend tries to guess what number you've chosen. To help your friend, you respond differently depending on how close the guess was to the number you've chosen (`42`). These are the rules for the different replies: - If the guess is `42`: "Correct" diff --git a/exercises/concept/guessing-game/.docs/introduction.md b/exercises/concept/guessing-game/.docs/introduction.md index 6c2e7a8cd..0f4f7698f 100644 --- a/exercises/concept/guessing-game/.docs/introduction.md +++ b/exercises/concept/guessing-game/.docs/introduction.md @@ -1,3 +1,5 @@ +# Introduction + An `if/elif/else` expression can be used to conditionally execute logic. F# also has another, more powerful way to conditionally execute logic: pattern matching. With pattern matching, a value can be tested against one or more _patterns_. An example of such a pattern is the _constant pattern_, which matches a value against a constant (e.g. `1` or `"hello"`). In F#, pattern matching is done through the `match` keyword: diff --git a/exercises/concept/guessing-game/.meta/design.md b/exercises/concept/guessing-game/.meta/design.md index c0b52518e..e9237d60a 100644 --- a/exercises/concept/guessing-game/.meta/design.md +++ b/exercises/concept/guessing-game/.meta/design.md @@ -1,3 +1,5 @@ +# Design + ## Learning objectives - Know what pattern matching is. diff --git a/exercises/concept/interest-is-interesting/.docs/hints.md b/exercises/concept/interest-is-interesting/.docs/hints.md index e49087103..71a862875 100644 --- a/exercises/concept/interest-is-interesting/.docs/hints.md +++ b/exercises/concept/interest-is-interesting/.docs/hints.md @@ -1,3 +1,5 @@ +# Hints + ## 1. Calculate the interest rate - By default, any floating-point number defined in F# code is treated as a `float`. To use a different floating-point type (like `single` or `decimal`), one must add the appropriate [suffix][literals] to the number. diff --git a/exercises/concept/interest-is-interesting/.docs/instructions.md b/exercises/concept/interest-is-interesting/.docs/instructions.md index 96b74e5ba..05e317e7b 100644 --- a/exercises/concept/interest-is-interesting/.docs/instructions.md +++ b/exercises/concept/interest-is-interesting/.docs/instructions.md @@ -1,3 +1,5 @@ +# Instructions + In this exercise you'll be working with savings accounts. Each year, the balance of your savings account is updated based on its interest rate. The interest rate your bank gives you depends on the amount of money in your account (its balance): - -3.213% for a negative balance. diff --git a/exercises/concept/interest-is-interesting/.docs/introduction.md b/exercises/concept/interest-is-interesting/.docs/introduction.md index 7f41d708f..01629e0dd 100644 --- a/exercises/concept/interest-is-interesting/.docs/introduction.md +++ b/exercises/concept/interest-is-interesting/.docs/introduction.md @@ -1,3 +1,5 @@ +# Introduction + A floating-point number is a number with zero or more digits behind the decimal separator. Examples are `-2.4`, `0.1`, `3.14`, `16.984025` and `1024.0`. F# has three floating-point types: diff --git a/exercises/concept/interest-is-interesting/.meta/design.md b/exercises/concept/interest-is-interesting/.meta/design.md index 5a33169da..d80785cb2 100644 --- a/exercises/concept/interest-is-interesting/.meta/design.md +++ b/exercises/concept/interest-is-interesting/.meta/design.md @@ -1,3 +1,5 @@ +# Design + ## Learning objectives - Know of the existence of the three floating point types: `double`, `float` and `decimal`. diff --git a/exercises/concept/log-levels/.docs/hints.md b/exercises/concept/log-levels/.docs/hints.md index 985ee4977..5d0b3dc81 100644 --- a/exercises/concept/log-levels/.docs/hints.md +++ b/exercises/concept/log-levels/.docs/hints.md @@ -1,3 +1,5 @@ +# Hints + ## General - The `string` class has many useful [built-in methods][methods]. diff --git a/exercises/concept/log-levels/.docs/instructions.md b/exercises/concept/log-levels/.docs/instructions.md index f19b9835a..a7ea92919 100644 --- a/exercises/concept/log-levels/.docs/instructions.md +++ b/exercises/concept/log-levels/.docs/instructions.md @@ -1,3 +1,5 @@ +# Instructions + In this exercise you'll be processing log-lines. Each log line is a string formatted as follows: `"[]: "`. diff --git a/exercises/concept/log-levels/.docs/introduction.md b/exercises/concept/log-levels/.docs/introduction.md index 5150f630e..e6bf04a1a 100644 --- a/exercises/concept/log-levels/.docs/introduction.md +++ b/exercises/concept/log-levels/.docs/introduction.md @@ -1,3 +1,5 @@ +# Introduction + A `string` in F# is an object that represents immutable text as a sequence of Unicode characters (letters, digits, punctuation, etc.) and is defined as follows: ```fsharp diff --git a/exercises/concept/log-levels/.meta/design.md b/exercises/concept/log-levels/.meta/design.md index dd2205ce4..98c86d139 100644 --- a/exercises/concept/log-levels/.meta/design.md +++ b/exercises/concept/log-levels/.meta/design.md @@ -1,3 +1,5 @@ +# Design + ## Learning objectives - Know of the existence of the `string` type. diff --git a/exercises/concept/lucians-luscious-lasagna/.docs/hints.md b/exercises/concept/lucians-luscious-lasagna/.docs/hints.md index d08d3c66b..94ebb8f00 100644 --- a/exercises/concept/lucians-luscious-lasagna/.docs/hints.md +++ b/exercises/concept/lucians-luscious-lasagna/.docs/hints.md @@ -1,3 +1,5 @@ +# Hints + ## General - An integer value can be defined as one or more consecutive digits. diff --git a/exercises/concept/lucians-luscious-lasagna/.docs/instructions.md b/exercises/concept/lucians-luscious-lasagna/.docs/instructions.md index 7565ba2cc..9d705461e 100644 --- a/exercises/concept/lucians-luscious-lasagna/.docs/instructions.md +++ b/exercises/concept/lucians-luscious-lasagna/.docs/instructions.md @@ -1,3 +1,5 @@ +# Instructions + In this exercise you're going to write some code to help you cook a brilliant lasagna from your favorite cooking book. You have four tasks, all related to the time spent cooking the lasagna. diff --git a/exercises/concept/lucians-luscious-lasagna/.docs/introduction.md b/exercises/concept/lucians-luscious-lasagna/.docs/introduction.md index 759e5b483..60bc25383 100644 --- a/exercises/concept/lucians-luscious-lasagna/.docs/introduction.md +++ b/exercises/concept/lucians-luscious-lasagna/.docs/introduction.md @@ -1,3 +1,5 @@ +# Introduction + In F#, assigning a value to a name is referred to as a _binding_. Bindings are immutable, which makes them similar to constants in other languages. As F# is a statically-typed language, each binding has a type at compile-time. Bindings are defined using the `let` keyword. Specifying a binding's type is optional for most bindings, as F#'s _type inference_ can usually infer the type based on their value. A binding looks like this: diff --git a/exercises/concept/lucians-luscious-lasagna/.meta/design.md b/exercises/concept/lucians-luscious-lasagna/.meta/design.md index 621a60199..720fe4b65 100644 --- a/exercises/concept/lucians-luscious-lasagna/.meta/design.md +++ b/exercises/concept/lucians-luscious-lasagna/.meta/design.md @@ -1,3 +1,5 @@ +# Design + ## Learning objectives - Know what a value is. diff --git a/exercises/concept/pizza-pricing/.docs/hints.md b/exercises/concept/pizza-pricing/.docs/hints.md index 7bb62ce80..7a1f21280 100644 --- a/exercises/concept/pizza-pricing/.docs/hints.md +++ b/exercises/concept/pizza-pricing/.docs/hints.md @@ -1,3 +1,5 @@ +# Hints + ## General - Try to split a problem into a base case and a recursive case. For example, let's say you want to count how many cookies are there in the cookie jar with a recursive approach. A base case is an empty jar - it has zero cookies. If the jar is not empty, then the number of cookies in the jar is equal to one cookie plus the number of cookies in the jar after removing one cookie. diff --git a/exercises/concept/pizza-pricing/.docs/instructions.md b/exercises/concept/pizza-pricing/.docs/instructions.md index 4a99dbf0c..9ebce6f10 100644 --- a/exercises/concept/pizza-pricing/.docs/instructions.md +++ b/exercises/concept/pizza-pricing/.docs/instructions.md @@ -1,3 +1,5 @@ +# Instructions + In this exercise you're working at a pizza place that delivers to customers. You offer three types of pizzas: diff --git a/exercises/concept/pizza-pricing/.docs/introduction.md b/exercises/concept/pizza-pricing/.docs/introduction.md index 321019894..2820328d5 100644 --- a/exercises/concept/pizza-pricing/.docs/introduction.md +++ b/exercises/concept/pizza-pricing/.docs/introduction.md @@ -1,3 +1,5 @@ +# Introduction + The ability for something to be defined in terms of itself is called recursion. In F#, recursion is most commonly found in recursive functions, which are functions that call themselves. A recursive function needs to have at least one _base case_ and at least one _recursive case_. A _base case_ returns a value without calling the function again. A _recursive case_ calls the function again, modifying the input so that it will at some point match the base case. diff --git a/exercises/concept/pizza-pricing/.meta/design.md b/exercises/concept/pizza-pricing/.meta/design.md index a90b0b479..bab16cacd 100644 --- a/exercises/concept/pizza-pricing/.meta/design.md +++ b/exercises/concept/pizza-pricing/.meta/design.md @@ -1,3 +1,5 @@ +# Design + ## Learning objectives - Know what recursion is. diff --git a/exercises/concept/tracks-on-tracks-on-tracks/.docs/hints.md b/exercises/concept/tracks-on-tracks-on-tracks/.docs/hints.md index 522d22228..eb875b2c1 100644 --- a/exercises/concept/tracks-on-tracks-on-tracks/.docs/hints.md +++ b/exercises/concept/tracks-on-tracks-on-tracks/.docs/hints.md @@ -1,3 +1,5 @@ +# Hints + ## 1. Create a new list - How to define an empty list can be found on [this page][create-and-initialize]. diff --git a/exercises/concept/tracks-on-tracks-on-tracks/.docs/instructions.md b/exercises/concept/tracks-on-tracks-on-tracks/.docs/instructions.md index fd5a60174..7877d8728 100644 --- a/exercises/concept/tracks-on-tracks-on-tracks/.docs/instructions.md +++ b/exercises/concept/tracks-on-tracks-on-tracks/.docs/instructions.md @@ -1,3 +1,5 @@ +# Instructions + In this exercise you'll be writing code to keep track of a list of programming languages you want to learn on Exercism. You have six tasks, which will all involve dealing with lists. diff --git a/exercises/concept/tracks-on-tracks-on-tracks/.docs/introduction.md b/exercises/concept/tracks-on-tracks-on-tracks/.docs/introduction.md index b50d2cc58..193f05eca 100644 --- a/exercises/concept/tracks-on-tracks-on-tracks/.docs/introduction.md +++ b/exercises/concept/tracks-on-tracks-on-tracks/.docs/introduction.md @@ -1,3 +1,5 @@ +# Introduction + A `list` in F# is an immutable collection of zero or more values. The values in a list must all have the same type. As lists are immutable, once a list has been constructed, its value can never change. Any functions/operators that appear to modify a list (such as adding an element), will actually return a new list. Lists can be defined as follows: diff --git a/exercises/concept/tracks-on-tracks-on-tracks/.meta/design.md b/exercises/concept/tracks-on-tracks-on-tracks/.meta/design.md index 979a52498..03d485c10 100644 --- a/exercises/concept/tracks-on-tracks-on-tracks/.meta/design.md +++ b/exercises/concept/tracks-on-tracks-on-tracks/.meta/design.md @@ -1,3 +1,5 @@ +# Design + ## Learning objectives - Know of the existence of the `list` type. diff --git a/exercises/concept/valentines-day/.docs/hints.md b/exercises/concept/valentines-day/.docs/hints.md index d1485ff5f..3ddf4c52e 100644 --- a/exercises/concept/valentines-day/.docs/hints.md +++ b/exercises/concept/valentines-day/.docs/hints.md @@ -1,3 +1,5 @@ +# Hints + ## 1. Define the approval - [This page][define] shows how to define a discriminated union. diff --git a/exercises/concept/valentines-day/.docs/instructions.md b/exercises/concept/valentines-day/.docs/instructions.md index e70c3481d..8631c7302 100644 --- a/exercises/concept/valentines-day/.docs/instructions.md +++ b/exercises/concept/valentines-day/.docs/instructions.md @@ -1,3 +1,5 @@ +# Instructions + In this exercise, it's Valentine's day and you and your partner are planning on doing something nice together. Your partner has lots of ideas, and is now asking you to rate the ideas, in order to find the activity to engage in. The following ideas are proposed by your partner: diff --git a/exercises/concept/valentines-day/.docs/introduction.md b/exercises/concept/valentines-day/.docs/introduction.md index 443ac1f4a..badbaf16f 100644 --- a/exercises/concept/valentines-day/.docs/introduction.md +++ b/exercises/concept/valentines-day/.docs/introduction.md @@ -1,3 +1,5 @@ +# Introduction + The discriminated union type represents a fixed number of named cases. Each value of a discriminated union corresponds to exactly one of the named cases. A discriminated union is defined using the `type` keyword, with cases separated by pipe (`|`) characters: diff --git a/exercises/concept/valentines-day/.meta/design.md b/exercises/concept/valentines-day/.meta/design.md index b5e75c768..95d250dff 100644 --- a/exercises/concept/valentines-day/.meta/design.md +++ b/exercises/concept/valentines-day/.meta/design.md @@ -1,3 +1,5 @@ +# Design + ## Learning objectives - Know what discriminated unions are. diff --git a/exercises/practice/accumulate/.meta/hints.md b/exercises/practice/accumulate/.docs/instructions.append.md similarity index 97% rename from exercises/practice/accumulate/.meta/hints.md rename to exercises/practice/accumulate/.docs/instructions.append.md index 7f208a873..e5c81805e 100644 --- a/exercises/practice/accumulate/.meta/hints.md +++ b/exercises/practice/accumulate/.docs/instructions.append.md @@ -1,4 +1,4 @@ -## Hints +# Instructions append For this exercise the following F# feature comes in handy: - [Tail recursion](https://blogs.msdn.microsoft.com/fsharpteam/2011/07/08/tail-calls-in-f/) Prevent stack overflows with large input by using tail recursion. While there are no test cases checking explicitly for this, using tail recursion leads to a more performant solution. Another good resource on tail recursion is [this blog post](http://blog.ploeh.dk/2015/12/22/tail-recurse/). - [Type inference](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/generics/#implicitly-generic-constructs) The F# compiler can automatically infer types, which means you often don't have to add any types at all. For more information on how this works and its advantages, see [this page](https://fsharpforfunandprofit.com/posts/type-inference/). diff --git a/exercises/practice/accumulate/.docs/instructions.md b/exercises/practice/accumulate/.docs/instructions.md new file mode 100644 index 000000000..435e0b324 --- /dev/null +++ b/exercises/practice/accumulate/.docs/instructions.md @@ -0,0 +1,26 @@ +# Instructions + +Implement the `accumulate` operation, which, given a collection and an +operation to perform on each element of the collection, returns a new +collection containing the result of applying that operation to each element of +the input collection. + +Given the collection of numbers: + +- 1, 2, 3, 4, 5 + +And the operation: + +- square a number (`x => x * x`) + +Your code should be able to produce the collection of squares: + +- 1, 4, 9, 16, 25 + +Check out the test suite to see the expected function signature. + +## Restrictions + +Keep your hands off that collect/map/fmap/whatchamacallit functionality +provided by your standard library! +Solve this one yourself using other basic tools instead. diff --git a/exercises/practice/accumulate/.meta/config.json b/exercises/practice/accumulate/.meta/config.json new file mode 100644 index 000000000..70e106389 --- /dev/null +++ b/exercises/practice/accumulate/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Conversation with James Edward Gray II", + "source_url": "https://twitter.com/jeg2" +} diff --git a/exercises/practice/accumulate/README.md b/exercises/practice/accumulate/README.md deleted file mode 100644 index b9227cbbd..000000000 --- a/exercises/practice/accumulate/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# Accumulate - -Implement the `accumulate` operation, which, given a collection and an -operation to perform on each element of the collection, returns a new -collection containing the result of applying that operation to each element of -the input collection. - -Given the collection of numbers: - -- 1, 2, 3, 4, 5 - -And the operation: - -- square a number (`x => x * x`) - -Your code should be able to produce the collection of squares: - -- 1, 4, 9, 16, 25 - -Check out the test suite to see the expected function signature. - -## Restrictions - -Keep your hands off that collect/map/fmap/whatchamacallit functionality -provided by your standard library! -Solve this one yourself using other basic tools instead. - -## Hints -For this exercise the following F# feature comes in handy: -- [Tail recursion](https://blogs.msdn.microsoft.com/fsharpteam/2011/07/08/tail-calls-in-f/) Prevent stack overflows with large input by using tail recursion. While there are no test cases checking explicitly for this, using tail recursion leads to a more performant solution. Another good resource on tail recursion is [this blog post](http://blog.ploeh.dk/2015/12/22/tail-recurse/). -- [Type inference](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/generics/#implicitly-generic-constructs) The F# compiler can automatically infer types, which means you often don't have to add any types at all. For more information on how this works and its advantages, see [this page](https://fsharpforfunandprofit.com/posts/type-inference/). - - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Conversation with James Edward Gray II [https://twitter.com/jeg2](https://twitter.com/jeg2) - diff --git a/exercises/practice/acronym/.docs/instructions.md b/exercises/practice/acronym/.docs/instructions.md new file mode 100644 index 000000000..e0515b4d1 --- /dev/null +++ b/exercises/practice/acronym/.docs/instructions.md @@ -0,0 +1,8 @@ +# Instructions + +Convert a phrase to its acronym. + +Techies love their TLA (Three Letter Acronyms)! + +Help generate some jargon by writing a program that converts a long name +like Portable Network Graphics to its acronym (PNG). diff --git a/exercises/practice/acronym/.meta/config.json b/exercises/practice/acronym/.meta/config.json new file mode 100644 index 000000000..dd6747143 --- /dev/null +++ b/exercises/practice/acronym/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Julien Vanier", + "source_url": "https://github.com/monkbroc" +} diff --git a/exercises/practice/acronym/README.md b/exercises/practice/acronym/README.md deleted file mode 100644 index 8a946a4b0..000000000 --- a/exercises/practice/acronym/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Acronym - -Convert a phrase to its acronym. - -Techies love their TLA (Three Letter Acronyms)! - -Help generate some jargon by writing a program that converts a long name -like Portable Network Graphics to its acronym (PNG). - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Julien Vanier [https://github.com/monkbroc](https://github.com/monkbroc) - diff --git a/exercises/practice/affine-cipher/README.md b/exercises/practice/affine-cipher/.docs/instructions.md similarity index 79% rename from exercises/practice/affine-cipher/README.md rename to exercises/practice/affine-cipher/.docs/instructions.md index 734b8d707..b29ffdd7d 100644 --- a/exercises/practice/affine-cipher/README.md +++ b/exercises/practice/affine-cipher/.docs/instructions.md @@ -1,4 +1,4 @@ -# Affine Cipher +# Instructions Create an implementation of the affine cipher, an ancient encryption system created in the Middle East. @@ -68,23 +68,3 @@ harder to guess things based on word boundaries. - `15 mod 26 = 15` - `15 * 7 mod 26 = 105 mod 26 = 1` - `7` is the MMI of `15 mod 26` - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Wikipedia [http://en.wikipedia.org/wiki/Affine_cipher](http://en.wikipedia.org/wiki/Affine_cipher) - diff --git a/exercises/practice/affine-cipher/.meta/config.json b/exercises/practice/affine-cipher/.meta/config.json new file mode 100644 index 000000000..275d58331 --- /dev/null +++ b/exercises/practice/affine-cipher/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Wikipedia", + "source_url": "http://en.wikipedia.org/wiki/Affine_cipher" +} diff --git a/exercises/practice/all-your-base/README.md b/exercises/practice/all-your-base/.docs/instructions.md similarity index 59% rename from exercises/practice/all-your-base/README.md rename to exercises/practice/all-your-base/.docs/instructions.md index 12e064205..c39686f28 100644 --- a/exercises/practice/all-your-base/README.md +++ b/exercises/practice/all-your-base/.docs/instructions.md @@ -1,4 +1,4 @@ -# All Your Base +# Instructions Convert a number, represented as a sequence of digits in one base, to any other base. @@ -30,19 +30,3 @@ The number 1120, *in base 3*, means: I think you got the idea! *Yes. Those three numbers above are exactly the same. Congratulations!* - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/all-your-base/.meta/config.json b/exercises/practice/all-your-base/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/all-your-base/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/allergies/README.md b/exercises/practice/allergies/.docs/instructions.md similarity index 59% rename from exercises/practice/allergies/README.md rename to exercises/practice/allergies/.docs/instructions.md index a761da34e..b8bbd5a3f 100644 --- a/exercises/practice/allergies/README.md +++ b/exercises/practice/allergies/.docs/instructions.md @@ -1,4 +1,4 @@ -# Allergies +# Instructions Given a person's allergy score, determine whether or not they're allergic to a given item, and their full list of allergies. @@ -28,23 +28,3 @@ 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. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Jumpstart Lab Warm-up [http://jumpstartlab.com](http://jumpstartlab.com) - diff --git a/exercises/practice/allergies/.meta/config.json b/exercises/practice/allergies/.meta/config.json new file mode 100644 index 000000000..bffe8b341 --- /dev/null +++ b/exercises/practice/allergies/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Jumpstart Lab Warm-up", + "source_url": "http://jumpstartlab.com" +} diff --git a/exercises/practice/alphametics/.meta/hints.md b/exercises/practice/alphametics/.docs/instructions.append.md similarity index 94% rename from exercises/practice/alphametics/.meta/hints.md rename to exercises/practice/alphametics/.docs/instructions.append.md index 78967e0c8..4a925973c 100644 --- a/exercises/practice/alphametics/.meta/hints.md +++ b/exercises/practice/alphametics/.docs/instructions.append.md @@ -1,4 +1,4 @@ -## Hints +# Instructions append - To parse the text, you could try to use the [FParsec](http://www.quanttec.com/fparsec/tutorial.html) library. - You can solve this exercise with a brute force algorithm, but this will possibly have a poor runtime performance. Try to find a more sophisticated solution. Hint: You could try the column-wise addition algorithm that is usually taught in school. diff --git a/exercises/practice/alphametics/.docs/instructions.md b/exercises/practice/alphametics/.docs/instructions.md new file mode 100644 index 000000000..6936c192d --- /dev/null +++ b/exercises/practice/alphametics/.docs/instructions.md @@ -0,0 +1,32 @@ +# Instructions + +Write a function to solve alphametics puzzles. + +[Alphametics](https://en.wikipedia.org/wiki/Alphametics) is a puzzle where +letters in words are replaced with numbers. + +For example `SEND + MORE = MONEY`: + +```text + S E N D + M O R E + +----------- +M O N E Y +``` + +Replacing these with valid numbers gives: + +```text + 9 5 6 7 + 1 0 8 5 + +----------- +1 0 6 5 2 +``` + +This is correct because every letter is replaced by a different number and the +words, translated into numbers, then make a valid sum. + +Each letter must represent a different digit, and the leading digit of +a multi-digit number must not be zero. + +Write a function to solve alphametics puzzles. diff --git a/exercises/practice/alphametics/.meta/config.json b/exercises/practice/alphametics/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/alphametics/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/alphametics/README.md b/exercises/practice/alphametics/README.md deleted file mode 100644 index bc2a2aae7..000000000 --- a/exercises/practice/alphametics/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# Alphametics - -Write a function to solve alphametics puzzles. - -[Alphametics](https://en.wikipedia.org/wiki/Alphametics) is a puzzle where -letters in words are replaced with numbers. - -For example `SEND + MORE = MONEY`: - -```text - S E N D - M O R E + ------------ -M O N E Y -``` - -Replacing these with valid numbers gives: - -```text - 9 5 6 7 - 1 0 8 5 + ------------ -1 0 6 5 2 -``` - -This is correct because every letter is replaced by a different number and the -words, translated into numbers, then make a valid sum. - -Each letter must represent a different digit, and the leading digit of -a multi-digit number must not be zero. - -Write a function to solve alphametics puzzles. - -## Hints -- To parse the text, you could try to use the [FParsec](http://www.quanttec.com/fparsec/tutorial.html) library. -- You can solve this exercise with a brute force algorithm, but this will possibly have a poor runtime performance. -Try to find a more sophisticated solution. Hint: You could try the column-wise addition algorithm that is usually taught in school. - - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/anagram/.docs/instructions.md b/exercises/practice/anagram/.docs/instructions.md new file mode 100644 index 000000000..2675b5836 --- /dev/null +++ b/exercises/practice/anagram/.docs/instructions.md @@ -0,0 +1,8 @@ +# Instructions + +An anagram is a rearrangement of letters to form a new word. +Given a word and a list of candidates, select the sublist of anagrams of the given word. + +Given `"listen"` and a list of candidates like `"enlists" "google" +"inlets" "banana"` the program should return a list containing +`"inlets"`. diff --git a/exercises/practice/anagram/.meta/config.json b/exercises/practice/anagram/.meta/config.json new file mode 100644 index 000000000..8591c6609 --- /dev/null +++ b/exercises/practice/anagram/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Inspired by the Extreme Startup game", + "source_url": "https://github.com/rchatley/extreme_startup" +} diff --git a/exercises/practice/anagram/README.md b/exercises/practice/anagram/README.md deleted file mode 100644 index 46ecb0f9c..000000000 --- a/exercises/practice/anagram/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Anagram - -An anagram is a rearrangement of letters to form a new word. -Given a word and a list of candidates, select the sublist of anagrams of the given word. - -Given `"listen"` and a list of candidates like `"enlists" "google" -"inlets" "banana"` the program should return a list containing -`"inlets"`. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Inspired by the Extreme Startup game [https://github.com/rchatley/extreme_startup](https://github.com/rchatley/extreme_startup) - diff --git a/exercises/practice/armstrong-numbers/.docs/instructions.md b/exercises/practice/armstrong-numbers/.docs/instructions.md new file mode 100644 index 000000000..452a996fb --- /dev/null +++ b/exercises/practice/armstrong-numbers/.docs/instructions.md @@ -0,0 +1,12 @@ +# Instructions + +An [Armstrong number](https://en.wikipedia.org/wiki/Narcissistic_number) is a number that is the sum of its own digits each raised to the power of the number of digits. + +For example: + +- 9 is an Armstrong number, because `9 = 9^1 = 9` +- 10 is *not* an Armstrong number, because `10 != 1^2 + 0^2 = 1` +- 153 is an Armstrong number, because: `153 = 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153` +- 154 is *not* an Armstrong number, because: `154 != 1^3 + 5^3 + 4^3 = 1 + 125 + 64 = 190` + +Write some code to determine whether a number is an Armstrong number. diff --git a/exercises/practice/armstrong-numbers/.meta/config.json b/exercises/practice/armstrong-numbers/.meta/config.json new file mode 100644 index 000000000..562a04c42 --- /dev/null +++ b/exercises/practice/armstrong-numbers/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Wikipedia", + "source_url": "https://en.wikipedia.org/wiki/Narcissistic_number" +} diff --git a/exercises/practice/armstrong-numbers/README.md b/exercises/practice/armstrong-numbers/README.md deleted file mode 100644 index 8e05faba9..000000000 --- a/exercises/practice/armstrong-numbers/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# Armstrong Numbers - -An [Armstrong number](https://en.wikipedia.org/wiki/Narcissistic_number) is a number that is the sum of its own digits each raised to the power of the number of digits. - -For example: - -- 9 is an Armstrong number, because `9 = 9^1 = 9` -- 10 is *not* an Armstrong number, because `10 != 1^2 + 0^2 = 1` -- 153 is an Armstrong number, because: `153 = 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153` -- 154 is *not* an Armstrong number, because: `154 != 1^3 + 5^3 + 4^3 = 1 + 125 + 64 = 190` - -Write some code to determine whether a number is an Armstrong number. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Wikipedia [https://en.wikipedia.org/wiki/Narcissistic_number](https://en.wikipedia.org/wiki/Narcissistic_number) - diff --git a/exercises/practice/atbash-cipher/README.md b/exercises/practice/atbash-cipher/.docs/instructions.md similarity index 60% rename from exercises/practice/atbash-cipher/README.md rename to exercises/practice/atbash-cipher/.docs/instructions.md index d731c3e8e..2f712b159 100644 --- a/exercises/practice/atbash-cipher/README.md +++ b/exercises/practice/atbash-cipher/.docs/instructions.md @@ -1,4 +1,4 @@ -# Atbash Cipher +# Instructions Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East. @@ -27,23 +27,3 @@ things based on word boundaries. - Encoding `test` gives `gvhg` - Decoding `gvhg` gives `test` - Decoding `gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt` gives `thequickbrownfoxjumpsoverthelazydog` - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Wikipedia [http://en.wikipedia.org/wiki/Atbash](http://en.wikipedia.org/wiki/Atbash) - diff --git a/exercises/practice/atbash-cipher/.meta/config.json b/exercises/practice/atbash-cipher/.meta/config.json new file mode 100644 index 000000000..44cb2faac --- /dev/null +++ b/exercises/practice/atbash-cipher/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Wikipedia", + "source_url": "http://en.wikipedia.org/wiki/Atbash" +} diff --git a/exercises/practice/bank-account/README.md b/exercises/practice/bank-account/.docs/instructions.md similarity index 60% rename from exercises/practice/bank-account/README.md rename to exercises/practice/bank-account/.docs/instructions.md index c4bab0162..1265ac8b3 100644 --- a/exercises/practice/bank-account/README.md +++ b/exercises/practice/bank-account/.docs/instructions.md @@ -1,4 +1,4 @@ -# Bank Account +# Instructions Simulate a bank account supporting opening/closing, withdrawals, and deposits of money. Watch out for concurrent transactions! @@ -25,19 +25,3 @@ towards a solution that is as readable and expressive as you can make it. Have fun! - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/bank-account/.meta/config.json b/exercises/practice/bank-account/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/bank-account/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/beer-song/.meta/hints.md b/exercises/practice/beer-song/.docs/instructions.append.md similarity index 83% rename from exercises/practice/beer-song/.meta/hints.md rename to exercises/practice/beer-song/.docs/instructions.append.md index 5911e1b55..c1aef0ee5 100644 --- a/exercises/practice/beer-song/.meta/hints.md +++ b/exercises/practice/beer-song/.docs/instructions.append.md @@ -1,2 +1,2 @@ -## Hints +# Instructions append - Try to capture the structure of the song in your code, where you build up the song by composing its parts. diff --git a/exercises/practice/beer-song/README.md b/exercises/practice/beer-song/.docs/instructions.md similarity index 93% rename from exercises/practice/beer-song/README.md rename to exercises/practice/beer-song/.docs/instructions.md index e5cc4bae7..57429d8ab 100644 --- a/exercises/practice/beer-song/README.md +++ b/exercises/practice/beer-song/.docs/instructions.md @@ -1,4 +1,4 @@ -# Beer Song +# Instructions Recite the lyrics to that beloved classic, that field-trip favorite: 99 Bottles of Beer on the Wall. @@ -319,27 +319,3 @@ are some additional things you could try: 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? - -## Hints -- Try to capture the structure of the song in your code, where you build up the song by composing its parts. - - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Learn to Program by Chris Pine [http://pine.fm/LearnToProgram/?Chapter=06](http://pine.fm/LearnToProgram/?Chapter=06) - diff --git a/exercises/practice/beer-song/.meta/config.json b/exercises/practice/beer-song/.meta/config.json new file mode 100644 index 000000000..edb5b2d03 --- /dev/null +++ b/exercises/practice/beer-song/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Learn to Program by Chris Pine", + "source_url": "http://pine.fm/LearnToProgram/?Chapter=06" +} diff --git a/exercises/practice/binary-search-tree/README.md b/exercises/practice/binary-search-tree/.docs/instructions.md similarity index 69% rename from exercises/practice/binary-search-tree/README.md rename to exercises/practice/binary-search-tree/.docs/instructions.md index 47c5aa629..ba3c42eb6 100644 --- a/exercises/practice/binary-search-tree/README.md +++ b/exercises/practice/binary-search-tree/.docs/instructions.md @@ -1,4 +1,4 @@ -# Binary Search Tree +# Instructions Insert and search for numbers in a binary tree. @@ -52,23 +52,3 @@ And if we then added 1, 5, and 7, it would look like this 2 6 / \ / \ 1 3 5 7 - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Josh Cheek [https://twitter.com/josh_cheek](https://twitter.com/josh_cheek) - diff --git a/exercises/practice/binary-search-tree/.meta/config.json b/exercises/practice/binary-search-tree/.meta/config.json new file mode 100644 index 000000000..ad89e2735 --- /dev/null +++ b/exercises/practice/binary-search-tree/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Josh Cheek", + "source_url": "https://twitter.com/josh_cheek" +} diff --git a/exercises/practice/binary-search/README.md b/exercises/practice/binary-search/.docs/instructions.md similarity index 67% rename from exercises/practice/binary-search/README.md rename to exercises/practice/binary-search/.docs/instructions.md index 39b2ea96a..4dcaba726 100644 --- a/exercises/practice/binary-search/README.md +++ b/exercises/practice/binary-search/.docs/instructions.md @@ -1,4 +1,4 @@ -# Binary Search +# Instructions Implement a binary search algorithm. @@ -33,23 +33,3 @@ 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. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Wikipedia [http://en.wikipedia.org/wiki/Binary_search_algorithm](http://en.wikipedia.org/wiki/Binary_search_algorithm) - diff --git a/exercises/practice/binary-search/.meta/config.json b/exercises/practice/binary-search/.meta/config.json new file mode 100644 index 000000000..dbb9aaed4 --- /dev/null +++ b/exercises/practice/binary-search/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Wikipedia", + "source_url": "http://en.wikipedia.org/wiki/Binary_search_algorithm" +} diff --git a/exercises/practice/binary/README.md b/exercises/practice/binary/.docs/instructions.md similarity index 54% rename from exercises/practice/binary/README.md rename to exercises/practice/binary/.docs/instructions.md index db4ba46be..3cfde215f 100644 --- a/exercises/practice/binary/README.md +++ b/exercises/practice/binary/.docs/instructions.md @@ -1,4 +1,4 @@ -# Binary +# Instructions Convert a binary number, represented as a string (e.g. '101010'), to its decimal equivalent using first principles. @@ -29,23 +29,3 @@ So: `23 => 2*10^1 + 3*10^0 => 2*10 + 3*1 = 23 base 10` Binary is similar, but uses powers of 2 rather than powers of 10. So: `101 => 1*2^2 + 0*2^1 + 1*2^0 => 1*4 + 0*2 + 1*1 => 4 + 1 => 5 base 10`. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -All of Computer Science [http://www.wolframalpha.com/input/?i=binary&a=*C.binary-_*MathWorld-](http://www.wolframalpha.com/input/?i=binary&a=*C.binary-_*MathWorld-) - diff --git a/exercises/practice/binary/.meta/config.json b/exercises/practice/binary/.meta/config.json new file mode 100644 index 000000000..669f8779a --- /dev/null +++ b/exercises/practice/binary/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "All of Computer Science", + "source_url": "http://www.wolframalpha.com/input/?i=binary&a=*C.binary-_*MathWorld-" +} diff --git a/exercises/practice/bob/.docs/instructions.md b/exercises/practice/bob/.docs/instructions.md new file mode 100644 index 000000000..edddb1413 --- /dev/null +++ b/exercises/practice/bob/.docs/instructions.md @@ -0,0 +1,16 @@ +# Instructions + +Bob is a lackadaisical teenager. In conversation, his responses are very limited. + +Bob answers 'Sure.' if you ask him a question, such as "How are you?". + +He answers 'Whoa, chill out!' if you YELL AT HIM (in all capitals). + +He answers 'Calm down, I know what I'm doing!' if you yell a question at him. + +He says 'Fine. Be that way!' if you address him without actually saying +anything. + +He answers 'Whatever.' to anything else. + +Bob's conversational partner is a purist when it comes to written communication and always follows normal rules regarding sentence punctuation in English. diff --git a/exercises/practice/bob/.meta/config.json b/exercises/practice/bob/.meta/config.json new file mode 100644 index 000000000..c98bfb899 --- /dev/null +++ b/exercises/practice/bob/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Inspired by the 'Deaf Grandma' exercise in Chris Pine's Learn to Program tutorial.", + "source_url": "http://pine.fm/LearnToProgram/?Chapter=06" +} diff --git a/exercises/practice/bob/README.md b/exercises/practice/bob/README.md deleted file mode 100644 index 2b49a257c..000000000 --- a/exercises/practice/bob/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Bob - -Bob is a lackadaisical teenager. In conversation, his responses are very limited. - -Bob answers 'Sure.' if you ask him a question, such as "How are you?". - -He answers 'Whoa, chill out!' if you YELL AT HIM (in all capitals). - -He answers 'Calm down, I know what I'm doing!' if you yell a question at him. - -He says 'Fine. Be that way!' if you address him without actually saying -anything. - -He answers 'Whatever.' to anything else. - -Bob's conversational partner is a purist when it comes to written communication and always follows normal rules regarding sentence punctuation in English. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## 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) - diff --git a/exercises/practice/book-store/README.md b/exercises/practice/book-store/.docs/instructions.md similarity index 71% rename from exercises/practice/book-store/README.md rename to exercises/practice/book-store/.docs/instructions.md index a72ff3719..8ec0a7ba2 100644 --- a/exercises/practice/book-store/README.md +++ b/exercises/practice/book-store/.docs/instructions.md @@ -1,4 +1,4 @@ -# Book Store +# Instructions 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. @@ -66,23 +66,3 @@ Resulting in: For a total of $51.20 And $51.20 is the price with the biggest discount. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Inspired by the harry potter kata from Cyber-Dojo. [http://cyber-dojo.org](http://cyber-dojo.org) - diff --git a/exercises/practice/book-store/.meta/config.json b/exercises/practice/book-store/.meta/config.json new file mode 100644 index 000000000..fb503f44b --- /dev/null +++ b/exercises/practice/book-store/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Inspired by the harry potter kata from Cyber-Dojo.", + "source_url": "http://cyber-dojo.org" +} diff --git a/exercises/practice/bowling/README.md b/exercises/practice/bowling/.docs/instructions.md similarity index 74% rename from exercises/practice/bowling/README.md rename to exercises/practice/bowling/.docs/instructions.md index f2ddc1c7c..be9b27faf 100644 --- a/exercises/practice/bowling/README.md +++ b/exercises/practice/bowling/.docs/instructions.md @@ -1,4 +1,4 @@ -# Bowling +# Instructions Score a bowling game. @@ -59,23 +59,3 @@ support two operations: 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. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -The Bowling Game Kata at but UncleBob [http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata](http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata) - diff --git a/exercises/practice/bowling/.meta/config.json b/exercises/practice/bowling/.meta/config.json new file mode 100644 index 000000000..5c26c43c0 --- /dev/null +++ b/exercises/practice/bowling/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "The Bowling Game Kata at but UncleBob", + "source_url": "http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata" +} diff --git a/exercises/practice/change/.docs/instructions.md b/exercises/practice/change/.docs/instructions.md new file mode 100644 index 000000000..59f4f4f90 --- /dev/null +++ b/exercises/practice/change/.docs/instructions.md @@ -0,0 +1,17 @@ +# Instructions + +Correctly determine the fewest number of coins to be given to a customer such +that the sum of the coins' value would equal the correct amount of change. + +## For example + +- An input of 15 with [1, 5, 10, 25, 100] should return one nickel (5) + and one dime (10) or [5, 10] +- An input of 40 with [1, 5, 10, 25, 100] should return one nickel (5) + and one dime (10) and one quarter (25) or [5, 10, 25] + +## Edge cases + +- Does your algorithm work for any given set of coins? +- Can you ask for negative change? +- Can you ask for a change value smaller than the smallest coin value? diff --git a/exercises/practice/change/.meta/config.json b/exercises/practice/change/.meta/config.json new file mode 100644 index 000000000..c4bce7058 --- /dev/null +++ b/exercises/practice/change/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Software Craftsmanship - Coin Change Kata", + "source_url": "https://web.archive.org/web/20130115115225/http://craftsmanship.sv.cmu.edu:80/exercises/coin-change-kata" +} diff --git a/exercises/practice/change/README.md b/exercises/practice/change/README.md deleted file mode 100644 index 270affcd7..000000000 --- a/exercises/practice/change/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# Change - -Correctly determine the fewest number of coins to be given to a customer such -that the sum of the coins' value would equal the correct amount of change. - -## For example - -- An input of 15 with [1, 5, 10, 25, 100] should return one nickel (5) - and one dime (10) or [5, 10] -- An input of 40 with [1, 5, 10, 25, 100] should return one nickel (5) - and one dime (10) and one quarter (25) or [5, 10, 25] - -## Edge cases - -- Does your algorithm work for any given set of coins? -- Can you ask for negative change? -- Can you ask for a change value smaller than the smallest coin value? - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Software Craftsmanship - Coin Change Kata [https://web.archive.org/web/20130115115225/http://craftsmanship.sv.cmu.edu:80/exercises/coin-change-kata](https://web.archive.org/web/20130115115225/http://craftsmanship.sv.cmu.edu:80/exercises/coin-change-kata) - diff --git a/exercises/practice/circular-buffer/README.md b/exercises/practice/circular-buffer/.docs/instructions.md similarity index 69% rename from exercises/practice/circular-buffer/README.md rename to exercises/practice/circular-buffer/.docs/instructions.md index 9c3aea18e..88c15b5a4 100644 --- a/exercises/practice/circular-buffer/README.md +++ b/exercises/practice/circular-buffer/.docs/instructions.md @@ -1,4 +1,4 @@ -# Circular Buffer +# Instructions 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. @@ -49,23 +49,3 @@ be used not the location of 7 & 8. 7 is still the oldest element and the buffer is once again full. [D][7][8][9][A][B][C] - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Wikipedia [http://en.wikipedia.org/wiki/Circular_buffer](http://en.wikipedia.org/wiki/Circular_buffer) - diff --git a/exercises/practice/circular-buffer/.meta/config.json b/exercises/practice/circular-buffer/.meta/config.json new file mode 100644 index 000000000..6dec040d9 --- /dev/null +++ b/exercises/practice/circular-buffer/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Wikipedia", + "source_url": "http://en.wikipedia.org/wiki/Circular_buffer" +} diff --git a/exercises/practice/clock/.docs/instructions.md b/exercises/practice/clock/.docs/instructions.md new file mode 100644 index 000000000..a1efc7890 --- /dev/null +++ b/exercises/practice/clock/.docs/instructions.md @@ -0,0 +1,7 @@ +# Instructions + +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. diff --git a/exercises/practice/clock/.meta/config.json b/exercises/practice/clock/.meta/config.json new file mode 100644 index 000000000..dbc9a1d67 --- /dev/null +++ b/exercises/practice/clock/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Pairing session with Erin Drummond", + "source_url": "https://twitter.com/ebdrummond" +} diff --git a/exercises/practice/clock/README.md b/exercises/practice/clock/README.md deleted file mode 100644 index 0400369f5..000000000 --- a/exercises/practice/clock/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# 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. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Pairing session with Erin Drummond [https://twitter.com/ebdrummond](https://twitter.com/ebdrummond) - diff --git a/exercises/practice/collatz-conjecture/.docs/instructions.md b/exercises/practice/collatz-conjecture/.docs/instructions.md new file mode 100644 index 000000000..f8c76e7f1 --- /dev/null +++ b/exercises/practice/collatz-conjecture/.docs/instructions.md @@ -0,0 +1,27 @@ +# Instructions + +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. diff --git a/exercises/practice/collatz-conjecture/.meta/config.json b/exercises/practice/collatz-conjecture/.meta/config.json new file mode 100644 index 000000000..c638ce658 --- /dev/null +++ b/exercises/practice/collatz-conjecture/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "An unsolved problem in mathematics named after mathematician Lothar Collatz", + "source_url": "https://en.wikipedia.org/wiki/3x_%2B_1_problem" +} diff --git a/exercises/practice/collatz-conjecture/README.md b/exercises/practice/collatz-conjecture/README.md deleted file mode 100644 index bce70e6db..000000000 --- a/exercises/practice/collatz-conjecture/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## 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) - diff --git a/exercises/practice/complex-numbers/README.md b/exercises/practice/complex-numbers/.docs/instructions.md similarity index 67% rename from exercises/practice/complex-numbers/README.md rename to exercises/practice/complex-numbers/.docs/instructions.md index bb00ad68c..267ff6151 100644 --- a/exercises/practice/complex-numbers/README.md +++ b/exercises/practice/complex-numbers/.docs/instructions.md @@ -1,4 +1,4 @@ -# Complex Numbers +# Instructions A complex number is a number in the form `a + b * i` where `a` and `b` are real and `i` satisfies `i^2 = -1`. @@ -27,23 +27,3 @@ Implement the following operations: Assume the programming language you are using does not have an implementation of complex numbers. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Wikipedia [https://en.wikipedia.org/wiki/Complex_number](https://en.wikipedia.org/wiki/Complex_number) - diff --git a/exercises/practice/complex-numbers/.meta/config.json b/exercises/practice/complex-numbers/.meta/config.json new file mode 100644 index 000000000..9c209d8b9 --- /dev/null +++ b/exercises/practice/complex-numbers/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Wikipedia", + "source_url": "https://en.wikipedia.org/wiki/Complex_number" +} diff --git a/exercises/practice/connect/README.md b/exercises/practice/connect/.docs/instructions.md similarity index 65% rename from exercises/practice/connect/README.md rename to exercises/practice/connect/.docs/instructions.md index f0310c67f..2fa003a83 100644 --- a/exercises/practice/connect/README.md +++ b/exercises/practice/connect/.docs/instructions.md @@ -1,4 +1,4 @@ -# Connect +# Instructions Compute the result for a game of Hex / Polygon. @@ -29,19 +29,3 @@ The boards look like this: "Player `O`" plays from top to bottom, "Player `X`" plays from left to right. In the above example `O` has made a connection from left to right but nobody has won since `O` didn't connect top and bottom. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/connect/.meta/config.json b/exercises/practice/connect/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/connect/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/crypto-square/README.md b/exercises/practice/crypto-square/.docs/instructions.md similarity index 68% rename from exercises/practice/crypto-square/README.md rename to exercises/practice/crypto-square/.docs/instructions.md index 2ebe8602e..41615f819 100644 --- a/exercises/practice/crypto-square/README.md +++ b/exercises/practice/crypto-square/.docs/instructions.md @@ -1,4 +1,4 @@ -# Crypto Square +# Instructions Implement the classic method for composing secret messages called a square code. @@ -71,23 +71,3 @@ ciphertext back in to the original message: "aohghn " "sseoau " ``` - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## 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) - diff --git a/exercises/practice/crypto-square/.meta/config.json b/exercises/practice/crypto-square/.meta/config.json new file mode 100644 index 000000000..4f6d17a38 --- /dev/null +++ b/exercises/practice/crypto-square/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "J Dalbey's Programming Practice problems", + "source_url": "http://users.csc.calpoly.edu/~jdalbey/103/Projects/ProgrammingPractice.html" +} diff --git a/exercises/practice/custom-set/.docs/instructions.md b/exercises/practice/custom-set/.docs/instructions.md new file mode 100644 index 000000000..e4931b058 --- /dev/null +++ b/exercises/practice/custom-set/.docs/instructions.md @@ -0,0 +1,8 @@ +# Instructions + +Create a custom set type. + +Sometimes it is necessary to define a custom data structure of some +type, like a set. In this exercise you will define your own set. How it +works internally doesn't matter, as long as it behaves like a set of +unique elements. diff --git a/exercises/practice/custom-set/.meta/config.json b/exercises/practice/custom-set/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/custom-set/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/custom-set/README.md b/exercises/practice/custom-set/README.md deleted file mode 100644 index 324566148..000000000 --- a/exercises/practice/custom-set/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Custom Set - -Create a custom set type. - -Sometimes it is necessary to define a custom data structure of some -type, like a set. In this exercise you will define your own set. How it -works internally doesn't matter, as long as it behaves like a set of -unique elements. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/darts/README.md b/exercises/practice/darts/.docs/instructions.md similarity index 64% rename from exercises/practice/darts/README.md rename to exercises/practice/darts/.docs/instructions.md index fd50b3757..701777865 100644 --- a/exercises/practice/darts/README.md +++ b/exercises/practice/darts/.docs/instructions.md @@ -1,4 +1,4 @@ -# Darts +# Instructions Write a function that returns the earned points in a single toss of a Darts game. @@ -15,22 +15,3 @@ In our particular instance of the game, the target rewards with 4 different amou The outer circle has a radius of 10 units (This is equivalent to the total radius for the entire target), the middle circle a radius of 5 units, and the inner circle a radius of 1. Of course, they are all centered to the same point (That is, the circles are [concentric](http://mathworld.wolfram.com/ConcentricCircles.html)) defined by the coordinates (0, 0). Write a function that given a point in the target (defined by its `real` cartesian coordinates `x` and `y`), returns the correct amount earned by a dart landing in that point. -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Inspired by an exercise created by a professor Della Paolera in Argentina - diff --git a/exercises/practice/darts/.meta/config.json b/exercises/practice/darts/.meta/config.json new file mode 100644 index 000000000..f73d01f47 --- /dev/null +++ b/exercises/practice/darts/.meta/config.json @@ -0,0 +1,9 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Inspired by an exercise created by a professor Della Paolera in Argentina" +} diff --git a/exercises/practice/diamond/.meta/hints.md b/exercises/practice/diamond/.docs/instructions.append.md similarity index 92% rename from exercises/practice/diamond/.meta/hints.md rename to exercises/practice/diamond/.docs/instructions.append.md index 8830ce02a..2829979df 100644 --- a/exercises/practice/diamond/.meta/hints.md +++ b/exercises/practice/diamond/.docs/instructions.append.md @@ -1,2 +1,2 @@ -## Hints +# Instructions append - Testing this one can be tricky without simply hardcoding a bunch of inputs and outputs. [Property based testing](https://fsharpforfunandprofit.com/posts/property-based-testing/) is another way to think about testing that allows you to more easily test this type of algorithm. \ No newline at end of file diff --git a/exercises/practice/diamond/README.md b/exercises/practice/diamond/.docs/instructions.md similarity index 53% rename from exercises/practice/diamond/README.md rename to exercises/practice/diamond/.docs/instructions.md index 1302abb2b..1de7016f0 100644 --- a/exercises/practice/diamond/README.md +++ b/exercises/practice/diamond/.docs/instructions.md @@ -1,4 +1,4 @@ -# Diamond +# Instructions The diamond kata takes as its input a letter, and outputs it in a diamond shape. Given a letter, it prints a diamond starting with 'A', with the @@ -51,26 +51,3 @@ E·······E ···B·B··· ····A···· ``` - -## Hints -- Testing this one can be tricky without simply hardcoding a bunch of inputs and outputs. [Property based testing](https://fsharpforfunandprofit.com/posts/property-based-testing/) is another way to think about testing that allows you to more easily test this type of algorithm. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Seb Rose [http://claysnow.co.uk/recycling-tests-in-tdd/](http://claysnow.co.uk/recycling-tests-in-tdd/) - diff --git a/exercises/practice/diamond/.meta/config.json b/exercises/practice/diamond/.meta/config.json new file mode 100644 index 000000000..6fdcc7af8 --- /dev/null +++ b/exercises/practice/diamond/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Seb Rose", + "source_url": "http://claysnow.co.uk/recycling-tests-in-tdd/" +} diff --git a/exercises/practice/difference-of-squares/.meta/hints.md b/exercises/practice/difference-of-squares/.docs/instructions.append.md similarity index 95% rename from exercises/practice/difference-of-squares/.meta/hints.md rename to exercises/practice/difference-of-squares/.docs/instructions.append.md index edb9cb23d..b612c71de 100644 --- a/exercises/practice/difference-of-squares/.meta/hints.md +++ b/exercises/practice/difference-of-squares/.docs/instructions.append.md @@ -1,4 +1,4 @@ -## Hints +# Instructions append For this exercise the following F# features come in handy: - The [range operator](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/operators.%5B-..-%5D%5B%5Et%5D-function-%5Bfsharp%5D) allows you to succinctly create a range of values. - [List.sumBy](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/list.sumby%5B't,%5Eu%5D-function-%5Bfsharp%5D) is a condensed format to apply a function to a list and then sum the results. diff --git a/exercises/practice/difference-of-squares/.docs/instructions.md b/exercises/practice/difference-of-squares/.docs/instructions.md new file mode 100644 index 000000000..c3999e86a --- /dev/null +++ b/exercises/practice/difference-of-squares/.docs/instructions.md @@ -0,0 +1,17 @@ +# Instructions + +Find the difference between the square of the sum and the sum of the squares of the first N natural numbers. + +The square of the sum of the first ten natural numbers is +(1 + 2 + ... + 10)² = 55² = 3025. + +The sum of the squares of the first ten natural numbers is +1² + 2² + ... + 10² = 385. + +Hence the difference between the square of the sum of the first +ten natural numbers and the sum of the squares of the first ten +natural numbers is 3025 - 385 = 2640. + +You are not expected to discover an efficient solution to this yourself from +first principles; research is allowed, indeed, encouraged. Finding the best +algorithm for the problem is a key skill in software engineering. diff --git a/exercises/practice/difference-of-squares/.meta/config.json b/exercises/practice/difference-of-squares/.meta/config.json new file mode 100644 index 000000000..7d5c33a19 --- /dev/null +++ b/exercises/practice/difference-of-squares/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Problem 6 at Project Euler", + "source_url": "http://projecteuler.net/problem=6" +} diff --git a/exercises/practice/difference-of-squares/README.md b/exercises/practice/difference-of-squares/README.md deleted file mode 100644 index 41f799798..000000000 --- a/exercises/practice/difference-of-squares/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Difference Of Squares - -Find the difference between the square of the sum and the sum of the squares of the first N natural numbers. - -The square of the sum of the first ten natural numbers is -(1 + 2 + ... + 10)² = 55² = 3025. - -The sum of the squares of the first ten natural numbers is -1² + 2² + ... + 10² = 385. - -Hence the difference between the square of the sum of the first -ten natural numbers and the sum of the squares of the first ten -natural numbers is 3025 - 385 = 2640. - -You are not expected to discover an efficient solution to this yourself from -first principles; research is allowed, indeed, encouraged. Finding the best -algorithm for the problem is a key skill in software engineering. - -## Hints -For this exercise the following F# features come in handy: -- The [range operator](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/operators.%5B-..-%5D%5B%5Et%5D-function-%5Bfsharp%5D) allows you to succinctly create a range of values. -- [List.sumBy](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/list.sumby%5B't,%5Eu%5D-function-%5Bfsharp%5D) is a condensed format to apply a function to a list and then sum the results. - - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Problem 6 at Project Euler [http://projecteuler.net/problem=6](http://projecteuler.net/problem=6) - diff --git a/exercises/practice/diffie-hellman/.meta/hints.md b/exercises/practice/diffie-hellman/.docs/instructions.append.md similarity index 88% rename from exercises/practice/diffie-hellman/.meta/hints.md rename to exercises/practice/diffie-hellman/.docs/instructions.append.md index 83b48bbd7..49da4039e 100644 --- a/exercises/practice/diffie-hellman/.meta/hints.md +++ b/exercises/practice/diffie-hellman/.docs/instructions.append.md @@ -1,3 +1,3 @@ -## Hints +# Instructions append For this exercise the following F# feature comes in handy: - [BigInt](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/numerics.biginteger-structure-%5Bfsharp%5D) diff --git a/exercises/practice/diffie-hellman/.docs/instructions.md b/exercises/practice/diffie-hellman/.docs/instructions.md new file mode 100644 index 000000000..589cbd19f --- /dev/null +++ b/exercises/practice/diffie-hellman/.docs/instructions.md @@ -0,0 +1,38 @@ +# Instructions + +Diffie-Hellman key exchange. + +Alice and Bob use Diffie-Hellman key exchange to share secrets. They +start with prime numbers, pick private keys, generate and share public +keys, and then generate a shared secret key. + +## Step 0 + +The test program supplies prime numbers p and g. + +## Step 1 + +Alice picks a private key, a, greater than 1 and less than p. Bob does +the same to pick a private key b. + +## Step 2 + +Alice calculates a public key A. + + A = g**a mod p + +Using the same p and g, Bob similarly calculates a public key B from his +private key b. + +## Step 3 + +Alice and Bob exchange public keys. Alice calculates secret key s. + + s = B**a mod p + +Bob calculates + + s = A**b mod p + +The calculations produce the same result! Alice and Bob now share +secret s. diff --git a/exercises/practice/diffie-hellman/.meta/config.json b/exercises/practice/diffie-hellman/.meta/config.json new file mode 100644 index 000000000..fba1addad --- /dev/null +++ b/exercises/practice/diffie-hellman/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Wikipedia, 1024 bit key from www.cryptopp.com/wiki.", + "source_url": "http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange" +} diff --git a/exercises/practice/diffie-hellman/README.md b/exercises/practice/diffie-hellman/README.md deleted file mode 100644 index 5ede74ae5..000000000 --- a/exercises/practice/diffie-hellman/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# Diffie Hellman - -Diffie-Hellman key exchange. - -Alice and Bob use Diffie-Hellman key exchange to share secrets. They -start with prime numbers, pick private keys, generate and share public -keys, and then generate a shared secret key. - -## Step 0 - -The test program supplies prime numbers p and g. - -## Step 1 - -Alice picks a private key, a, greater than 1 and less than p. Bob does -the same to pick a private key b. - -## Step 2 - -Alice calculates a public key A. - - A = g**a mod p - -Using the same p and g, Bob similarly calculates a public key B from his -private key b. - -## Step 3 - -Alice and Bob exchange public keys. Alice calculates secret key s. - - s = B**a mod p - -Bob calculates - - s = A**b mod p - -The calculations produce the same result! Alice and Bob now share -secret s. - -## Hints -For this exercise the following F# feature comes in handy: -- [BigInteger](https://docs.microsoft.com/en-us/dotnet/api/system.numerics.biginteger?view=netcore-3.1) - - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Wikipedia, 1024 bit key from www.cryptopp.com/wiki. [http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange](http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange) - diff --git a/exercises/practice/dnd-character/README.md b/exercises/practice/dnd-character/.docs/instructions.md similarity index 67% rename from exercises/practice/dnd-character/README.md rename to exercises/practice/dnd-character/.docs/instructions.md index 55f143110..53d9f9851 100644 --- a/exercises/practice/dnd-character/README.md +++ b/exercises/practice/dnd-character/.docs/instructions.md @@ -1,4 +1,4 @@ -# D&D Character +# Instructions For a game of [Dungeons & Dragons][DND], each player starts by generating a character they can play with. This character has, among other things, six @@ -31,23 +31,3 @@ programming languages are designed to roll dice. One such language is [Troll]. [DND]: https://en.wikipedia.org/wiki/Dungeons_%26_Dragons [Troll]: http://hjemmesider.diku.dk/~torbenm/Troll/ - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Simon Shine, Erik Schierboom [https://github.com/exercism/problem-specifications/issues/616#issuecomment-437358945](https://github.com/exercism/problem-specifications/issues/616#issuecomment-437358945) - diff --git a/exercises/practice/dnd-character/.meta/config.json b/exercises/practice/dnd-character/.meta/config.json new file mode 100644 index 000000000..f22925547 --- /dev/null +++ b/exercises/practice/dnd-character/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Simon Shine, Erik Schierboom", + "source_url": "https://github.com/exercism/problem-specifications/issues/616#issuecomment-437358945" +} diff --git a/exercises/practice/dominoes/README.md b/exercises/practice/dominoes/.docs/instructions.md similarity index 57% rename from exercises/practice/dominoes/README.md rename to exercises/practice/dominoes/.docs/instructions.md index 324b8f027..47f05a60d 100644 --- a/exercises/practice/dominoes/README.md +++ b/exercises/practice/dominoes/.docs/instructions.md @@ -1,4 +1,4 @@ -# Dominoes +# Instructions Make a chain of dominoes. @@ -13,19 +13,3 @@ like `[1|2] [2|3] [3|1]` or `[3|2] [2|1] [1|3]` or `[1|3] [3|2] [2|1]` etc, wher For stones `[1|2]`, `[4|1]` and `[2|3]` the resulting chain is not valid: `[4|1] [1|2] [2|3]`'s first and last numbers are not the same. 4 != 3 Some test cases may use duplicate stones in a chain solution, assume that multiple Domino sets are being used. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/dominoes/.meta/config.json b/exercises/practice/dominoes/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/dominoes/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/dot-dsl/README.md b/exercises/practice/dot-dsl/.docs/instructions.md similarity index 65% rename from exercises/practice/dot-dsl/README.md rename to exercises/practice/dot-dsl/.docs/instructions.md index 2fcaab6f8..f61f3f0b4 100644 --- a/exercises/practice/dot-dsl/README.md +++ b/exercises/practice/dot-dsl/.docs/instructions.md @@ -1,4 +1,4 @@ -# DOT DSL +# Instructions A [Domain Specific Language (DSL)](https://en.wikipedia.org/wiki/Domain-specific_language) is a @@ -31,23 +31,3 @@ be an internal DSL for use only in our language. More information about the difference between internal and external DSLs can be found [here](https://martinfowler.com/bliki/DomainSpecificLanguage.html). - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Wikipedia [https://en.wikipedia.org/wiki/DOT_(graph_description_language)](https://en.wikipedia.org/wiki/DOT_(graph_description_language)) - diff --git a/exercises/practice/dot-dsl/.meta/config.json b/exercises/practice/dot-dsl/.meta/config.json new file mode 100644 index 000000000..249e72f4c --- /dev/null +++ b/exercises/practice/dot-dsl/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Wikipedia", + "source_url": "https://en.wikipedia.org/wiki/DOT_(graph_description_language)" +} diff --git a/exercises/practice/error-handling/.docs/instructions.md b/exercises/practice/error-handling/.docs/instructions.md new file mode 100644 index 000000000..7bc1a0856 --- /dev/null +++ b/exercises/practice/error-handling/.docs/instructions.md @@ -0,0 +1,10 @@ +# Instructions + +Implement various kinds of error handling and resource management. + +An important point of programming is how to handle errors and close +resources even if errors occur. + +This exercise requires you to handle various errors. Because error handling +is rather programming language specific you'll have to refer to the tests +for your track to see what's exactly required. diff --git a/exercises/practice/error-handling/.meta/config.json b/exercises/practice/error-handling/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/error-handling/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/error-handling/README.md b/exercises/practice/error-handling/README.md deleted file mode 100644 index c74b512ff..000000000 --- a/exercises/practice/error-handling/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# Error Handling - -Implement various kinds of error handling and resource management. - -An important point of programming is how to handle errors and close -resources even if errors occur. - -This exercise requires you to handle various errors. Because error handling -is rather programming language specific you'll have to refer to the tests -for your track to see what's exactly required. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/etl/README.md b/exercises/practice/etl/.docs/instructions.md similarity index 69% rename from exercises/practice/etl/README.md rename to exercises/practice/etl/.docs/instructions.md index d084d2444..369cead59 100644 --- a/exercises/practice/etl/README.md +++ b/exercises/practice/etl/.docs/instructions.md @@ -1,4 +1,4 @@ -# ETL +# Instructions We are going to do the `Transform` step of an Extract-Transform-Load. @@ -45,23 +45,3 @@ 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. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -The Jumpstart Lab team [http://jumpstartlab.com](http://jumpstartlab.com) - diff --git a/exercises/practice/etl/.meta/config.json b/exercises/practice/etl/.meta/config.json new file mode 100644 index 000000000..63ea2caed --- /dev/null +++ b/exercises/practice/etl/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "The Jumpstart Lab team", + "source_url": "http://jumpstartlab.com" +} diff --git a/exercises/practice/food-chain/.meta/hints.md b/exercises/practice/food-chain/.docs/instructions.append.md similarity index 83% rename from exercises/practice/food-chain/.meta/hints.md rename to exercises/practice/food-chain/.docs/instructions.append.md index 5911e1b55..c1aef0ee5 100644 --- a/exercises/practice/food-chain/.meta/hints.md +++ b/exercises/practice/food-chain/.docs/instructions.append.md @@ -1,2 +1,2 @@ -## Hints +# Instructions append - Try to capture the structure of the song in your code, where you build up the song by composing its parts. diff --git a/exercises/practice/food-chain/README.md b/exercises/practice/food-chain/.docs/instructions.md similarity index 73% rename from exercises/practice/food-chain/README.md rename to exercises/practice/food-chain/.docs/instructions.md index 3824169bb..4d9c10b59 100644 --- a/exercises/practice/food-chain/README.md +++ b/exercises/practice/food-chain/.docs/instructions.md @@ -1,4 +1,4 @@ -# Food Chain +# Instructions Generate the lyrics of the song 'I Know an Old Lady Who Swallowed a Fly'. @@ -62,27 +62,3 @@ I don't know why she swallowed the fly. Perhaps she'll die. I know an old lady who swallowed a horse. She's dead, of course! ``` - -## Hints -- Try to capture the structure of the song in your code, where you build up the song by composing its parts. - - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Wikipedia [http://en.wikipedia.org/wiki/There_Was_an_Old_Lady_Who_Swallowed_a_Fly](http://en.wikipedia.org/wiki/There_Was_an_Old_Lady_Who_Swallowed_a_Fly) - diff --git a/exercises/practice/food-chain/.meta/config.json b/exercises/practice/food-chain/.meta/config.json new file mode 100644 index 000000000..bae70dd9f --- /dev/null +++ b/exercises/practice/food-chain/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Wikipedia", + "source_url": "http://en.wikipedia.org/wiki/There_Was_an_Old_Lady_Who_Swallowed_a_Fly" +} diff --git a/exercises/practice/forth/README.md b/exercises/practice/forth/.docs/instructions.md similarity index 60% rename from exercises/practice/forth/README.md rename to exercises/practice/forth/.docs/instructions.md index f3bb786b9..f481b725a 100644 --- a/exercises/practice/forth/README.md +++ b/exercises/practice/forth/.docs/instructions.md @@ -1,4 +1,4 @@ -# Forth +# Instructions Implement an evaluator for a very simple subset of Forth. @@ -24,19 +24,3 @@ more letters, digits, symbols or punctuation that is not a number. enough.) Words are case-insensitive. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/forth/.meta/config.json b/exercises/practice/forth/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/forth/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/gigasecond/.docs/instructions.md b/exercises/practice/gigasecond/.docs/instructions.md new file mode 100644 index 000000000..680870f3a --- /dev/null +++ b/exercises/practice/gigasecond/.docs/instructions.md @@ -0,0 +1,6 @@ +# Instructions + +Given a moment, determine the moment that would be after a gigasecond +has passed. + +A gigasecond is 10^9 (1,000,000,000) seconds. diff --git a/exercises/practice/gigasecond/.meta/config.json b/exercises/practice/gigasecond/.meta/config.json new file mode 100644 index 000000000..8ceec193e --- /dev/null +++ b/exercises/practice/gigasecond/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Chapter 9 in Chris Pine's online Learn to Program tutorial.", + "source_url": "http://pine.fm/LearnToProgram/?Chapter=09" +} diff --git a/exercises/practice/gigasecond/README.md b/exercises/practice/gigasecond/README.md deleted file mode 100644 index 84843d527..000000000 --- a/exercises/practice/gigasecond/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# Gigasecond - -Given a moment, determine the moment that would be after a gigasecond -has passed. - -A gigasecond is 10^9 (1,000,000,000) seconds. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Chapter 9 in Chris Pine's online Learn to Program tutorial. [http://pine.fm/LearnToProgram/?Chapter=09](http://pine.fm/LearnToProgram/?Chapter=09) - diff --git a/exercises/practice/go-counting/README.md b/exercises/practice/go-counting/.docs/instructions.md similarity index 66% rename from exercises/practice/go-counting/README.md rename to exercises/practice/go-counting/.docs/instructions.md index 00dd41f24..858b95f7d 100644 --- a/exercises/practice/go-counting/README.md +++ b/exercises/practice/go-counting/.docs/instructions.md @@ -1,4 +1,4 @@ -# Go Counting +# Instructions Count the scored points on a Go board. @@ -34,19 +34,3 @@ intersections that are part of that player's territory. For more information see [wikipedia](https://en.wikipedia.org/wiki/Go_%28game%29) or [Sensei's Library](http://senseis.xmp.net/). - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/go-counting/.meta/config.json b/exercises/practice/go-counting/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/go-counting/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/grade-school/.meta/hints.md b/exercises/practice/grade-school/.docs/instructions.append.md similarity index 95% rename from exercises/practice/grade-school/.meta/hints.md rename to exercises/practice/grade-school/.docs/instructions.append.md index 7cdf1923f..1f8454b11 100644 --- a/exercises/practice/grade-school/.meta/hints.md +++ b/exercises/practice/grade-school/.docs/instructions.append.md @@ -1,4 +1,4 @@ -## Hints +# Instructions append For this exercise the following F# feature comes in handy: - The [Map](https://en.wikibooks.org/wiki/F_Sharp_Programming/Sets_and_Maps#Maps) type associates keys with values. It is very similar to .NET's `Dictionary` type, but with one major difference: `Map` is [immutable](https://fsharpforfunandprofit.com/posts/correctness-immutability/). - A [type abbreviation](https://fsharpforfunandprofit.com/posts/type-abbreviations/) is used to create a descriptive alias for a more complex type. diff --git a/exercises/practice/grade-school/README.md b/exercises/practice/grade-school/.docs/instructions.md similarity index 52% rename from exercises/practice/grade-school/README.md rename to exercises/practice/grade-school/.docs/instructions.md index 56d83271f..8bbbf6446 100644 --- a/exercises/practice/grade-school/README.md +++ b/exercises/practice/grade-school/.docs/instructions.md @@ -1,4 +1,4 @@ -# Grade School +# Instructions Given students' names along with the grade that they are in, create a roster for the school. @@ -36,29 +36,3 @@ are some additional things you could try: 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? - -## Hints -For this exercise the following F# feature comes in handy: -- The [Map](https://en.wikibooks.org/wiki/F_Sharp_Programming/Sets_and_Maps#Maps) type associates keys with values. It is very similar to .NET's `Dictionary` type, but with one major difference: `Map` is [immutable](https://fsharpforfunandprofit.com/posts/correctness-immutability/). -- A [type abbreviation](https://fsharpforfunandprofit.com/posts/type-abbreviations/) is used to create a descriptive alias for a more complex type. - - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -A pairing session with Phil Battos at gSchool [http://gschool.it](http://gschool.it) - diff --git a/exercises/practice/grade-school/.meta/config.json b/exercises/practice/grade-school/.meta/config.json new file mode 100644 index 000000000..1010ef168 --- /dev/null +++ b/exercises/practice/grade-school/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "A pairing session with Phil Battos at gSchool", + "source_url": "http://gschool.it" +} diff --git a/exercises/practice/grains/.meta/hints.md b/exercises/practice/grains/.docs/instructions.append.md similarity index 94% rename from exercises/practice/grains/.meta/hints.md rename to exercises/practice/grains/.docs/instructions.append.md index 44e60b63c..4b3aaad52 100644 --- a/exercises/practice/grains/.meta/hints.md +++ b/exercises/practice/grains/.docs/instructions.append.md @@ -1,4 +1,4 @@ -## Hints +# Instructions append For this exercise the following F# features come in handy: - [BigInt](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/numerics.biginteger-structure-%5Bfsharp%5D) - [Seq.sumBy](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/seq.sumby%5B't,%5Eu%5D-function-%5Bfsharp%5D) is a condensed format to apply a function to a sequence and then sum the results \ No newline at end of file diff --git a/exercises/practice/grains/.docs/instructions.md b/exercises/practice/grains/.docs/instructions.md new file mode 100644 index 000000000..05ee99760 --- /dev/null +++ b/exercises/practice/grains/.docs/instructions.md @@ -0,0 +1,27 @@ +# Instructions + +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, with the number +of grains doubling on each successive square. + +There are 64 squares on a chessboard (where square 1 has one grain, square 2 has two grains, and so on). + +Write code that shows: +- how many grains were on a given square, and +- the total number of grains on the chessboard + +## 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? diff --git a/exercises/practice/grains/.meta/config.json b/exercises/practice/grains/.meta/config.json new file mode 100644 index 000000000..1feda3df2 --- /dev/null +++ b/exercises/practice/grains/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "JavaRanch Cattle Drive, exercise 6", + "source_url": "http://www.javaranch.com/grains.jsp" +} diff --git a/exercises/practice/grains/README.md b/exercises/practice/grains/README.md deleted file mode 100644 index 8a7e1e3a7..000000000 --- a/exercises/practice/grains/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# 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, with the number -of grains doubling on each successive square. - -There are 64 squares on a chessboard (where square 1 has one grain, square 2 has two grains, and so on). - -Write code that shows: -- how many grains were on a given square, and -- the total number of grains on the chessboard - -## 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? - -## Hints -For this exercise the following F# features come in handy: -- [BigInt](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/numerics.biginteger-structure-%5Bfsharp%5D) -- [Seq.sumBy](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/seq.sumby%5B't,%5Eu%5D-function-%5Bfsharp%5D) is a condensed format to apply a function to a sequence and then sum the results - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -JavaRanch Cattle Drive, exercise 6 [http://www.javaranch.com/grains.jsp](http://www.javaranch.com/grains.jsp) - diff --git a/exercises/practice/grep/README.md b/exercises/practice/grep/.docs/instructions.md similarity index 73% rename from exercises/practice/grep/README.md rename to exercises/practice/grep/.docs/instructions.md index ad1de6ff0..1972899b0 100644 --- a/exercises/practice/grep/README.md +++ b/exercises/practice/grep/.docs/instructions.md @@ -1,4 +1,4 @@ -# Grep +# Instructions Search a file for lines matching a regular expression pattern. Return the line number and contents of each matching line. @@ -63,23 +63,3 @@ The `grep` command should support multiple flags at once. For example, running `grep -l -v "hello" file1.txt file2.txt` should print the names of files that do not contain the string "hello". - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Conversation with Nate Foster. [http://www.cs.cornell.edu/Courses/cs3110/2014sp/hw/0/ps0.pdf](http://www.cs.cornell.edu/Courses/cs3110/2014sp/hw/0/ps0.pdf) - diff --git a/exercises/practice/grep/.meta/config.json b/exercises/practice/grep/.meta/config.json new file mode 100644 index 000000000..c88246139 --- /dev/null +++ b/exercises/practice/grep/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Conversation with Nate Foster.", + "source_url": "http://www.cs.cornell.edu/Courses/cs3110/2014sp/hw/0/ps0.pdf" +} diff --git a/exercises/practice/hamming/README.md b/exercises/practice/hamming/.docs/instructions.md similarity index 63% rename from exercises/practice/hamming/README.md rename to exercises/practice/hamming/.docs/instructions.md index f6644205f..56c5696de 100644 --- a/exercises/practice/hamming/README.md +++ b/exercises/practice/hamming/.docs/instructions.md @@ -1,4 +1,4 @@ -# Hamming +# Instructions Calculate the Hamming Distance between two DNA strands. @@ -22,23 +22,3 @@ The Hamming distance is only defined for sequences of equal length, so an attempt to calculate it between sequences of different lengths should not work. The general handling of this situation (e.g., raising an exception vs returning a special value) may differ between languages. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -The Calculating Point Mutations problem at Rosalind [http://rosalind.info/problems/hamm/](http://rosalind.info/problems/hamm/) - diff --git a/exercises/practice/hamming/.meta/config.json b/exercises/practice/hamming/.meta/config.json new file mode 100644 index 000000000..77d306c1f --- /dev/null +++ b/exercises/practice/hamming/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "The Calculating Point Mutations problem at Rosalind", + "source_url": "http://rosalind.info/problems/hamm/" +} diff --git a/exercises/practice/hangman/README.md b/exercises/practice/hangman/.docs/instructions.md similarity index 56% rename from exercises/practice/hangman/README.md rename to exercises/practice/hangman/.docs/instructions.md index 57d8d4b14..2b0f33567 100644 --- a/exercises/practice/hangman/README.md +++ b/exercises/practice/hangman/.docs/instructions.md @@ -1,4 +1,4 @@ -# Hangman +# Instructions Implement the logic of the hangman game using functional reactive programming. @@ -16,19 +16,3 @@ be described in the language/track specific files of the exercise. [Hangman]: https://en.wikipedia.org/wiki/Hangman_%28game%29 [frp]: https://en.wikipedia.org/wiki/Functional_reactive_programming - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/hangman/.meta/config.json b/exercises/practice/hangman/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/hangman/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/hello-world/.docs/instructions.md b/exercises/practice/hello-world/.docs/instructions.md new file mode 100644 index 000000000..6e08ebba5 --- /dev/null +++ b/exercises/practice/hello-world/.docs/instructions.md @@ -0,0 +1,15 @@ +# Instructions + +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. diff --git a/exercises/practice/hello-world/.meta/config.json b/exercises/practice/hello-world/.meta/config.json new file mode 100644 index 000000000..22d067207 --- /dev/null +++ b/exercises/practice/hello-world/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "This is an exercise to introduce users to using Exercism", + "source_url": "http://en.wikipedia.org/wiki/%22Hello,_world!%22_program" +} diff --git a/exercises/practice/hello-world/README.md b/exercises/practice/hello-world/README.md deleted file mode 100644 index 187b03690..000000000 --- a/exercises/practice/hello-world/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# 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. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## 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) - diff --git a/exercises/practice/hexadecimal/.docs/instructions.md b/exercises/practice/hexadecimal/.docs/instructions.md new file mode 100644 index 000000000..3e5afa77c --- /dev/null +++ b/exercises/practice/hexadecimal/.docs/instructions.md @@ -0,0 +1,8 @@ +# Instructions + +Convert a hexadecimal number, represented as a string (e.g. "10af8c"), to its decimal equivalent using first principles (i.e. no, you may not use built-in or external libraries to accomplish the conversion). + +On the web we use hexadecimal to represent colors, e.g. green: 008000, +teal: 008080, navy: 000080). + +The program should handle invalid hexadecimal strings. diff --git a/exercises/practice/hexadecimal/.meta/config.json b/exercises/practice/hexadecimal/.meta/config.json new file mode 100644 index 000000000..7563cd4e8 --- /dev/null +++ b/exercises/practice/hexadecimal/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "All of Computer Science", + "source_url": "http://www.wolframalpha.com/examples/NumberBases.html" +} diff --git a/exercises/practice/hexadecimal/README.md b/exercises/practice/hexadecimal/README.md deleted file mode 100644 index c33b31793..000000000 --- a/exercises/practice/hexadecimal/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Hexadecimal - -Convert a hexadecimal number, represented as a string (e.g. "10af8c"), to its decimal equivalent using first principles (i.e. no, you may not use built-in or external libraries to accomplish the conversion). - -On the web we use hexadecimal to represent colors, e.g. green: 008000, -teal: 008080, navy: 000080). - -The program should handle invalid hexadecimal strings. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -All of Computer Science [http://www.wolframalpha.com/examples/NumberBases.html](http://www.wolframalpha.com/examples/NumberBases.html) - diff --git a/exercises/practice/high-scores/.docs/instructions.md b/exercises/practice/high-scores/.docs/instructions.md new file mode 100644 index 000000000..1f8154d5f --- /dev/null +++ b/exercises/practice/high-scores/.docs/instructions.md @@ -0,0 +1,5 @@ +# Instructions + +Manage a game player's High Score list. + +Your task is to build a high-score component of the classic Frogger game, one of the highest selling and addictive games of all time, and a classic of the arcade era. Your task is to write methods that return the highest score from the list, the last added score and the three highest scores. diff --git a/exercises/practice/high-scores/.meta/config.json b/exercises/practice/high-scores/.meta/config.json new file mode 100644 index 000000000..a1bfd2b68 --- /dev/null +++ b/exercises/practice/high-scores/.meta/config.json @@ -0,0 +1,9 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Tribute to the eighties' arcade game Frogger" +} diff --git a/exercises/practice/high-scores/README.md b/exercises/practice/high-scores/README.md deleted file mode 100644 index 1d363885c..000000000 --- a/exercises/practice/high-scores/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# High Scores - -Manage a game player's High Score list. - -Your task is to build a high-score component of the classic Frogger game, one of the highest selling and addictive games of all time, and a classic of the arcade era. Your task is to write methods that return the highest score from the list, the last added score and the three highest scores. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Tribute to the eighties' arcade game Frogger - diff --git a/exercises/practice/house/.meta/hints.md b/exercises/practice/house/.docs/instructions.append.md similarity index 83% rename from exercises/practice/house/.meta/hints.md rename to exercises/practice/house/.docs/instructions.append.md index 5911e1b55..c1aef0ee5 100644 --- a/exercises/practice/house/.meta/hints.md +++ b/exercises/practice/house/.docs/instructions.append.md @@ -1,2 +1,2 @@ -## Hints +# Instructions append - Try to capture the structure of the song in your code, where you build up the song by composing its parts. diff --git a/exercises/practice/house/README.md b/exercises/practice/house/.docs/instructions.md similarity index 77% rename from exercises/practice/house/README.md rename to exercises/practice/house/.docs/instructions.md index 3b32ec16c..92174617f 100644 --- a/exercises/practice/house/README.md +++ b/exercises/practice/house/.docs/instructions.md @@ -1,4 +1,4 @@ -# House +# Instructions Recite the nursery rhyme 'This is the House that Jack Built'. @@ -104,27 +104,3 @@ that killed the rat that ate the malt that lay in the house that Jack built. ``` - -## Hints -- Try to capture the structure of the song in your code, where you build up the song by composing its parts. - - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -British nursery rhyme [http://en.wikipedia.org/wiki/This_Is_The_House_That_Jack_Built](http://en.wikipedia.org/wiki/This_Is_The_House_That_Jack_Built) - diff --git a/exercises/practice/house/.meta/config.json b/exercises/practice/house/.meta/config.json new file mode 100644 index 000000000..dae0ce62c --- /dev/null +++ b/exercises/practice/house/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "British nursery rhyme", + "source_url": "http://en.wikipedia.org/wiki/This_Is_The_House_That_Jack_Built" +} diff --git a/exercises/practice/isbn-verifier/README.md b/exercises/practice/isbn-verifier/.docs/instructions.md similarity index 64% rename from exercises/practice/isbn-verifier/README.md rename to exercises/practice/isbn-verifier/.docs/instructions.md index cdfbf5c14..7d6635edc 100644 --- a/exercises/practice/isbn-verifier/README.md +++ b/exercises/practice/isbn-verifier/.docs/instructions.md @@ -1,4 +1,4 @@ -# ISBN Verifier +# Instructions The [ISBN-10 verification process](https://en.wikipedia.org/wiki/International_Standard_Book_Number) is used to validate book identification numbers. These normally contain dashes and look like: `3-598-21508-8` @@ -40,23 +40,3 @@ Now, it's even trickier since the check digit of an ISBN-10 may be 'X' (represen * Generate a valid ISBN-13 from the input ISBN-10 (and maybe verify it again with a derived verifier). * Generate valid ISBN, maybe even from a given starting ISBN. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Converting a string into a number and some basic processing utilizing a relatable real world example. [https://en.wikipedia.org/wiki/International_Standard_Book_Number#ISBN-10_check_digit_calculation](https://en.wikipedia.org/wiki/International_Standard_Book_Number#ISBN-10_check_digit_calculation) - diff --git a/exercises/practice/isbn-verifier/.meta/config.json b/exercises/practice/isbn-verifier/.meta/config.json new file mode 100644 index 000000000..acb2f7436 --- /dev/null +++ b/exercises/practice/isbn-verifier/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Converting a string into a number and some basic processing utilizing a relatable real world example.", + "source_url": "https://en.wikipedia.org/wiki/International_Standard_Book_Number#ISBN-10_check_digit_calculation" +} diff --git a/exercises/practice/isogram/.docs/instructions.md b/exercises/practice/isogram/.docs/instructions.md new file mode 100644 index 000000000..9cc5350b6 --- /dev/null +++ b/exercises/practice/isogram/.docs/instructions.md @@ -0,0 +1,14 @@ +# Instructions + +Determine if a word or phrase is an isogram. + +An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter, however spaces and hyphens are allowed to appear multiple times. + +Examples of isograms: + +- lumberjacks +- background +- downstream +- six-year-old + +The word *isograms*, however, is not an isogram, because the s repeats. diff --git a/exercises/practice/isogram/.meta/config.json b/exercises/practice/isogram/.meta/config.json new file mode 100644 index 000000000..294266730 --- /dev/null +++ b/exercises/practice/isogram/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Wikipedia", + "source_url": "https://en.wikipedia.org/wiki/Isogram" +} diff --git a/exercises/practice/isogram/README.md b/exercises/practice/isogram/README.md deleted file mode 100644 index b2592627b..000000000 --- a/exercises/practice/isogram/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# Isogram - -Determine if a word or phrase is an isogram. - -An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter, however spaces and hyphens are allowed to appear multiple times. - -Examples of isograms: - -- lumberjacks -- background -- downstream -- six-year-old - -The word *isograms*, however, is not an isogram, because the s repeats. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Wikipedia [https://en.wikipedia.org/wiki/Isogram](https://en.wikipedia.org/wiki/Isogram) - diff --git a/exercises/practice/kindergarten-garden/README.md b/exercises/practice/kindergarten-garden/.docs/instructions.md similarity index 70% rename from exercises/practice/kindergarten-garden/README.md rename to exercises/practice/kindergarten-garden/.docs/instructions.md index deb49c912..ba89ff9b0 100644 --- a/exercises/practice/kindergarten-garden/README.md +++ b/exercises/practice/kindergarten-garden/.docs/instructions.md @@ -1,4 +1,4 @@ -# Kindergarten Garden +# Instructions Given a diagram, determine which plants each child in the kindergarten class is responsible for. @@ -58,23 +58,3 @@ Then if asked for Alice's plants, it should provide: While asking for Bob's plants would yield: - Clover, grass, clover, clover - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Random musings during airplane trip. [http://jumpstartlab.com](http://jumpstartlab.com) - diff --git a/exercises/practice/kindergarten-garden/.meta/config.json b/exercises/practice/kindergarten-garden/.meta/config.json new file mode 100644 index 000000000..27fbd2866 --- /dev/null +++ b/exercises/practice/kindergarten-garden/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Random musings during airplane trip.", + "source_url": "http://jumpstartlab.com" +} diff --git a/exercises/practice/largest-series-product/.docs/instructions.md b/exercises/practice/largest-series-product/.docs/instructions.md new file mode 100644 index 000000000..8ddbc6024 --- /dev/null +++ b/exercises/practice/largest-series-product/.docs/instructions.md @@ -0,0 +1,14 @@ +# Instructions + +Given a string of digits, calculate the largest product for a contiguous +substring of digits of length n. + +For example, for the input `'1027839564'`, the largest product for a +series of 3 digits is 270 (9 * 5 * 6), and the largest product for a +series of 5 digits is 7560 (7 * 8 * 3 * 9 * 5). + +Note that these series are only required to occupy *adjacent positions* +in the input; the digits need not be *numerically consecutive*. + +For the input `'73167176531330624919225119674426574742355349194934'`, +the largest product for a series of 6 digits is 23520. diff --git a/exercises/practice/largest-series-product/.meta/config.json b/exercises/practice/largest-series-product/.meta/config.json new file mode 100644 index 000000000..688875be6 --- /dev/null +++ b/exercises/practice/largest-series-product/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "A variation on Problem 8 at Project Euler", + "source_url": "http://projecteuler.net/problem=8" +} diff --git a/exercises/practice/largest-series-product/README.md b/exercises/practice/largest-series-product/README.md deleted file mode 100644 index fa78839fb..000000000 --- a/exercises/practice/largest-series-product/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# Largest Series Product - -Given a string of digits, calculate the largest product for a contiguous -substring of digits of length n. - -For example, for the input `'1027839564'`, the largest product for a -series of 3 digits is 270 (9 * 5 * 6), and the largest product for a -series of 5 digits is 7560 (7 * 8 * 3 * 9 * 5). - -Note that these series are only required to occupy *adjacent positions* -in the input; the digits need not be *numerically consecutive*. - -For the input `'73167176531330624919225119674426574742355349194934'`, -the largest product for a series of 6 digits is 23520. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -A variation on Problem 8 at Project Euler [http://projecteuler.net/problem=8](http://projecteuler.net/problem=8) - diff --git a/exercises/practice/leap/.meta/hints.md b/exercises/practice/leap/.docs/instructions.append.md similarity index 92% rename from exercises/practice/leap/.meta/hints.md rename to exercises/practice/leap/.docs/instructions.append.md index ebee67e34..03e408f9c 100644 --- a/exercises/practice/leap/.meta/hints.md +++ b/exercises/practice/leap/.docs/instructions.append.md @@ -1,4 +1,4 @@ -## Notes +# Instructions append The DateTime class in F# provides a built-in [IsLeapYear](https://msdn.microsoft.com/en-us/library/system.datetime.isleapyear(v=vs.110).aspx?cs-save-lang=1&cs-lang=fsharp) method which you should pretend doesn't exist for the purposes of implementing this exercise. \ No newline at end of file diff --git a/exercises/practice/leap/.docs/instructions.md b/exercises/practice/leap/.docs/instructions.md new file mode 100644 index 000000000..dc7b4e816 --- /dev/null +++ b/exercises/practice/leap/.docs/instructions.md @@ -0,0 +1,24 @@ +# Instructions + +Given a year, report if it is a leap year. + +The tricky thing here is that a leap year in the Gregorian calendar occurs: + +```text +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. + +## 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 diff --git a/exercises/practice/leap/.meta/config.json b/exercises/practice/leap/.meta/config.json new file mode 100644 index 000000000..5d1546933 --- /dev/null +++ b/exercises/practice/leap/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "JavaRanch Cattle Drive, exercise 3", + "source_url": "http://www.javaranch.com/leap.jsp" +} diff --git a/exercises/practice/leap/README.md b/exercises/practice/leap/README.md deleted file mode 100644 index 1b72b12f7..000000000 --- a/exercises/practice/leap/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# 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: - -```text -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. - -## 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 - -## Notes - -The DateTime class in F# provides a built-in [IsLeapYear](https://msdn.microsoft.com/en-us/library/system.datetime.isleapyear(v=vs.110).aspx?cs-save-lang=1&cs-lang=fsharp) method -which you should pretend doesn't exist for the purposes of implementing this exercise. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -JavaRanch Cattle Drive, exercise 3 [http://www.javaranch.com/leap.jsp](http://www.javaranch.com/leap.jsp) - diff --git a/exercises/practice/ledger/README.md b/exercises/practice/ledger/.docs/instructions.md similarity index 53% rename from exercises/practice/ledger/README.md rename to exercises/practice/ledger/.docs/instructions.md index d59bd4643..266054c36 100644 --- a/exercises/practice/ledger/README.md +++ b/exercises/practice/ledger/.docs/instructions.md @@ -1,4 +1,4 @@ -# Ledger +# Instructions Refactor a ledger printer. @@ -13,19 +13,3 @@ working version. Version control tools like git can help here as well. Please keep a log of what changes you've made and make a comment on the exercise containing that log, this will help reviewers. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/ledger/.meta/config.json b/exercises/practice/ledger/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/ledger/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/lens-person/.meta/hints.md b/exercises/practice/lens-person/.docs/instructions.append.md similarity index 89% rename from exercises/practice/lens-person/.meta/hints.md rename to exercises/practice/lens-person/.docs/instructions.append.md index 6b31fb166..3765a2b60 100644 --- a/exercises/practice/lens-person/.meta/hints.md +++ b/exercises/practice/lens-person/.docs/instructions.append.md @@ -1,2 +1,2 @@ -## Hints +# Instructions append - This exercise expects you to use the [Aether](https://xyncro.tech/aether/) library, which adds *lenses* functionality to F#. With lenses, you can quite easily read or update nested structures. \ No newline at end of file diff --git a/exercises/practice/lens-person/.docs/instructions.md b/exercises/practice/lens-person/.docs/instructions.md new file mode 100644 index 000000000..2152a069f --- /dev/null +++ b/exercises/practice/lens-person/.docs/instructions.md @@ -0,0 +1,9 @@ +# Instructions + +Use lenses to update nested records (specific to languages with immutable data). + +Updating fields of nested records is kind of annoying in Haskell. One solution +is to use [lenses](https://wiki.haskell.org/Lens). Implement several record +accessing functions using lenses, you may use any library you want. The test +suite also allows you to avoid lenses altogether so you can experiment with +different approaches. diff --git a/exercises/practice/lens-person/.meta/config.json b/exercises/practice/lens-person/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/lens-person/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/lens-person/README.md b/exercises/practice/lens-person/README.md deleted file mode 100644 index 079a1610e..000000000 --- a/exercises/practice/lens-person/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Lens Person - -Use lenses to update nested records (specific to languages with immutable data). - -Updating fields of nested records is kind of annoying in Haskell. One solution -is to use [lenses](https://wiki.haskell.org/Lens). Implement several record -accessing functions using lenses, you may use any library you want. The test -suite also allows you to avoid lenses altogether so you can experiment with -different approaches. - -## Hints -- This exercise expects you to use the [Aether](https://xyncro.tech/aether/) library, which adds *lenses* functionality to F#. With lenses, you can quite easily read or update nested structures. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/linked-list/.meta/hints.md b/exercises/practice/linked-list/.docs/instructions.append.md similarity index 97% rename from exercises/practice/linked-list/.meta/hints.md rename to exercises/practice/linked-list/.docs/instructions.append.md index 318afe718..f9bce1876 100644 --- a/exercises/practice/linked-list/.meta/hints.md +++ b/exercises/practice/linked-list/.docs/instructions.append.md @@ -1,4 +1,4 @@ -## Hints +# Instructions append A [doubly linked list](https://en.wikipedia.org/wiki/Doubly_linked_list) is a mutable data structure. As F# is a functional-first language, immutability is generally preferred, but there are language features that allow the use of mutation where it is required. diff --git a/exercises/practice/linked-list/.docs/instructions.md b/exercises/practice/linked-list/.docs/instructions.md new file mode 100644 index 000000000..d1bd87551 --- /dev/null +++ b/exercises/practice/linked-list/.docs/instructions.md @@ -0,0 +1,28 @@ +# Instructions + +Implement a doubly linked list. + +Like an array, a linked list is a simple linear data structure. Several +common data types can be implemented using linked lists, like queues, +stacks, and associative arrays. + +A linked list is a collection of data elements called *nodes*. In a +*singly linked list* each node holds a value and a link to the next node. +In a *doubly linked list* each node also holds a link to the previous +node. + +You will write an implementation of a doubly linked list. Implement a +Node to hold a value and pointers to the next and previous nodes. Then +implement a List which holds references to the first and last node and +offers an array-like interface for adding and removing items: + +* `push` (*insert value at back*); +* `pop` (*remove value at back*); +* `shift` (*remove value at front*). +* `unshift` (*insert value at front*); + +To keep your implementation simple, the tests will not cover error +conditions. Specifically: `pop` or `shift` will never be called on an +empty list. + +If you want to know more about linked lists, check [Wikipedia](https://en.wikipedia.org/wiki/Linked_list). diff --git a/exercises/practice/linked-list/.meta/config.json b/exercises/practice/linked-list/.meta/config.json new file mode 100644 index 000000000..496c8b708 --- /dev/null +++ b/exercises/practice/linked-list/.meta/config.json @@ -0,0 +1,9 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Classic computer science topic" +} diff --git a/exercises/practice/linked-list/README.md b/exercises/practice/linked-list/README.md deleted file mode 100644 index 6bcff4a6c..000000000 --- a/exercises/practice/linked-list/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# Linked List - -Implement a doubly linked list. - -Like an array, a linked list is a simple linear data structure. Several -common data types can be implemented using linked lists, like queues, -stacks, and associative arrays. - -A linked list is a collection of data elements called *nodes*. In a -*singly linked list* each node holds a value and a link to the next node. -In a *doubly linked list* each node also holds a link to the previous -node. - -You will write an implementation of a doubly linked list. Implement a -Node to hold a value and pointers to the next and previous nodes. Then -implement a List which holds references to the first and last node and -offers an array-like interface for adding and removing items: - -* `push` (*insert value at back*); -* `pop` (*remove value at back*); -* `shift` (*remove value at front*). -* `unshift` (*insert value at front*); - -To keep your implementation simple, the tests will not cover error -conditions. Specifically: `pop` or `shift` will never be called on an -empty list. - -If you want to know more about linked lists, check [Wikipedia](https://en.wikipedia.org/wiki/Linked_list). - -## Hints - -A [doubly linked list](https://en.wikipedia.org/wiki/Doubly_linked_list) is a mutable data structure. As F# is a functional-first language, immutability is generally preferred, but there are language features that allow the use of mutation where it is required. - -* The `mutable` keyword can be placed before `let` bindings and [record](https://docs.microsoft.com/en-us/dotnet/articles/fsharp/language-reference/records) fields, allowing you to assign new values to them. - -* [Class](https://fsharpforfunandprofit.com/posts/classes) properties can be made mutable by specifying a property setter with the `set` keyword. - -Mutable bindings must be re-assigned with `<-` - -```fsharp -let mutable x = "initial value" -x <- "new value" -``` - - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Classic computer science topic - diff --git a/exercises/practice/list-ops/README.md b/exercises/practice/list-ops/.docs/instructions.md similarity index 69% rename from exercises/practice/list-ops/README.md rename to exercises/practice/list-ops/.docs/instructions.md index 8610e4a2a..b5b20ff20 100644 --- a/exercises/practice/list-ops/README.md +++ b/exercises/practice/list-ops/.docs/instructions.md @@ -1,4 +1,4 @@ -# List Ops +# Instructions Implement basic list operations. @@ -18,19 +18,3 @@ operations you will implement include: * `foldl` (*given a function, a list, and initial accumulator, fold (reduce) each item into the accumulator from the left using `function(accumulator, item)`*); * `foldr` (*given a function, a list, and an initial accumulator, fold (reduce) each item into the accumulator from the right using `function(item, accumulator)`*); * `reverse` (*given a list, return a list with all the original items, but in reversed order*); - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/list-ops/.meta/config.json b/exercises/practice/list-ops/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/list-ops/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/luhn/README.md b/exercises/practice/luhn/.docs/instructions.md similarity index 61% rename from exercises/practice/luhn/README.md rename to exercises/practice/luhn/.docs/instructions.md index ce01d2509..c7c7d3e0f 100644 --- a/exercises/practice/luhn/README.md +++ b/exercises/practice/luhn/.docs/instructions.md @@ -1,4 +1,4 @@ -# Luhn +# Instructions Given a number determine whether or not it is valid per the Luhn formula. @@ -19,27 +19,27 @@ are disallowed. ## Example 1: valid credit card number ```text -4539 1488 0343 6467 +4539 3195 0343 6467 ``` The first step of the Luhn algorithm is to double every second digit, starting from the right. We will be doubling ```text -4_3_ 1_8_ 0_4_ 6_6_ +4_3_ 3_9_ 0_4_ 6_6_ ``` If doubling the number results in a number greater than 9 then subtract 9 from the product. The results of our doubling: ```text -8569 2478 0383 3437 +8569 6195 0383 3437 ``` Then sum all of the digits: ```text -8+5+6+9+2+4+7+8+0+3+8+3+3+4+3+7 = 80 +8+5+6+9+6+1+9+5+0+3+8+3+3+4+3+7 = 80 ``` If the sum is evenly divisible by 10, then the number is valid. This number is valid! @@ -63,23 +63,3 @@ Sum the digits ``` 57 is not evenly divisible by 10, so this number is not valid. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -The Luhn Algorithm on Wikipedia [http://en.wikipedia.org/wiki/Luhn_algorithm](http://en.wikipedia.org/wiki/Luhn_algorithm) - diff --git a/exercises/practice/luhn/.meta/config.json b/exercises/practice/luhn/.meta/config.json new file mode 100644 index 000000000..a030ef485 --- /dev/null +++ b/exercises/practice/luhn/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "The Luhn Algorithm on Wikipedia", + "source_url": "http://en.wikipedia.org/wiki/Luhn_algorithm" +} diff --git a/exercises/practice/markdown/README.md b/exercises/practice/markdown/.docs/instructions.md similarity index 54% rename from exercises/practice/markdown/README.md rename to exercises/practice/markdown/.docs/instructions.md index b76afdd49..4819b6c2f 100644 --- a/exercises/practice/markdown/README.md +++ b/exercises/practice/markdown/.docs/instructions.md @@ -1,4 +1,4 @@ -# Markdown +# Instructions Refactor a Markdown parser. @@ -13,19 +13,3 @@ while still making sure that all the tests keep passing. It would be helpful if you made notes of what you did in your refactoring in comments so reviewers can see that, but it isn't strictly necessary. The most important thing is to make the code better! - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/markdown/.meta/config.json b/exercises/practice/markdown/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/markdown/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/matching-brackets/.docs/instructions.md b/exercises/practice/matching-brackets/.docs/instructions.md new file mode 100644 index 000000000..364ecad21 --- /dev/null +++ b/exercises/practice/matching-brackets/.docs/instructions.md @@ -0,0 +1,5 @@ +# Instructions + +Given a string containing brackets `[]`, braces `{}`, parentheses `()`, +or any combination thereof, verify that any and all pairs are matched +and nested correctly. diff --git a/exercises/practice/matching-brackets/.meta/config.json b/exercises/practice/matching-brackets/.meta/config.json new file mode 100644 index 000000000..5a14b47b6 --- /dev/null +++ b/exercises/practice/matching-brackets/.meta/config.json @@ -0,0 +1,9 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Ginna Baker" +} diff --git a/exercises/practice/matching-brackets/README.md b/exercises/practice/matching-brackets/README.md deleted file mode 100644 index af7ed70f6..000000000 --- a/exercises/practice/matching-brackets/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# Matching Brackets - -Given a string containing brackets `[]`, braces `{}`, parentheses `()`, -or any combination thereof, verify that any and all pairs are matched -and nested correctly. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Ginna Baker - diff --git a/exercises/practice/matrix/.docs/instructions.md b/exercises/practice/matrix/.docs/instructions.md new file mode 100644 index 000000000..1b2d0f84b --- /dev/null +++ b/exercises/practice/matrix/.docs/instructions.md @@ -0,0 +1,41 @@ +# Instructions + +Given a string representing a matrix of numbers, return the rows and columns of +that matrix. + +So given a string with embedded newlines like: + +```text +9 8 7 +5 3 2 +6 6 7 +``` + +representing this matrix: + +```text + 1 2 3 + |--------- +1 | 9 8 7 +2 | 5 3 2 +3 | 6 6 7 +``` + +your code should be able to spit out: + +- A list of the rows, reading each row left-to-right while moving + top-to-bottom across the rows, +- A list of the columns, reading each column top-to-bottom while moving + from left-to-right. + +The rows for our example matrix: + +- 9, 8, 7 +- 5, 3, 2 +- 6, 6, 7 + +And its columns: + +- 9, 5, 6 +- 8, 3, 6 +- 7, 2, 7 diff --git a/exercises/practice/matrix/.meta/config.json b/exercises/practice/matrix/.meta/config.json new file mode 100644 index 000000000..e0903570f --- /dev/null +++ b/exercises/practice/matrix/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Warmup to the `saddle-points` warmup.", + "source_url": "http://jumpstartlab.com" +} diff --git a/exercises/practice/matrix/README.md b/exercises/practice/matrix/README.md deleted file mode 100644 index 1182f9379..000000000 --- a/exercises/practice/matrix/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# Matrix - -Given a string representing a matrix of numbers, return the rows and columns of -that matrix. - -So given a string with embedded newlines like: - -```text -9 8 7 -5 3 2 -6 6 7 -``` - -representing this matrix: - -```text - 1 2 3 - |--------- -1 | 9 8 7 -2 | 5 3 2 -3 | 6 6 7 -``` - -your code should be able to spit out: - -- A list of the rows, reading each row left-to-right while moving - top-to-bottom across the rows, -- A list of the columns, reading each column top-to-bottom while moving - from left-to-right. - -The rows for our example matrix: - -- 9, 8, 7 -- 5, 3, 2 -- 6, 6, 7 - -And its columns: - -- 9, 5, 6 -- 8, 3, 6 -- 7, 2, 7 - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Warmup to the `saddle-points` warmup. [http://jumpstartlab.com](http://jumpstartlab.com) - diff --git a/exercises/practice/meetup/README.md b/exercises/practice/meetup/.docs/instructions.md similarity index 58% rename from exercises/practice/meetup/README.md rename to exercises/practice/meetup/.docs/instructions.md index 4b7a35938..fe1a9c2a6 100644 --- a/exercises/practice/meetup/README.md +++ b/exercises/practice/meetup/.docs/instructions.md @@ -1,4 +1,4 @@ -# Meetup +# Instructions Calculate the date of meetups. @@ -25,23 +25,3 @@ in every month. Given examples of a meetup dates, each containing a month, day, year, and descriptor calculate the date of the actual meetup. For example, if given "The first Monday of January 2017", the correct meetup date is 2017/1/2. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Jeremy Hinegardner mentioned a Boulder meetup that happens on the Wednesteenth of every month [https://twitter.com/copiousfreetime](https://twitter.com/copiousfreetime) - diff --git a/exercises/practice/meetup/.meta/config.json b/exercises/practice/meetup/.meta/config.json new file mode 100644 index 000000000..e768d0d53 --- /dev/null +++ b/exercises/practice/meetup/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Jeremy Hinegardner mentioned a Boulder meetup that happens on the Wednesteenth of every month", + "source_url": "https://twitter.com/copiousfreetime" +} diff --git a/exercises/practice/minesweeper/README.md b/exercises/practice/minesweeper/.docs/instructions.md similarity index 59% rename from exercises/practice/minesweeper/README.md rename to exercises/practice/minesweeper/.docs/instructions.md index e5404cde2..1114cc95d 100644 --- a/exercises/practice/minesweeper/README.md +++ b/exercises/practice/minesweeper/.docs/instructions.md @@ -1,4 +1,4 @@ -# Minesweeper +# Instructions Add the mine counts to a completed Minesweeper board. @@ -35,19 +35,3 @@ And your code will transform it into this: ·2*2· ·111· ``` - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/minesweeper/.meta/config.json b/exercises/practice/minesweeper/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/minesweeper/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/nth-prime/.meta/hints.md b/exercises/practice/nth-prime/.docs/instructions.append.md similarity index 95% rename from exercises/practice/nth-prime/.meta/hints.md rename to exercises/practice/nth-prime/.docs/instructions.append.md index 3f21152ee..671b17260 100644 --- a/exercises/practice/nth-prime/.meta/hints.md +++ b/exercises/practice/nth-prime/.docs/instructions.append.md @@ -1,4 +1,4 @@ -## Hints +# Instructions append For this exercise the following F# feature comes in handy: - [Sequences](https://docs.microsoft.com/en-us/dotnet/articles/fsharp/language-reference/sequences) are evaluated lazily. They allows you to work with an infinite sequence of values. diff --git a/exercises/practice/nth-prime/.docs/instructions.md b/exercises/practice/nth-prime/.docs/instructions.md new file mode 100644 index 000000000..30a75216f --- /dev/null +++ b/exercises/practice/nth-prime/.docs/instructions.md @@ -0,0 +1,9 @@ +# Instructions + +Given a number n, determine what the nth prime is. + +By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that +the 6th prime is 13. + +If your language provides methods in the standard library to deal with prime +numbers, pretend they don't exist and implement them yourself. diff --git a/exercises/practice/nth-prime/.meta/config.json b/exercises/practice/nth-prime/.meta/config.json new file mode 100644 index 000000000..3be0dc8a3 --- /dev/null +++ b/exercises/practice/nth-prime/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "A variation on Problem 7 at Project Euler", + "source_url": "http://projecteuler.net/problem=7" +} diff --git a/exercises/practice/nth-prime/README.md b/exercises/practice/nth-prime/README.md deleted file mode 100644 index 3937ef356..000000000 --- a/exercises/practice/nth-prime/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# Nth Prime - -Given a number n, determine what the nth prime is. - -By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that -the 6th prime is 13. - -If your language provides methods in the standard library to deal with prime -numbers, pretend they don't exist and implement them yourself. - -## Hints -For this exercise the following F# feature comes in handy: -- [Sequences](https://docs.microsoft.com/en-us/dotnet/articles/fsharp/language-reference/sequences) are evaluated lazily. They allows you to work with an infinite sequence of values. - -Note: to help speedup calculation, you should not check numbers which you know beforehand will never be prime. For more information, see the [Sieve of Eratosthenes](https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes). - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -A variation on Problem 7 at Project Euler [http://projecteuler.net/problem=7](http://projecteuler.net/problem=7) - diff --git a/exercises/practice/nucleotide-count/.docs/instructions.md b/exercises/practice/nucleotide-count/.docs/instructions.md new file mode 100644 index 000000000..cd0875894 --- /dev/null +++ b/exercises/practice/nucleotide-count/.docs/instructions.md @@ -0,0 +1,21 @@ +# Instructions + +Each of us inherits from our biological parents a set of chemical instructions known as DNA that influence how our bodies are constructed. All known life depends on DNA! + +> Note: You do not need to understand anything about nucleotides or DNA to complete this exercise. + +DNA is a long chain of other chemicals and the most important are the four nucleotides, adenine, cytosine, guanine and thymine. A single DNA chain can contain billions of these four nucleotides and the order in which they occur is important! +We call the order of these nucleotides in a bit of DNA a "DNA sequence". + +We represent a DNA sequence as an ordered collection of these four nucleotides and a common way to do that is with a string of characters such as "ATTACG" for a DNA sequence of 6 nucleotides. +'A' for adenine, 'C' for cytosine, 'G' for guanine, and 'T' for thymine. + +Given a string representing a DNA sequence, count how many of each nucleotide is present. +If the string contains characters that aren't A, C, G, or T then it is invalid and you should signal an error. + +For example: + +``` +"GATTACA" -> 'A': 3, 'C': 1, 'G': 1, 'T': 2 +"INVALID" -> error +``` diff --git a/exercises/practice/nucleotide-count/.meta/config.json b/exercises/practice/nucleotide-count/.meta/config.json new file mode 100644 index 000000000..c8d98cbd9 --- /dev/null +++ b/exercises/practice/nucleotide-count/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "The Calculating DNA Nucleotides_problem at Rosalind", + "source_url": "http://rosalind.info/problems/dna/" +} diff --git a/exercises/practice/nucleotide-count/README.md b/exercises/practice/nucleotide-count/README.md deleted file mode 100644 index 0ad3d37be..000000000 --- a/exercises/practice/nucleotide-count/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Nucleotide Count - -Given a single stranded DNA string, compute how many times each nucleotide occurs in the string. - -The genetic language of every living thing on the planet is DNA. -DNA is a large molecule that is built from an extremely long sequence of individual elements called nucleotides. -4 types exist in DNA and these differ only slightly and can be represented as the following symbols: 'A' for adenine, 'C' for cytosine, 'G' for guanine, and 'T' thymine. - -Here is an analogy: -- twigs are to birds nests as -- nucleotides are to DNA as -- legos are to lego houses as -- words are to sentences as... - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -The Calculating DNA Nucleotides_problem at Rosalind [http://rosalind.info/problems/dna/](http://rosalind.info/problems/dna/) - diff --git a/exercises/practice/ocr-numbers/README.md b/exercises/practice/ocr-numbers/.docs/instructions.md similarity index 66% rename from exercises/practice/ocr-numbers/README.md rename to exercises/practice/ocr-numbers/.docs/instructions.md index 9dbb1913f..4086329bd 100644 --- a/exercises/practice/ocr-numbers/README.md +++ b/exercises/practice/ocr-numbers/.docs/instructions.md @@ -1,4 +1,4 @@ -# OCR Numbers +# Instructions Given a 3 x 4 grid of pipes, underscores, and spaces, determine which number is represented, or whether it is garbled. @@ -77,23 +77,3 @@ Update your program to handle multiple numbers, one per line. When converting se ``` Is converted to "123,456,789" - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Inspired by the Bank OCR kata [http://codingdojo.org/cgi-bin/wiki.pl?KataBankOCR](http://codingdojo.org/cgi-bin/wiki.pl?KataBankOCR) - diff --git a/exercises/practice/ocr-numbers/.meta/config.json b/exercises/practice/ocr-numbers/.meta/config.json new file mode 100644 index 000000000..39fe16f2a --- /dev/null +++ b/exercises/practice/ocr-numbers/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Inspired by the Bank OCR kata", + "source_url": "http://codingdojo.org/cgi-bin/wiki.pl?KataBankOCR" +} diff --git a/exercises/practice/octal/README.md b/exercises/practice/octal/.docs/instructions.md similarity index 59% rename from exercises/practice/octal/README.md rename to exercises/practice/octal/.docs/instructions.md index b95908fc1..81f108384 100644 --- a/exercises/practice/octal/README.md +++ b/exercises/practice/octal/.docs/instructions.md @@ -1,4 +1,4 @@ -# Octal +# Instructions Convert an octal number, represented as a string (e.g. '1735263'), to its decimal equivalent using first principles (i.e. no, you may not use built-in or @@ -45,23 +45,3 @@ So: = 128 + 24 + 3 = 155 ``` - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -All of Computer Science [http://www.wolframalpha.com/input/?i=base+8](http://www.wolframalpha.com/input/?i=base+8) - diff --git a/exercises/practice/octal/.meta/config.json b/exercises/practice/octal/.meta/config.json new file mode 100644 index 000000000..154636352 --- /dev/null +++ b/exercises/practice/octal/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "All of Computer Science", + "source_url": "http://www.wolframalpha.com/input/?i=base+8" +} diff --git a/exercises/practice/palindrome-products/.meta/hints.md b/exercises/practice/palindrome-products/.docs/instructions.append.md similarity index 88% rename from exercises/practice/palindrome-products/.meta/hints.md rename to exercises/practice/palindrome-products/.docs/instructions.append.md index 9a90ef23b..e7db4dce9 100644 --- a/exercises/practice/palindrome-products/.meta/hints.md +++ b/exercises/practice/palindrome-products/.docs/instructions.append.md @@ -1,2 +1,2 @@ -## Hints +# Instructions append - The most simple way to check if a number is a palindrome is quite slow. To speed things up, you could implement a slighly more complex algorithm which uses mutable state. diff --git a/exercises/practice/palindrome-products/README.md b/exercises/practice/palindrome-products/.docs/instructions.md similarity index 56% rename from exercises/practice/palindrome-products/README.md rename to exercises/practice/palindrome-products/.docs/instructions.md index 733f18cb7..fd9a44124 100644 --- a/exercises/practice/palindrome-products/README.md +++ b/exercises/practice/palindrome-products/.docs/instructions.md @@ -1,4 +1,4 @@ -# Palindrome Products +# Instructions Detect palindrome products in a given range. @@ -6,7 +6,7 @@ A palindromic number is a number that remains the same when its digits are reversed. For example, `121` is a palindromic number but `112` is not. Given a range of numbers, find the largest and smallest palindromes which -are products of numbers within that range. +are products of two numbers within that range. Your solution should return the largest and smallest palindromes, along with the factors of each within the range. If the largest or smallest palindrome has more @@ -31,27 +31,3 @@ Given the range `[10, 99]` (both inclusive)... The smallest palindrome product is `121`. Its factors are `(11, 11)`. The largest palindrome product is `9009`. Its factors are `(91, 99)`. - -## Hints -- The most simple way to check if a number is a palindrome is quite slow. To speed things up, you could implement a slighly more complex algorithm which uses mutable state. - - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Problem 4 at Project Euler [http://projecteuler.net/problem=4](http://projecteuler.net/problem=4) - diff --git a/exercises/practice/palindrome-products/.meta/config.json b/exercises/practice/palindrome-products/.meta/config.json new file mode 100644 index 000000000..7ce4a8138 --- /dev/null +++ b/exercises/practice/palindrome-products/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Problem 4 at Project Euler", + "source_url": "http://projecteuler.net/problem=4" +} diff --git a/exercises/practice/pangram/.docs/instructions.md b/exercises/practice/pangram/.docs/instructions.md new file mode 100644 index 000000000..dbba4f647 --- /dev/null +++ b/exercises/practice/pangram/.docs/instructions.md @@ -0,0 +1,9 @@ +# Instructions + +Determine if a sentence is a pangram. A pangram (Greek: παν γράμμα, pan gramma, +"every letter") is a sentence using every letter of the alphabet at least once. +The best known English pangram is: +> The quick brown fox jumps over the lazy dog. + +The alphabet used consists of ASCII letters `a` to `z`, inclusive, and is case +insensitive. Input will not contain non-ASCII symbols. diff --git a/exercises/practice/pangram/.meta/config.json b/exercises/practice/pangram/.meta/config.json new file mode 100644 index 000000000..d402d65df --- /dev/null +++ b/exercises/practice/pangram/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Wikipedia", + "source_url": "https://en.wikipedia.org/wiki/Pangram" +} diff --git a/exercises/practice/pangram/README.md b/exercises/practice/pangram/README.md deleted file mode 100644 index ea290bc2c..000000000 --- a/exercises/practice/pangram/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# Pangram - -Determine if a sentence is a pangram. A pangram (Greek: παν γράμμα, pan gramma, -"every letter") is a sentence using every letter of the alphabet at least once. -The best known English pangram is: -> The quick brown fox jumps over the lazy dog. - -The alphabet used consists of ASCII letters `a` to `z`, inclusive, and is case -insensitive. Input will not contain non-ASCII symbols. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Wikipedia [https://en.wikipedia.org/wiki/Pangram](https://en.wikipedia.org/wiki/Pangram) - diff --git a/exercises/practice/parallel-letter-frequency/.meta/hints.md b/exercises/practice/parallel-letter-frequency/.docs/instructions.append.md similarity index 93% rename from exercises/practice/parallel-letter-frequency/.meta/hints.md rename to exercises/practice/parallel-letter-frequency/.docs/instructions.append.md index bddc7b1bb..92e2bc54a 100644 --- a/exercises/practice/parallel-letter-frequency/.meta/hints.md +++ b/exercises/practice/parallel-letter-frequency/.docs/instructions.append.md @@ -1,3 +1,3 @@ -## Hints +# Instructions append For this exercise the following F# feature comes in handy: - [Asynchronous programming](https://fsharpforfunandprofit.com/posts/concurrency-async-and-parallel/) .NET has asynchronous functionality built-in which enables you to run things in parallel (assuming you have a multi-core processor which is becoming more an more common) easily \ No newline at end of file diff --git a/exercises/practice/parallel-letter-frequency/.docs/instructions.md b/exercises/practice/parallel-letter-frequency/.docs/instructions.md new file mode 100644 index 000000000..a5b936c5e --- /dev/null +++ b/exercises/practice/parallel-letter-frequency/.docs/instructions.md @@ -0,0 +1,8 @@ +# Instructions + +Count the frequency of letters in texts using parallel computation. + +Parallelism is about doing things in parallel that can also be done +sequentially. A common example is counting the frequency of letters. +Create a function that returns the total frequency of each letter in a +list of texts and that employs parallelism. diff --git a/exercises/practice/parallel-letter-frequency/.meta/config.json b/exercises/practice/parallel-letter-frequency/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/parallel-letter-frequency/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/parallel-letter-frequency/README.md b/exercises/practice/parallel-letter-frequency/README.md deleted file mode 100644 index 61be02cfa..000000000 --- a/exercises/practice/parallel-letter-frequency/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Parallel Letter Frequency - -Count the frequency of letters in texts using parallel computation. - -Parallelism is about doing things in parallel that can also be done -sequentially. A common example is counting the frequency of letters. -Create a function that returns the total frequency of each letter in a -list of texts and that employs parallelism. - -## Hints -For this exercise the following F# feature comes in handy: -- [Asynchronous programming](https://fsharpforfunandprofit.com/posts/concurrency-async-and-parallel/) .NET has asynchronous functionality built-in which enables you to run things in parallel (assuming you have a multi-core processor which is becoming more an more common) easily - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/pascals-triangle/.docs/instructions.md b/exercises/practice/pascals-triangle/.docs/instructions.md new file mode 100644 index 000000000..7109334fb --- /dev/null +++ b/exercises/practice/pascals-triangle/.docs/instructions.md @@ -0,0 +1,15 @@ +# Instructions + +Compute Pascal's triangle up to a given number of rows. + +In Pascal's Triangle each number is computed by adding the numbers to +the right and left of the current position in the previous row. + +```text + 1 + 1 1 + 1 2 1 + 1 3 3 1 +1 4 6 4 1 +# ... etc +``` diff --git a/exercises/practice/pascals-triangle/.meta/config.json b/exercises/practice/pascals-triangle/.meta/config.json new file mode 100644 index 000000000..31ba6bfda --- /dev/null +++ b/exercises/practice/pascals-triangle/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Pascal's Triangle at Wolfram Math World", + "source_url": "http://mathworld.wolfram.com/PascalsTriangle.html" +} diff --git a/exercises/practice/pascals-triangle/README.md b/exercises/practice/pascals-triangle/README.md deleted file mode 100644 index a7fcc223f..000000000 --- a/exercises/practice/pascals-triangle/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# Pascal's Triangle - -Compute Pascal's triangle up to a given number of rows. - -In Pascal's Triangle each number is computed by adding the numbers to -the right and left of the current position in the previous row. - -```text - 1 - 1 1 - 1 2 1 - 1 3 3 1 -1 4 6 4 1 -# ... etc -``` - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Pascal's Triangle at Wolfram Math World [http://mathworld.wolfram.com/PascalsTriangle.html](http://mathworld.wolfram.com/PascalsTriangle.html) - diff --git a/exercises/practice/perfect-numbers/.docs/instructions.md b/exercises/practice/perfect-numbers/.docs/instructions.md new file mode 100644 index 000000000..144c9133e --- /dev/null +++ b/exercises/practice/perfect-numbers/.docs/instructions.md @@ -0,0 +1,18 @@ +# Instructions + +Determine if a number is perfect, abundant, or deficient based on +Nicomachus' (60 - 120 CE) classification scheme for positive integers. + +The Greek mathematician [Nicomachus](https://en.wikipedia.org/wiki/Nicomachus) devised a classification scheme for positive integers, 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**. diff --git a/exercises/practice/perfect-numbers/.meta/config.json b/exercises/practice/perfect-numbers/.meta/config.json new file mode 100644 index 000000000..62ef1d542 --- /dev/null +++ b/exercises/practice/perfect-numbers/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Taken from Chapter 2 of Functional Thinking by Neal Ford.", + "source_url": "http://shop.oreilly.com/product/0636920029687.do" +} diff --git a/exercises/practice/perfect-numbers/README.md b/exercises/practice/perfect-numbers/README.md deleted file mode 100644 index a214a5499..000000000 --- a/exercises/practice/perfect-numbers/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# 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**. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## 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) - diff --git a/exercises/practice/phone-number/README.md b/exercises/practice/phone-number/.docs/instructions.md similarity index 60% rename from exercises/practice/phone-number/README.md rename to exercises/practice/phone-number/.docs/instructions.md index 55de951dd..6e36daefe 100644 --- a/exercises/practice/phone-number/README.md +++ b/exercises/practice/phone-number/.docs/instructions.md @@ -1,4 +1,4 @@ -# Phone Number +# Instructions Clean up user-entered phone numbers so that they can be sent SMS messages. @@ -27,23 +27,3 @@ 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. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Event Manager by JumpstartLab [http://tutorials.jumpstartlab.com/projects/eventmanager.html](http://tutorials.jumpstartlab.com/projects/eventmanager.html) - diff --git a/exercises/practice/phone-number/.meta/config.json b/exercises/practice/phone-number/.meta/config.json new file mode 100644 index 000000000..411c0ade6 --- /dev/null +++ b/exercises/practice/phone-number/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Event Manager by JumpstartLab", + "source_url": "http://tutorials.jumpstartlab.com/projects/eventmanager.html" +} diff --git a/exercises/practice/pig-latin/README.md b/exercises/practice/pig-latin/.docs/instructions.md similarity index 60% rename from exercises/practice/pig-latin/README.md rename to exercises/practice/pig-latin/.docs/instructions.md index 81cea647d..bcb125117 100644 --- a/exercises/practice/pig-latin/README.md +++ b/exercises/practice/pig-latin/.docs/instructions.md @@ -1,4 +1,4 @@ -# Pig Latin +# Instructions Implement a program that translates from English to Pig Latin. @@ -16,23 +16,3 @@ There are a few more rules for edge cases, and there are regional variants too. See for more details. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -The Pig Latin exercise at Test First Teaching by Ultrasaurus [https://github.com/ultrasaurus/test-first-teaching/blob/master/learn_ruby/pig_latin/](https://github.com/ultrasaurus/test-first-teaching/blob/master/learn_ruby/pig_latin/) - diff --git a/exercises/practice/pig-latin/.meta/config.json b/exercises/practice/pig-latin/.meta/config.json new file mode 100644 index 000000000..53d4387b0 --- /dev/null +++ b/exercises/practice/pig-latin/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "The Pig Latin exercise at Test First Teaching by Ultrasaurus", + "source_url": "https://github.com/ultrasaurus/test-first-teaching/blob/master/learn_ruby/pig_latin/" +} diff --git a/exercises/practice/poker/.meta/hints.md b/exercises/practice/poker/.docs/instructions.append.md similarity index 92% rename from exercises/practice/poker/.meta/hints.md rename to exercises/practice/poker/.docs/instructions.append.md index 4ab7c3c56..62e4585b0 100644 --- a/exercises/practice/poker/.meta/hints.md +++ b/exercises/practice/poker/.docs/instructions.append.md @@ -1,2 +1,2 @@ -## Hints +# Instructions append - [Designing with types](http://fsharpforfunandprofit.com/series/designing-with-types.html) To come up with a clean and easy to read solution for this make sure to choose the right types to represent the different parts of the problem (think of suits, values, cards, etc) \ No newline at end of file diff --git a/exercises/practice/poker/.docs/instructions.md b/exercises/practice/poker/.docs/instructions.md new file mode 100644 index 000000000..6a38cf4bc --- /dev/null +++ b/exercises/practice/poker/.docs/instructions.md @@ -0,0 +1,6 @@ +# Instructions + +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. diff --git a/exercises/practice/poker/.meta/config.json b/exercises/practice/poker/.meta/config.json new file mode 100644 index 000000000..fcb428d52 --- /dev/null +++ b/exercises/practice/poker/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Inspired by the training course from Udacity.", + "source_url": "https://www.udacity.com/course/viewer#!/c-cs212/" +} diff --git a/exercises/practice/poker/README.md b/exercises/practice/poker/README.md deleted file mode 100644 index ade80c974..000000000 --- a/exercises/practice/poker/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# 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. - -## Hints -- [Designing with types](http://fsharpforfunandprofit.com/series/designing-with-types.html) To come up with a clean and easy to read solution for this make sure to choose the right types to represent the different parts of the problem (think of suits, values, cards, etc) - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Inspired by the training course from Udacity. [https://www.udacity.com/course/viewer#!/c-cs212/](https://www.udacity.com/course/viewer#!/c-cs212/) - diff --git a/exercises/practice/pov/README.md b/exercises/practice/pov/.docs/instructions.md similarity index 61% rename from exercises/practice/pov/README.md rename to exercises/practice/pov/.docs/instructions.md index 82d31ecfb..25820172a 100644 --- a/exercises/practice/pov/README.md +++ b/exercises/practice/pov/.docs/instructions.md @@ -1,4 +1,4 @@ -# POV +# Instructions Reparent a graph on a selected node. @@ -36,23 +36,3 @@ a different leaf node) can be seen to follow the path 6-2-0-3-9 This exercise involves taking an input graph and re-orientating it from the point of view of one of the nodes. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Adaptation of exercise from 4clojure [https://www.4clojure.com/](https://www.4clojure.com/) - diff --git a/exercises/practice/pov/.meta/config.json b/exercises/practice/pov/.meta/config.json new file mode 100644 index 000000000..e177ac9db --- /dev/null +++ b/exercises/practice/pov/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Adaptation of exercise from 4clojure", + "source_url": "https://www.4clojure.com/" +} diff --git a/exercises/practice/prime-factors/README.md b/exercises/practice/prime-factors/.docs/instructions.md similarity index 50% rename from exercises/practice/prime-factors/README.md rename to exercises/practice/prime-factors/.docs/instructions.md index 6863ba612..b5cb1657e 100644 --- a/exercises/practice/prime-factors/README.md +++ b/exercises/practice/prime-factors/.docs/instructions.md @@ -1,4 +1,4 @@ -# Prime Factors +# Instructions Compute the prime factors of a given natural number. @@ -28,23 +28,3 @@ You can check this yourself: - = 4 * 15 - = 60 - Success! - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -The Prime Factors Kata by Uncle Bob [http://butunclebob.com/ArticleS.UncleBob.ThePrimeFactorsKata](http://butunclebob.com/ArticleS.UncleBob.ThePrimeFactorsKata) - diff --git a/exercises/practice/prime-factors/.meta/config.json b/exercises/practice/prime-factors/.meta/config.json new file mode 100644 index 000000000..93ed350a6 --- /dev/null +++ b/exercises/practice/prime-factors/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "The Prime Factors Kata by Uncle Bob", + "source_url": "http://butunclebob.com/ArticleS.UncleBob.ThePrimeFactorsKata" +} diff --git a/exercises/practice/protein-translation/README.md b/exercises/practice/protein-translation/.docs/instructions.md similarity index 72% rename from exercises/practice/protein-translation/README.md rename to exercises/practice/protein-translation/.docs/instructions.md index cf018fbf5..c211345ed 100644 --- a/exercises/practice/protein-translation/README.md +++ b/exercises/practice/protein-translation/.docs/instructions.md @@ -1,4 +1,4 @@ -# Protein Translation +# Instructions Translate RNA sequences into proteins. @@ -40,23 +40,3 @@ UGG | Tryptophan UAA, UAG, UGA | STOP Learn more about [protein translation on Wikipedia](http://en.wikipedia.org/wiki/Translation_(biology)) - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Tyler Long - diff --git a/exercises/practice/protein-translation/.meta/config.json b/exercises/practice/protein-translation/.meta/config.json new file mode 100644 index 000000000..775fe02e5 --- /dev/null +++ b/exercises/practice/protein-translation/.meta/config.json @@ -0,0 +1,9 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Tyler Long" +} diff --git a/exercises/practice/proverb/.meta/hints.md b/exercises/practice/proverb/.docs/instructions.append.md similarity index 83% rename from exercises/practice/proverb/.meta/hints.md rename to exercises/practice/proverb/.docs/instructions.append.md index 5911e1b55..c1aef0ee5 100644 --- a/exercises/practice/proverb/.meta/hints.md +++ b/exercises/practice/proverb/.docs/instructions.append.md @@ -1,2 +1,2 @@ -## Hints +# Instructions append - Try to capture the structure of the song in your code, where you build up the song by composing its parts. diff --git a/exercises/practice/proverb/.docs/instructions.md b/exercises/practice/proverb/.docs/instructions.md new file mode 100644 index 000000000..cf3b4c8b2 --- /dev/null +++ b/exercises/practice/proverb/.docs/instructions.md @@ -0,0 +1,17 @@ +# Instructions + +For want of a horseshoe nail, a kingdom was lost, or so the saying goes. + +Given a list of inputs, generate the relevant proverb. For example, given the list `["nail", "shoe", "horse", "rider", "message", "battle", "kingdom"]`, you will output the full text of this proverbial rhyme: + +```text +For want of a nail the shoe was lost. +For want of a shoe the horse was lost. +For want of a horse the rider was lost. +For want of a rider the message was lost. +For want of a message the battle was lost. +For want of a battle the kingdom was lost. +And all for the want of a nail. +``` + +Note that the list of inputs may vary; your solution should be able to handle lists of arbitrary length and content. No line of the output text should be a static, unchanging string; all should vary according to the input given. diff --git a/exercises/practice/proverb/.meta/config.json b/exercises/practice/proverb/.meta/config.json new file mode 100644 index 000000000..96dcb8187 --- /dev/null +++ b/exercises/practice/proverb/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Wikipedia", + "source_url": "http://en.wikipedia.org/wiki/For_Want_of_a_Nail" +} diff --git a/exercises/practice/proverb/README.md b/exercises/practice/proverb/README.md deleted file mode 100644 index 40941d3dc..000000000 --- a/exercises/practice/proverb/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Proverb - -For want of a horseshoe nail, a kingdom was lost, or so the saying goes. - -Given a list of inputs, generate the relevant proverb. For example, given the list `["nail", "shoe", "horse", "rider", "message", "battle", "kingdom"]`, you will output the full text of this proverbial rhyme: - -```text -For want of a nail the shoe was lost. -For want of a shoe the horse was lost. -For want of a horse the rider was lost. -For want of a rider the message was lost. -For want of a message the battle was lost. -For want of a battle the kingdom was lost. -And all for the want of a nail. -``` - -Note that the list of inputs may vary; your solution should be able to handle lists of arbitrary length and content. No line of the output text should be a static, unchanging string; all should vary according to the input given. - -## Hints -- Try to capture the structure of the song in your code, where you build up the song by composing its parts. - - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Wikipedia [http://en.wikipedia.org/wiki/For_Want_of_a_Nail](http://en.wikipedia.org/wiki/For_Want_of_a_Nail) - diff --git a/exercises/practice/pythagorean-triplet/.docs/instructions.md b/exercises/practice/pythagorean-triplet/.docs/instructions.md new file mode 100644 index 000000000..395ff6a55 --- /dev/null +++ b/exercises/practice/pythagorean-triplet/.docs/instructions.md @@ -0,0 +1,24 @@ +# Instructions + +A Pythagorean triplet is a set of three natural numbers, {a, b, c}, for +which, + +```text +a**2 + b**2 = c**2 +``` + +and such that, + +```text +a < b < c +``` + +For example, + +```text +3**2 + 4**2 = 9 + 16 = 25 = 5**2. +``` + +Given an input integer N, find all Pythagorean triplets for which `a + b + c = N`. + +For example, with N = 1000, there is exactly one Pythagorean triplet for which `a + b + c = 1000`: `{200, 375, 425}`. diff --git a/exercises/practice/pythagorean-triplet/.meta/config.json b/exercises/practice/pythagorean-triplet/.meta/config.json new file mode 100644 index 000000000..99e683cf3 --- /dev/null +++ b/exercises/practice/pythagorean-triplet/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Problem 9 at Project Euler", + "source_url": "http://projecteuler.net/problem=9" +} diff --git a/exercises/practice/pythagorean-triplet/README.md b/exercises/practice/pythagorean-triplet/README.md deleted file mode 100644 index 7e5cb6ed6..000000000 --- a/exercises/practice/pythagorean-triplet/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# Pythagorean Triplet - -A Pythagorean triplet is a set of three natural numbers, {a, b, c}, for -which, - -```text -a**2 + b**2 = c**2 -``` - -and such that, - -```text -a < b < c -``` - -For example, - -```text -3**2 + 4**2 = 9 + 16 = 25 = 5**2. -``` - -Given an input integer N, find all Pythagorean triplets for which `a + b + c = N`. - -For example, with N = 1000, there is exactly one Pythagorean triplet for which `a + b + c = 1000`: `{200, 375, 425}`. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Problem 9 at Project Euler [http://projecteuler.net/problem=9](http://projecteuler.net/problem=9) - diff --git a/exercises/practice/queen-attack/.docs/instructions.md b/exercises/practice/queen-attack/.docs/instructions.md new file mode 100644 index 000000000..1f8e61a68 --- /dev/null +++ b/exercises/practice/queen-attack/.docs/instructions.md @@ -0,0 +1,27 @@ +# Instructions + +Given the position of two queens on a chess board, indicate whether or not they +are positioned so that they can attack each other. + +In the game of chess, a queen can attack pieces which are on the same +row, column, or diagonal. + +A chessboard can be represented by an 8 by 8 array. + +So if you're told the white queen is at (2, 3) and the black queen at +(5, 6), then you'd know you've got a set-up like so: + +```text +_ _ _ _ _ _ _ _ +_ _ _ _ _ _ _ _ +_ _ _ W _ _ _ _ +_ _ _ _ _ _ _ _ +_ _ _ _ _ _ _ _ +_ _ _ _ _ _ B _ +_ _ _ _ _ _ _ _ +_ _ _ _ _ _ _ _ +``` + +You'd also be able to answer whether the queens can attack each other. +In this case, that answer would be yes, they can, because both pieces +share a diagonal. diff --git a/exercises/practice/queen-attack/.meta/config.json b/exercises/practice/queen-attack/.meta/config.json new file mode 100644 index 000000000..4f6d17a38 --- /dev/null +++ b/exercises/practice/queen-attack/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "J Dalbey's Programming Practice problems", + "source_url": "http://users.csc.calpoly.edu/~jdalbey/103/Projects/ProgrammingPractice.html" +} diff --git a/exercises/practice/queen-attack/README.md b/exercises/practice/queen-attack/README.md deleted file mode 100644 index b0d9da00c..000000000 --- a/exercises/practice/queen-attack/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# Queen Attack - -Given the position of two queens on a chess board, indicate whether or not they -are positioned so that they can attack each other. - -In the game of chess, a queen can attack pieces which are on the same -row, column, or diagonal. - -A chessboard can be represented by an 8 by 8 array. - -So if you're told the white queen is at (2, 3) and the black queen at -(5, 6), then you'd know you've got a set-up like so: - -```text -_ _ _ _ _ _ _ _ -_ _ _ _ _ _ _ _ -_ _ _ W _ _ _ _ -_ _ _ _ _ _ _ _ -_ _ _ _ _ _ _ _ -_ _ _ _ _ _ B _ -_ _ _ _ _ _ _ _ -_ _ _ _ _ _ _ _ -``` - -You'd also be able to answer whether the queens can attack each other. -In this case, that answer would be yes, they can, because both pieces -share a diagonal. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## 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) - diff --git a/exercises/practice/rail-fence-cipher/README.md b/exercises/practice/rail-fence-cipher/.docs/instructions.md similarity index 69% rename from exercises/practice/rail-fence-cipher/README.md rename to exercises/practice/rail-fence-cipher/.docs/instructions.md index 996aa87a9..0e75a2bf7 100644 --- a/exercises/practice/rail-fence-cipher/README.md +++ b/exercises/practice/rail-fence-cipher/.docs/instructions.md @@ -1,4 +1,4 @@ -# Rail Fence Cipher +# Instructions Implement encoding and decoding for the rail fence cipher. @@ -57,23 +57,3 @@ W . . . E . . . C . . . R . . . L . . . T . . . E ``` If you now read along the zig-zag shape you can read the original message. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Wikipedia [https://en.wikipedia.org/wiki/Transposition_cipher#Rail_Fence_cipher](https://en.wikipedia.org/wiki/Transposition_cipher#Rail_Fence_cipher) - diff --git a/exercises/practice/rail-fence-cipher/.meta/config.json b/exercises/practice/rail-fence-cipher/.meta/config.json new file mode 100644 index 000000000..50a1ae3c0 --- /dev/null +++ b/exercises/practice/rail-fence-cipher/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Wikipedia", + "source_url": "https://en.wikipedia.org/wiki/Transposition_cipher#Rail_Fence_cipher" +} diff --git a/exercises/practice/raindrops/.meta/hints.md b/exercises/practice/raindrops/.docs/instructions.append.md similarity index 93% rename from exercises/practice/raindrops/.meta/hints.md rename to exercises/practice/raindrops/.docs/instructions.append.md index be881e042..df818c8de 100644 --- a/exercises/practice/raindrops/.meta/hints.md +++ b/exercises/practice/raindrops/.docs/instructions.append.md @@ -1,2 +1,2 @@ -## Hints +# Instructions append - Think of this in a generic way. If you're familiar with the (fizz buzz)[https://en.wikipedia.org/wiki/Fizz_buzz] problem this is similar except there are three conditions instead of two. How would you implement this knowing that one day we might want to extend to four, five, or even ten types of raindrops? \ No newline at end of file diff --git a/exercises/practice/raindrops/.docs/instructions.md b/exercises/practice/raindrops/.docs/instructions.md new file mode 100644 index 000000000..a78585df2 --- /dev/null +++ b/exercises/practice/raindrops/.docs/instructions.md @@ -0,0 +1,16 @@ +# Instructions + +Your task is to convert a number into a string that contains raindrop sounds corresponding to certain potential factors. A factor is a number that evenly divides into another number, leaving no remainder. The simplest way to test if a one number is a factor of another is to use the [modulo operation](https://en.wikipedia.org/wiki/Modulo_operation). + +The rules of `raindrops` are that if a given number: + +- has 3 as a factor, add 'Pling' to the result. +- has 5 as a factor, add 'Plang' to the result. +- has 7 as a factor, add 'Plong' to the result. +- _does not_ have any of 3, 5, or 7 as a factor, the result should be the digits of the number. + +## Examples + +- 28 has 7 as a factor, but not 3 or 5, so the result would be "Plong". +- 30 has both 3 and 5 as factors, but not 7, so the result would be "PlingPlang". +- 34 is not factored by 3, 5, or 7, so the result would be "34". diff --git a/exercises/practice/raindrops/.meta/config.json b/exercises/practice/raindrops/.meta/config.json new file mode 100644 index 000000000..6e48df372 --- /dev/null +++ b/exercises/practice/raindrops/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "A variation on FizzBuzz, a famous technical interview question that is intended to weed out potential candidates. That question is itself derived from Fizz Buzz, a popular children's game for teaching division.", + "source_url": "https://en.wikipedia.org/wiki/Fizz_buzz" +} diff --git a/exercises/practice/raindrops/README.md b/exercises/practice/raindrops/README.md deleted file mode 100644 index 65c1b2270..000000000 --- a/exercises/practice/raindrops/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Raindrops - -Your task is to convert a number into a string that contains raindrop sounds corresponding to certain potential factors. A factor is a number that evenly divides into another number, leaving no remainder. The simplest way to test if a one number is a factor of another is to use the [modulo operation](https://en.wikipedia.org/wiki/Modulo_operation). - -The rules of `raindrops` are that if a given number: - -- has 3 as a factor, add 'Pling' to the result. -- has 5 as a factor, add 'Plang' to the result. -- has 7 as a factor, add 'Plong' to the result. -- _does not_ have any of 3, 5, or 7 as a factor, the result should be the digits of the number. - -## Examples - -- 28 has 7 as a factor, but not 3 or 5, so the result would be "Plong". -- 30 has both 3 and 5 as factors, but not 7, so the result would be "PlingPlang". -- 34 is not factored by 3, 5, or 7, so the result would be "34". - -## Hints -- Think of this in a generic way. If you're familiar with the (fizz buzz)[https://en.wikipedia.org/wiki/Fizz_buzz] problem this is similar except there are three conditions instead of two. How would you implement this knowing that one day we might want to extend to four, five, or even ten types of raindrops? - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -A variation on FizzBuzz, a famous technical interview question that is intended to weed out potential candidates. That question is itself derived from Fizz Buzz, a popular children's game for teaching division. [https://en.wikipedia.org/wiki/Fizz_buzz](https://en.wikipedia.org/wiki/Fizz_buzz) - diff --git a/exercises/practice/rational-numbers/README.md b/exercises/practice/rational-numbers/.docs/instructions.md similarity index 56% rename from exercises/practice/rational-numbers/README.md rename to exercises/practice/rational-numbers/.docs/instructions.md index 2e0961d19..1a7d3f3bd 100644 --- a/exercises/practice/rational-numbers/README.md +++ b/exercises/practice/rational-numbers/.docs/instructions.md @@ -1,16 +1,16 @@ -# Rational Numbers +# Instructions A rational number is defined as the quotient of two integers `a` and `b`, called the numerator and denominator, respectively, where `b != 0`. The absolute value `|r|` of the rational number `r = a/b` is equal to `|a|/|b|`. -The sum of two rational numbers `r1 = a1/b1` and `r2 = a2/b2` is `r1 + r2 = a1/b1 + a2/b2 = (a1 * b2 + a2 * b1) / (b1 * b2)`. +The sum of two rational numbers `r₁ = a₁/b₁` and `r₂ = a₂/b₂` is `r₁ + r₂ = a₁/b₁ + a₂/b₂ = (a₁ * b₂ + a₂ * b₁) / (b₁ * b₂)`. -The difference of two rational numbers `r1 = a1/b1` and `r2 = a2/b2` is `r1 - r2 = a1/b1 - a2/b2 = (a1 * b2 - a2 * b1) / (b1 * b2)`. +The difference of two rational numbers `r₁ = a₁/b₁` and `r₂ = a₂/b₂` is `r₁ - r₂ = a₁/b₁ - a₂/b₂ = (a₁ * b₂ - a₂ * b₁) / (b₁ * b₂)`. -The product (multiplication) of two rational numbers `r1 = a1/b1` and `r2 = a2/b2` is `r1 * r2 = (a1 * a2) / (b1 * b2)`. +The product (multiplication) of two rational numbers `r₁ = a₁/b₁` and `r₂ = a₂/b₂` is `r₁ * r₂ = (a₁ * a₂) / (b₁ * b₂)`. -Dividing a rational number `r1 = a1/b1` by another `r2 = a2/b2` is `r1 / r2 = (a1 * b2) / (a2 * b1)` if `a2 * b1` is not zero. +Dividing a rational number `r₁ = a₁/b₁` by another `r₂ = a₂/b₂` is `r₁ / r₂ = (a₁ * b₂) / (a₂ * b₁)` if `a₂` is not zero. Exponentiation of a rational number `r = a/b` to a non-negative integer power `n` is `r^n = (a^n)/(b^n)`. @@ -27,23 +27,3 @@ Implement the following operations: Your implementation of rational numbers should always be reduced to lowest terms. For example, `4/4` should reduce to `1/1`, `30/60` should reduce to `1/2`, `12/8` should reduce to `3/2`, etc. To reduce a rational number `r = a/b`, divide `a` and `b` by the greatest common divisor (gcd) of `a` and `b`. So, for example, `gcd(12, 8) = 4`, so `r = 12/8` can be reduced to `(12/4)/(8/4) = 3/2`. Assume that the programming language you are using does not have an implementation of rational numbers. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Wikipedia [https://en.wikipedia.org/wiki/Rational_number](https://en.wikipedia.org/wiki/Rational_number) - diff --git a/exercises/practice/rational-numbers/.meta/config.json b/exercises/practice/rational-numbers/.meta/config.json new file mode 100644 index 000000000..a72305bba --- /dev/null +++ b/exercises/practice/rational-numbers/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Wikipedia", + "source_url": "https://en.wikipedia.org/wiki/Rational_number" +} diff --git a/exercises/practice/react/README.md b/exercises/practice/react/.docs/instructions.md similarity index 55% rename from exercises/practice/react/README.md rename to exercises/practice/react/.docs/instructions.md index 7ed955c46..5cad8825f 100644 --- a/exercises/practice/react/README.md +++ b/exercises/practice/react/.docs/instructions.md @@ -1,4 +1,4 @@ -# React +# Instructions Implement a basic reactive system. @@ -14,19 +14,3 @@ propagate to reach a new stable system state. In addition, compute cells should allow for registering change notification callbacks. Call a cell’s callbacks when the cell’s value in a new stable state has changed from the previous stable state. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/react/.meta/config.json b/exercises/practice/react/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/react/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/rectangles/.docs/instructions.md b/exercises/practice/rectangles/.docs/instructions.md new file mode 100644 index 000000000..e1efd7473 --- /dev/null +++ b/exercises/practice/rectangles/.docs/instructions.md @@ -0,0 +1,64 @@ +# Instructions + +Count the rectangles in an ASCII diagram like the one below. + +```text + +--+ + ++ | ++-++--+ +| | | ++--+--+ +``` + +The above diagram contains 6 rectangles: + +```text + + ++-----+ +| | ++-----+ +``` + +```text + +--+ + | | + | | + | | + +--+ +``` + +```text + +--+ + | | + +--+ + + +``` + +```text + + + +--+ + | | + +--+ +``` + +```text + + ++--+ +| | ++--+ +``` + +```text + + ++ + ++ + + +``` + +You may assume that the input is always a proper rectangle (i.e. the length of +every line equals the length of the first line). diff --git a/exercises/practice/rectangles/.meta/config.json b/exercises/practice/rectangles/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/rectangles/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/rectangles/README.md b/exercises/practice/rectangles/README.md deleted file mode 100644 index b9a370746..000000000 --- a/exercises/practice/rectangles/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# Rectangles - -Count the rectangles in an ASCII diagram like the one below. - -```text - +--+ - ++ | -+-++--+ -| | | -+--+--+ -``` - -The above diagram contains 6 rectangles: - -```text - - -+-----+ -| | -+-----+ -``` - -```text - +--+ - | | - | | - | | - +--+ -``` - -```text - +--+ - | | - +--+ - - -``` - -```text - - - +--+ - | | - +--+ -``` - -```text - - -+--+ -| | -+--+ -``` - -```text - - ++ - ++ - - -``` - -You may assume that the input is always a proper rectangle (i.e. the length of -every line equals the length of the first line). - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/rest-api/README.md b/exercises/practice/rest-api/.docs/instructions.md similarity index 71% rename from exercises/practice/rest-api/README.md rename to exercises/practice/rest-api/.docs/instructions.md index 235132856..8db2c5642 100644 --- a/exercises/practice/rest-api/README.md +++ b/exercises/practice/rest-api/.docs/instructions.md @@ -1,4 +1,4 @@ -# Rest Api +# Instructions Implement a RESTful API for tracking IOUs. @@ -38,18 +38,3 @@ Your task is to implement a simple [RESTful API](https://en.wikipedia.org/wiki/R - Example RESTful APIs - [GitHub](https://developer.github.com/v3/) - [Reddit](https://www.reddit.com/dev/api/) -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/rest-api/.meta/config.json b/exercises/practice/rest-api/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/rest-api/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/reverse-string/.docs/instructions.md b/exercises/practice/reverse-string/.docs/instructions.md new file mode 100644 index 000000000..039ee33ae --- /dev/null +++ b/exercises/practice/reverse-string/.docs/instructions.md @@ -0,0 +1,7 @@ +# Instructions + +Reverse a string + +For example: +input: "cool" +output: "looc" diff --git a/exercises/practice/reverse-string/.meta/config.json b/exercises/practice/reverse-string/.meta/config.json new file mode 100644 index 000000000..f67413cd3 --- /dev/null +++ b/exercises/practice/reverse-string/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Introductory challenge to reverse an input string", + "source_url": "https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb" +} diff --git a/exercises/practice/reverse-string/README.md b/exercises/practice/reverse-string/README.md deleted file mode 100644 index a53ff4b02..000000000 --- a/exercises/practice/reverse-string/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# Reverse String - -Reverse a string - -For example: -input: "cool" -output: "looc" - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Introductory challenge to reverse an input string [https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb](https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb) - diff --git a/exercises/practice/rna-transcription/.meta/hints.md b/exercises/practice/rna-transcription/.docs/instructions.append.md similarity index 91% rename from exercises/practice/rna-transcription/.meta/hints.md rename to exercises/practice/rna-transcription/.docs/instructions.append.md index 8e41f826d..8bb29db10 100644 --- a/exercises/practice/rna-transcription/.meta/hints.md +++ b/exercises/practice/rna-transcription/.docs/instructions.append.md @@ -1,3 +1,3 @@ -## Hints +# Instructions append For this exercise the following F# feature comes in handy: - [Match Expressions](https://fsharpforfunandprofit.com/posts/match-expression/) While this can be solved using a dictionary, using a match expression is more idiomatic. \ No newline at end of file diff --git a/exercises/practice/rna-transcription/.docs/instructions.md b/exercises/practice/rna-transcription/.docs/instructions.md new file mode 100644 index 000000000..9e86efea9 --- /dev/null +++ b/exercises/practice/rna-transcription/.docs/instructions.md @@ -0,0 +1,19 @@ +# Instructions + +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` diff --git a/exercises/practice/rna-transcription/.meta/config.json b/exercises/practice/rna-transcription/.meta/config.json new file mode 100644 index 000000000..2ad603b80 --- /dev/null +++ b/exercises/practice/rna-transcription/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Hyperphysics", + "source_url": "http://hyperphysics.phy-astr.gsu.edu/hbase/Organic/transcription.html" +} diff --git a/exercises/practice/rna-transcription/README.md b/exercises/practice/rna-transcription/README.md deleted file mode 100644 index ca52075ee..000000000 --- a/exercises/practice/rna-transcription/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# 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` - -## Hints -For this exercise the following F# feature comes in handy: -- [Match Expressions](https://fsharpforfunandprofit.com/posts/match-expression/) While this can be solved using a dictionary, using a match expression is more idiomatic. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Hyperphysics [http://hyperphysics.phy-astr.gsu.edu/hbase/Organic/transcription.html](http://hyperphysics.phy-astr.gsu.edu/hbase/Organic/transcription.html) - diff --git a/exercises/practice/robot-name/.docs/instructions.md b/exercises/practice/robot-name/.docs/instructions.md new file mode 100644 index 000000000..a0079a341 --- /dev/null +++ b/exercises/practice/robot-name/.docs/instructions.md @@ -0,0 +1,16 @@ +# Instructions + +Manage robot factory settings. + +When a robot comes off the factory floor, it has no name. + +The first time you turn on a robot, a random name is generated in the format +of two uppercase letters followed by three digits, such as RX837 or BC811. + +Every once in a while we need to reset a robot to its factory settings, +which means that its name gets wiped. The next time you ask, that robot will +respond with a new random name. + +The names must be random: they should not follow a predictable sequence. +Using random names means a risk of collisions. Your solution must ensure that +every existing robot has a unique name. diff --git a/exercises/practice/robot-name/.meta/config.json b/exercises/practice/robot-name/.meta/config.json new file mode 100644 index 000000000..28517fc0a --- /dev/null +++ b/exercises/practice/robot-name/.meta/config.json @@ -0,0 +1,9 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "A debugging session with Paul Blackwell at gSchool." +} diff --git a/exercises/practice/robot-name/README.md b/exercises/practice/robot-name/README.md deleted file mode 100644 index 37a6ae66b..000000000 --- a/exercises/practice/robot-name/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Robot Name - -Manage robot factory settings. - -When a robot comes off the factory floor, it has no name. - -The first time you turn on a robot, a random name is generated in the format -of two uppercase letters followed by three digits, such as RX837 or BC811. - -Every once in a while we need to reset a robot to its factory settings, -which means that its name gets wiped. The next time you ask, that robot will -respond with a new random name. - -The names must be random: they should not follow a predictable sequence. -Using random names means a risk of collisions. Your solution must ensure that -every existing robot has a unique name. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -A debugging session with Paul Blackwell at gSchool. [http://gschool.it](http://gschool.it) - diff --git a/exercises/practice/robot-simulator/README.md b/exercises/practice/robot-simulator/.docs/instructions.md similarity index 54% rename from exercises/practice/robot-simulator/README.md rename to exercises/practice/robot-simulator/.docs/instructions.md index 885eb74ab..83be50ccc 100644 --- a/exercises/practice/robot-simulator/README.md +++ b/exercises/practice/robot-simulator/.docs/instructions.md @@ -1,4 +1,4 @@ -# Robot Simulator +# Instructions Write a robot simulator. @@ -26,23 +26,3 @@ direction it is pointing. - Turn left yet again - Say a robot starts at {7, 3} facing north. Then running this stream of instructions should leave it at {9, 4} facing west. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Inspired by an interview question at a famous company. - diff --git a/exercises/practice/robot-simulator/.meta/config.json b/exercises/practice/robot-simulator/.meta/config.json new file mode 100644 index 000000000..132c673d7 --- /dev/null +++ b/exercises/practice/robot-simulator/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Inspired by an interview question at a famous company.", + "source_url": "" +} diff --git a/exercises/practice/roman-numerals/README.md b/exercises/practice/roman-numerals/.docs/instructions.md similarity index 62% rename from exercises/practice/roman-numerals/README.md rename to exercises/practice/roman-numerals/.docs/instructions.md index 64b858aff..ce25f205e 100644 --- a/exercises/practice/roman-numerals/README.md +++ b/exercises/practice/roman-numerals/.docs/instructions.md @@ -1,4 +1,4 @@ -# Roman Numerals +# Instructions Write a function to convert from normal numbers to Roman Numerals. @@ -41,23 +41,3 @@ In Roman numerals 1990 is MCMXC: 8=VIII See also: http://www.novaroma.org/via_romana/numbers.html - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -The Roman Numeral Kata [http://codingdojo.org/cgi-bin/index.pl?KataRomanNumerals](http://codingdojo.org/cgi-bin/index.pl?KataRomanNumerals) - diff --git a/exercises/practice/roman-numerals/.meta/config.json b/exercises/practice/roman-numerals/.meta/config.json new file mode 100644 index 000000000..6f551dd00 --- /dev/null +++ b/exercises/practice/roman-numerals/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "The Roman Numeral Kata", + "source_url": "http://codingdojo.org/cgi-bin/index.pl?KataRomanNumerals" +} diff --git a/exercises/practice/rotational-cipher/README.md b/exercises/practice/rotational-cipher/.docs/instructions.md similarity index 61% rename from exercises/practice/rotational-cipher/README.md rename to exercises/practice/rotational-cipher/.docs/instructions.md index d3fc5ea3a..dbf6276f3 100644 --- a/exercises/practice/rotational-cipher/README.md +++ b/exercises/practice/rotational-cipher/.docs/instructions.md @@ -1,4 +1,4 @@ -# Rotational Cipher +# Instructions Create an implementation of the rotational cipher, also sometimes called the Caesar cipher. @@ -29,23 +29,3 @@ Ciphertext is written out in the same formatting as the input including spaces a - ROT26 `Cool` gives `Cool` - ROT13 `The quick brown fox jumps over the lazy dog.` gives `Gur dhvpx oebja sbk whzcf bire gur ynml qbt.` - ROT13 `Gur dhvpx oebja sbk whzcf bire gur ynml qbt.` gives `The quick brown fox jumps over the lazy dog.` - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Wikipedia [https://en.wikipedia.org/wiki/Caesar_cipher](https://en.wikipedia.org/wiki/Caesar_cipher) - diff --git a/exercises/practice/rotational-cipher/.meta/config.json b/exercises/practice/rotational-cipher/.meta/config.json new file mode 100644 index 000000000..757dc45ed --- /dev/null +++ b/exercises/practice/rotational-cipher/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Wikipedia", + "source_url": "https://en.wikipedia.org/wiki/Caesar_cipher" +} diff --git a/exercises/practice/run-length-encoding/README.md b/exercises/practice/run-length-encoding/.docs/instructions.md similarity index 53% rename from exercises/practice/run-length-encoding/README.md rename to exercises/practice/run-length-encoding/.docs/instructions.md index 2722de59e..95f7a9d69 100644 --- a/exercises/practice/run-length-encoding/README.md +++ b/exercises/practice/run-length-encoding/.docs/instructions.md @@ -1,4 +1,4 @@ -# Run Length Encoding +# Instructions Implement run-length encoding and decoding. @@ -22,23 +22,3 @@ For simplicity, you can assume that the unencoded string will only contain the letters A through Z (either lower or upper case) and whitespace. This way data to be encoded will never contain any numbers and numbers inside data to be decoded always represent the count for the following character. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Wikipedia [https://en.wikipedia.org/wiki/Run-length_encoding](https://en.wikipedia.org/wiki/Run-length_encoding) - diff --git a/exercises/practice/run-length-encoding/.meta/config.json b/exercises/practice/run-length-encoding/.meta/config.json new file mode 100644 index 000000000..045f64fb1 --- /dev/null +++ b/exercises/practice/run-length-encoding/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Wikipedia", + "source_url": "https://en.wikipedia.org/wiki/Run-length_encoding" +} diff --git a/exercises/practice/saddle-points/.docs/instructions.md b/exercises/practice/saddle-points/.docs/instructions.md new file mode 100644 index 000000000..aa11e0571 --- /dev/null +++ b/exercises/practice/saddle-points/.docs/instructions.md @@ -0,0 +1,29 @@ +# Instructions + +Detect saddle points in a matrix. + +So say you have a matrix like so: + +```text + 1 2 3 + |--------- +1 | 9 8 7 +2 | 5 3 2 <--- saddle point at column 1, row 2, with value 5 +3 | 6 6 7 +``` + +It has a saddle point at column 1, row 2. + +It's called a "saddle point" because it is greater than or equal to +every element in its row and 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. + +The matrix can have a different number of rows and columns (Non square). + +Note that you may find other definitions of matrix saddle points online, +but the tests for this exercise follow the above unambiguous definition. diff --git a/exercises/practice/saddle-points/.meta/config.json b/exercises/practice/saddle-points/.meta/config.json new file mode 100644 index 000000000..4f6d17a38 --- /dev/null +++ b/exercises/practice/saddle-points/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "J Dalbey's Programming Practice problems", + "source_url": "http://users.csc.calpoly.edu/~jdalbey/103/Projects/ProgrammingPractice.html" +} diff --git a/exercises/practice/saddle-points/README.md b/exercises/practice/saddle-points/README.md deleted file mode 100644 index f2f64618b..000000000 --- a/exercises/practice/saddle-points/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# Saddle Points - -Detect saddle points in a matrix. - -So say you have a matrix like so: - -```text - 1 2 3 - |--------- -1 | 9 8 7 -2 | 5 3 2 <--- saddle point at column 1, row 2, with value 5 -3 | 6 6 7 -``` - -It has a saddle point at column 1, row 2. - -It's called a "saddle point" because it is greater than or equal to -every element in its row and 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. - -The matrix can have a different number of rows and columns (Non square). - -Note that you may find other definitions of matrix saddle points online, -but the tests for this exercise follow the above unambiguous definition. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## 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) - diff --git a/exercises/practice/say/README.md b/exercises/practice/say/.docs/instructions.md similarity index 68% rename from exercises/practice/say/README.md rename to exercises/practice/say/.docs/instructions.md index 5078bf2ad..727b0186d 100644 --- a/exercises/practice/say/README.md +++ b/exercises/practice/say/.docs/instructions.md @@ -1,4 +1,4 @@ -# Say +# Instructions Given a number from 0 to 999,999,999,999, spell out that number in English. @@ -61,23 +61,3 @@ Use _and_ (correctly) when spelling out the number in English: - 120 becomes "one hundred and twenty". - 1002 becomes "one thousand and two". - 1323 becomes "one thousand three hundred and twenty-three". - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -A variation on JavaRanch CattleDrive, exercise 4a [http://www.javaranch.com/say.jsp](http://www.javaranch.com/say.jsp) - diff --git a/exercises/practice/say/.meta/config.json b/exercises/practice/say/.meta/config.json new file mode 100644 index 000000000..cf05febfe --- /dev/null +++ b/exercises/practice/say/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "A variation on JavaRanch CattleDrive, exercise 4a", + "source_url": "http://www.javaranch.com/say.jsp" +} diff --git a/exercises/practice/scale-generator/README.md b/exercises/practice/scale-generator/.docs/instructions.md similarity index 69% rename from exercises/practice/scale-generator/README.md rename to exercises/practice/scale-generator/.docs/instructions.md index 05b8cf1b0..543057ccd 100644 --- a/exercises/practice/scale-generator/README.md +++ b/exercises/practice/scale-generator/.docs/instructions.md @@ -1,4 +1,4 @@ -# Scale Generator +# Instructions Given a tonic, or starting note, and a set of intervals, generate the musical scale starting with the tonic and following the @@ -43,23 +43,7 @@ a "whole step" or "major second" (written as an upper-case "M"). The diatonic scales are built using only these two intervals between adjacent notes. -Non-diatonic scales can contain other intervals. An "augmented first" -interval, written "A", has two interceding notes (e.g., from A to C or -Db to E). There are also smaller and larger intervals, but they will not -figure into this exercise. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - +Non-diatonic scales can contain other intervals. An "augmented second" +interval, written "A", has two interceding notes (e.g., from A to C or Db to E) +or a "whole step" plus a "half step". There are also smaller and larger +intervals, but they will not figure into this exercise. diff --git a/exercises/practice/scale-generator/.meta/config.json b/exercises/practice/scale-generator/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/scale-generator/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/scrabble-score/README.md b/exercises/practice/scrabble-score/.docs/instructions.md similarity index 50% rename from exercises/practice/scrabble-score/README.md rename to exercises/practice/scrabble-score/.docs/instructions.md index 7be87a207..3f986c947 100644 --- a/exercises/practice/scrabble-score/README.md +++ b/exercises/practice/scrabble-score/.docs/instructions.md @@ -1,4 +1,4 @@ -# Scrabble Score +# Instructions Given a word, compute the Scrabble score for that word. @@ -38,23 +38,3 @@ And to total: - You can play a double or a triple letter. - You can play a double or a triple word. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Inspired by the Extreme Startup game [https://github.com/rchatley/extreme_startup](https://github.com/rchatley/extreme_startup) - diff --git a/exercises/practice/scrabble-score/.meta/config.json b/exercises/practice/scrabble-score/.meta/config.json new file mode 100644 index 000000000..8591c6609 --- /dev/null +++ b/exercises/practice/scrabble-score/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Inspired by the Extreme Startup game", + "source_url": "https://github.com/rchatley/extreme_startup" +} diff --git a/exercises/practice/secret-handshake/README.md b/exercises/practice/secret-handshake/.docs/instructions.md similarity index 51% rename from exercises/practice/secret-handshake/README.md rename to exercises/practice/secret-handshake/.docs/instructions.md index 12334272d..92cef2016 100644 --- a/exercises/practice/secret-handshake/README.md +++ b/exercises/practice/secret-handshake/.docs/instructions.md @@ -1,4 +1,4 @@ -# Secret Handshake +# Instructions > There are 10 types of people in the world: Those who understand > binary, and those who don't. @@ -27,23 +27,3 @@ Given the input 19, the function would return the array ["double blink", "wink"] because 19 is 10011 in binary. Notice that the addition of 16 (10000 in binary) has caused the array to be reversed. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Bert, in Mary Poppins [http://www.imdb.com/title/tt0058331/quotes/qt0437047](http://www.imdb.com/title/tt0058331/quotes/qt0437047) - diff --git a/exercises/practice/secret-handshake/.meta/config.json b/exercises/practice/secret-handshake/.meta/config.json new file mode 100644 index 000000000..ce8e08787 --- /dev/null +++ b/exercises/practice/secret-handshake/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Bert, in Mary Poppins", + "source_url": "http://www.imdb.com/title/tt0058331/quotes/qt0437047" +} diff --git a/exercises/practice/series/.docs/instructions.md b/exercises/practice/series/.docs/instructions.md new file mode 100644 index 000000000..3f9d371fa --- /dev/null +++ b/exercises/practice/series/.docs/instructions.md @@ -0,0 +1,21 @@ +# Instructions + +Given a string of digits, output all the contiguous substrings of length `n` in +that string in the order that they appear. + +For example, the string "49142" has the following 3-digit series: + +- "491" +- "914" +- "142" + +And the following 4-digit series: + +- "4914" +- "9142" + +And if you ask for a 6-digit series from a 5-digit string, you deserve +whatever you get. + +Note that these series are only required to occupy *adjacent positions* +in the input; the digits need not be *numerically consecutive*. diff --git a/exercises/practice/series/.meta/config.json b/exercises/practice/series/.meta/config.json new file mode 100644 index 000000000..eed44aa68 --- /dev/null +++ b/exercises/practice/series/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "A subset of the Problem 8 at Project Euler", + "source_url": "http://projecteuler.net/problem=8" +} diff --git a/exercises/practice/series/README.md b/exercises/practice/series/README.md deleted file mode 100644 index b8d8a32a5..000000000 --- a/exercises/practice/series/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Series - -Given a string of digits, output all the contiguous substrings of length `n` in -that string in the order that they appear. - -For example, the string "49142" has the following 3-digit series: - -- "491" -- "914" -- "142" - -And the following 4-digit series: - -- "4914" -- "9142" - -And if you ask for a 6-digit series from a 5-digit string, you deserve -whatever you get. - -Note that these series are only required to occupy *adjacent positions* -in the input; the digits need not be *numerically consecutive*. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -A subset of the Problem 8 at Project Euler [http://projecteuler.net/problem=8](http://projecteuler.net/problem=8) - diff --git a/exercises/practice/sgf-parsing/README.md b/exercises/practice/sgf-parsing/.docs/instructions.md similarity index 81% rename from exercises/practice/sgf-parsing/README.md rename to exercises/practice/sgf-parsing/.docs/instructions.md index 10ff47b21..3969d76c9 100644 --- a/exercises/practice/sgf-parsing/README.md +++ b/exercises/practice/sgf-parsing/.docs/instructions.md @@ -1,4 +1,4 @@ -# SGF Parsing +# Instructions Parsing a Smart Game Format string. @@ -64,19 +64,3 @@ The exercise will have you parse an SGF string and return a tree structure of properties. You do not need to encode knowledge about the data types of properties, just use the rules for the [text](http://www.red-bean.com/sgf/sgf4.html#text) type everywhere. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/sgf-parsing/.meta/config.json b/exercises/practice/sgf-parsing/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/sgf-parsing/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/sieve/README.md b/exercises/practice/sieve/.docs/instructions.md similarity index 63% rename from exercises/practice/sieve/README.md rename to exercises/practice/sieve/.docs/instructions.md index 4199dba7f..7228737a2 100644 --- a/exercises/practice/sieve/README.md +++ b/exercises/practice/sieve/.docs/instructions.md @@ -1,4 +1,4 @@ -# Sieve +# Instructions Use the Sieve of Eratosthenes to find all the primes from 2 up to a given number. @@ -28,23 +28,3 @@ that you've implemented the algorithm, only that you've come up with the correct list of primes. A good first test is to check that you do not use division or remainder operations (div, /, mod or % depending on the language). - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Sieve of Eratosthenes at Wikipedia [http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes](http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes) - diff --git a/exercises/practice/sieve/.meta/config.json b/exercises/practice/sieve/.meta/config.json new file mode 100644 index 000000000..8890656fd --- /dev/null +++ b/exercises/practice/sieve/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Sieve of Eratosthenes at Wikipedia", + "source_url": "http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes" +} diff --git a/exercises/practice/simple-cipher/README.md b/exercises/practice/simple-cipher/.docs/instructions.md similarity index 80% rename from exercises/practice/simple-cipher/README.md rename to exercises/practice/simple-cipher/.docs/instructions.md index ac6701d2c..22a7e4d4b 100644 --- a/exercises/practice/simple-cipher/README.md +++ b/exercises/practice/simple-cipher/.docs/instructions.md @@ -1,4 +1,4 @@ -# Simple Cipher +# Instructions Implement a simple shift cipher like Caesar and a more secure substitution cipher. @@ -61,7 +61,7 @@ substitution cipher a little more fault tolerant by providing a source of randomness and ensuring that the key contains only lowercase letters. If someone doesn't submit a key at all, generate a truly random key of -at least 100 alphanumeric characters in length. +at least 100 lowercase characters in length. ## Extensions @@ -77,23 +77,3 @@ on Wikipedia][dh] for one of the first implementations of this scheme. [1]: https://upload.wikimedia.org/wikipedia/commons/thumb/4/4a/Caesar_cipher_left_shift_of_3.svg/320px-Caesar_cipher_left_shift_of_3.svg.png [dh]: http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Substitution Cipher at Wikipedia [http://en.wikipedia.org/wiki/Substitution_cipher](http://en.wikipedia.org/wiki/Substitution_cipher) - diff --git a/exercises/practice/simple-cipher/.meta/config.json b/exercises/practice/simple-cipher/.meta/config.json new file mode 100644 index 000000000..720f028e3 --- /dev/null +++ b/exercises/practice/simple-cipher/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Substitution Cipher at Wikipedia", + "source_url": "http://en.wikipedia.org/wiki/Substitution_cipher" +} diff --git a/exercises/practice/simple-linked-list/README.md b/exercises/practice/simple-linked-list/.docs/instructions.md similarity index 51% rename from exercises/practice/simple-linked-list/README.md rename to exercises/practice/simple-linked-list/.docs/instructions.md index 3869ae899..1c9d0b3de 100644 --- a/exercises/practice/simple-linked-list/README.md +++ b/exercises/practice/simple-linked-list/.docs/instructions.md @@ -1,4 +1,4 @@ -# Simple Linked List +# Instructions Write a simple linked list implementation that uses Elements and a List. @@ -20,23 +20,3 @@ and provide functions to reverse a linked list and convert to and from arrays. When implementing this in a language with built-in linked lists, implement your own abstract data type. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Inspired by 'Data Structures and Algorithms with Object-Oriented Design Patterns in Ruby', singly linked-lists. [http://www.brpreiss.com/books/opus8/html/page96.html#SECTION004300000000000000000](http://www.brpreiss.com/books/opus8/html/page96.html#SECTION004300000000000000000) - diff --git a/exercises/practice/simple-linked-list/.meta/config.json b/exercises/practice/simple-linked-list/.meta/config.json new file mode 100644 index 000000000..fe67d1572 --- /dev/null +++ b/exercises/practice/simple-linked-list/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Inspired by 'Data Structures and Algorithms with Object-Oriented Design Patterns in Ruby', singly linked-lists.", + "source_url": "https://web.archive.org/web/20160731005714/http://brpreiss.com/books/opus8/html/page96.html" +} diff --git a/exercises/practice/space-age/.meta/hints.md b/exercises/practice/space-age/.docs/instructions.append.md similarity index 93% rename from exercises/practice/space-age/.meta/hints.md rename to exercises/practice/space-age/.docs/instructions.append.md index dc327fee8..90b8f0ffa 100644 --- a/exercises/practice/space-age/.meta/hints.md +++ b/exercises/practice/space-age/.docs/instructions.append.md @@ -1,3 +1,3 @@ -## Hints +# Instructions append - Try to focus on minimizing the amount of code duplication. If you find yourself doing a lot of copy/paste take a step back and think about how the code can be refactored - [Pattern matching](https://fsharpforfunandprofit.com/posts/match-expression/) is more idiomatic than using dictionaries to translate values \ No newline at end of file diff --git a/exercises/practice/space-age/.docs/instructions.md b/exercises/practice/space-age/.docs/instructions.md new file mode 100644 index 000000000..19cca8bf9 --- /dev/null +++ b/exercises/practice/space-age/.docs/instructions.md @@ -0,0 +1,18 @@ +# Instructions + +Given an age in seconds, calculate how old someone would be on: + + - Mercury: orbital period 0.2408467 Earth years + - Venus: orbital period 0.61519726 Earth years + - Earth: orbital period 1.0 Earth years, 365.25 Earth days, or 31557600 seconds + - Mars: orbital period 1.8808158 Earth years + - Jupiter: orbital period 11.862615 Earth years + - Saturn: orbital period 29.447498 Earth years + - Uranus: orbital period 84.016846 Earth years + - Neptune: orbital period 164.79132 Earth years + +So if you were told someone were 1,000,000,000 seconds old, you should +be able to say that they're 31.69 Earth-years old. + +If you're wondering why Pluto didn't make the cut, go watch [this +youtube video](http://www.youtube.com/watch?v=Z_2gbGXzFbs). diff --git a/exercises/practice/space-age/.meta/config.json b/exercises/practice/space-age/.meta/config.json new file mode 100644 index 000000000..a9f0a99e0 --- /dev/null +++ b/exercises/practice/space-age/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Partially inspired by Chapter 1 in Chris Pine's online Learn to Program tutorial.", + "source_url": "http://pine.fm/LearnToProgram/?Chapter=01" +} diff --git a/exercises/practice/space-age/README.md b/exercises/practice/space-age/README.md deleted file mode 100644 index 48f59f752..000000000 --- a/exercises/practice/space-age/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Space Age - -Given an age in seconds, calculate how old someone would be on: - - - Mercury: orbital period 0.2408467 Earth years - - Venus: orbital period 0.61519726 Earth years - - Earth: orbital period 1.0 Earth years, 365.25 Earth days, or 31557600 seconds - - Mars: orbital period 1.8808158 Earth years - - Jupiter: orbital period 11.862615 Earth years - - Saturn: orbital period 29.447498 Earth years - - Uranus: orbital period 84.016846 Earth years - - Neptune: orbital period 164.79132 Earth years - -So if you were told someone were 1,000,000,000 seconds old, you should -be able to say that they're 31.69 Earth-years old. - -If you're wondering why Pluto didn't make the cut, go watch [this -youtube video](http://www.youtube.com/watch?v=Z_2gbGXzFbs). - -## Hints -- Try to focus on minimizing the amount of code duplication. If you find yourself doing a lot of copy/paste take a step back and think about how the code can be refactored -- [Pattern matching](https://fsharpforfunandprofit.com/posts/match-expression/) is more idiomatic than using dictionaries to translate values - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Partially inspired by Chapter 1 in Chris Pine's online Learn to Program tutorial. [http://pine.fm/LearnToProgram/?Chapter=01](http://pine.fm/LearnToProgram/?Chapter=01) - diff --git a/exercises/practice/spiral-matrix/.docs/instructions.md b/exercises/practice/spiral-matrix/.docs/instructions.md new file mode 100644 index 000000000..5e8b567c3 --- /dev/null +++ b/exercises/practice/spiral-matrix/.docs/instructions.md @@ -0,0 +1,24 @@ +# Instructions + +Given the size, return a square matrix of numbers in spiral order. + +The matrix should be filled with natural numbers, starting from 1 +in the top-left corner, increasing in an inward, clockwise spiral order, +like these examples: + +###### Spiral matrix of size 3 + +```text +1 2 3 +8 9 4 +7 6 5 +``` + +###### Spiral matrix of size 4 + +```text + 1 2 3 4 +12 13 14 5 +11 16 15 6 +10 9 8 7 +``` diff --git a/exercises/practice/spiral-matrix/.meta/config.json b/exercises/practice/spiral-matrix/.meta/config.json new file mode 100644 index 000000000..4d0218438 --- /dev/null +++ b/exercises/practice/spiral-matrix/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Reddit r/dailyprogrammer challenge #320 [Easy] Spiral Ascension.", + "source_url": "https://www.reddit.com/r/dailyprogrammer/comments/6i60lr/20170619_challenge_320_easy_spiral_ascension/" +} diff --git a/exercises/practice/spiral-matrix/README.md b/exercises/practice/spiral-matrix/README.md deleted file mode 100644 index 16c144dda..000000000 --- a/exercises/practice/spiral-matrix/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# Spiral Matrix - -Given the size, return a square matrix of numbers in spiral order. - -The matrix should be filled with natural numbers, starting from 1 -in the top-left corner, increasing in an inward, clockwise spiral order, -like these examples: - -###### Spiral matrix of size 3 - -```text -1 2 3 -8 9 4 -7 6 5 -``` - -###### Spiral matrix of size 4 - -```text - 1 2 3 4 -12 13 14 5 -11 16 15 6 -10 9 8 7 -``` - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Reddit r/dailyprogrammer challenge #320 [Easy] Spiral Ascension. [https://www.reddit.com/r/dailyprogrammer/comments/6i60lr/20170619_challenge_320_easy_spiral_ascension/](https://www.reddit.com/r/dailyprogrammer/comments/6i60lr/20170619_challenge_320_easy_spiral_ascension/) - diff --git a/exercises/practice/strain/README.md b/exercises/practice/strain/.docs/instructions.md similarity index 57% rename from exercises/practice/strain/README.md rename to exercises/practice/strain/.docs/instructions.md index 545640613..370eb2216 100644 --- a/exercises/practice/strain/README.md +++ b/exercises/practice/strain/.docs/instructions.md @@ -1,4 +1,4 @@ -# Strain +# Instructions Implement the `keep` and `discard` operation on collections. Given a collection and a predicate on the collection's elements, `keep` returns a new collection @@ -32,23 +32,3 @@ language. Keep your hands off that filter/reject/whatchamacallit functionality provided by your standard library! Solve this one yourself using other basic tools instead. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Conversation with James Edward Gray II [https://twitter.com/jeg2](https://twitter.com/jeg2) - diff --git a/exercises/practice/strain/.meta/config.json b/exercises/practice/strain/.meta/config.json new file mode 100644 index 000000000..70e106389 --- /dev/null +++ b/exercises/practice/strain/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Conversation with James Edward Gray II", + "source_url": "https://twitter.com/jeg2" +} diff --git a/exercises/practice/sublist/README.md b/exercises/practice/sublist/.docs/instructions.md similarity index 57% rename from exercises/practice/sublist/README.md rename to exercises/practice/sublist/.docs/instructions.md index 4d95d85aa..45c3b9648 100644 --- a/exercises/practice/sublist/README.md +++ b/exercises/practice/sublist/.docs/instructions.md @@ -1,4 +1,4 @@ -# Sublist +# Instructions Given two lists determine if the first list is contained within the second list, if the second list is contained within the first list, if both lists are @@ -16,19 +16,3 @@ Examples: * A = [1, 2, 3], B = [1, 2, 3], A is equal to B * A = [1, 2, 3, 4, 5], B = [2, 3, 4], A is a superlist of B * A = [1, 2, 4], B = [1, 2, 3, 4, 5], A is not a superlist of, sublist of or equal to B - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/sublist/.meta/config.json b/exercises/practice/sublist/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/sublist/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/sum-of-multiples/.docs/instructions.md b/exercises/practice/sum-of-multiples/.docs/instructions.md new file mode 100644 index 000000000..bb512396a --- /dev/null +++ b/exercises/practice/sum-of-multiples/.docs/instructions.md @@ -0,0 +1,9 @@ +# Instructions + +Given a number, find the sum of all the unique multiples of particular numbers up to +but not including that number. + +If we list all the natural numbers below 20 that are multiples of 3 or 5, +we get 3, 5, 6, 9, 10, 12, 15, and 18. + +The sum of these multiples is 78. diff --git a/exercises/practice/sum-of-multiples/.meta/config.json b/exercises/practice/sum-of-multiples/.meta/config.json new file mode 100644 index 000000000..d864e2c5f --- /dev/null +++ b/exercises/practice/sum-of-multiples/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "A variation on Problem 1 at Project Euler", + "source_url": "http://projecteuler.net/problem=1" +} diff --git a/exercises/practice/sum-of-multiples/README.md b/exercises/practice/sum-of-multiples/README.md deleted file mode 100644 index 760b7fd6b..000000000 --- a/exercises/practice/sum-of-multiples/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# Sum Of Multiples - -Given a number, find the sum of all the unique multiples of particular numbers up to -but not including that number. - -If we list all the natural numbers below 20 that are multiples of 3 or 5, -we get 3, 5, 6, 9, 10, 12, 15, and 18. - -The sum of these multiples is 78. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -A variation on Problem 1 at Project Euler [http://projecteuler.net/problem=1](http://projecteuler.net/problem=1) - diff --git a/exercises/practice/tournament/README.md b/exercises/practice/tournament/.docs/instructions.md similarity index 73% rename from exercises/practice/tournament/README.md rename to exercises/practice/tournament/.docs/instructions.md index 7ee7e1c2f..ca6e359dc 100644 --- a/exercises/practice/tournament/README.md +++ b/exercises/practice/tournament/.docs/instructions.md @@ -1,4 +1,4 @@ -# Tournament +# Instructions Tally the results of a small football competition. @@ -63,19 +63,3 @@ Devastating Donkeys;Courageous Californians;draw ``` Means that the Devastating Donkeys and Courageous Californians tied. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/tournament/.meta/config.json b/exercises/practice/tournament/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/tournament/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/transpose/.docs/instructions.md b/exercises/practice/transpose/.docs/instructions.md new file mode 100644 index 000000000..c0e1d14a5 --- /dev/null +++ b/exercises/practice/transpose/.docs/instructions.md @@ -0,0 +1,59 @@ +# Instructions + +Given an input text output it transposed. + +Roughly explained, the transpose of a matrix: + +```text +ABC +DEF +``` + +is given by: + +```text +AD +BE +CF +``` + +Rows become columns and columns become rows. See . + +If the input has rows of different lengths, this is to be solved as follows: + +- Pad to the left with spaces. +- Don't pad to the right. + +Therefore, transposing this matrix: + +```text +ABC +DE +``` + +results in: + +```text +AD +BE +C +``` + +And transposing: + +```text +AB +DEF +``` + +results in: + +```text +AD +BE + F +``` + +In general, all characters from the input should also be present in the transposed output. +That means that if a column in the input text contains only spaces on its bottom-most row(s), +the corresponding output row should contain the spaces in its right-most column(s). diff --git a/exercises/practice/transpose/.meta/config.json b/exercises/practice/transpose/.meta/config.json new file mode 100644 index 000000000..43b12df2b --- /dev/null +++ b/exercises/practice/transpose/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Reddit r/dailyprogrammer challenge #270 [Easy].", + "source_url": "https://www.reddit.com/r/dailyprogrammer/comments/4msu2x/challenge_270_easy_transpose_the_input_text" +} diff --git a/exercises/practice/transpose/README.md b/exercises/practice/transpose/README.md deleted file mode 100644 index 9a56812a1..000000000 --- a/exercises/practice/transpose/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# Transpose - -Given an input text output it transposed. - -Roughly explained, the transpose of a matrix: - -```text -ABC -DEF -``` - -is given by: - -```text -AD -BE -CF -``` - -Rows become columns and columns become rows. See . - -If the input has rows of different lengths, this is to be solved as follows: - -- Pad to the left with spaces. -- Don't pad to the right. - -Therefore, transposing this matrix: - -```text -ABC -DE -``` - -results in: - -```text -AD -BE -C -``` - -And transposing: - -```text -AB -DEF -``` - -results in: - -```text -AD -BE - F -``` - -In general, all characters from the input should also be present in the transposed output. -That means that if a column in the input text contains only spaces on its bottom-most row(s), -the corresponding output row should contain the spaces in its right-most column(s). - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Reddit r/dailyprogrammer challenge #270 [Easy]. [https://www.reddit.com/r/dailyprogrammer/comments/4msu2x/challenge_270_easy_transpose_the_input_text](https://www.reddit.com/r/dailyprogrammer/comments/4msu2x/challenge_270_easy_transpose_the_input_text) - diff --git a/exercises/practice/tree-building/README.md b/exercises/practice/tree-building/.docs/instructions.md similarity index 62% rename from exercises/practice/tree-building/README.md rename to exercises/practice/tree-building/.docs/instructions.md index a7876baab..32c6087b4 100644 --- a/exercises/practice/tree-building/README.md +++ b/exercises/practice/tree-building/.docs/instructions.md @@ -1,4 +1,4 @@ -# Tree Building +# Instructions Refactor a tree building algorithm. @@ -25,19 +25,3 @@ root (ID: 0, parent ID: 0) | +-- grandchild3 (ID: 6, parent ID: 3) +-- child3 (ID: 5, parent ID: 0) ``` - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/tree-building/.meta/config.json b/exercises/practice/tree-building/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/tree-building/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/triangle/README.md b/exercises/practice/triangle/.docs/instructions.md similarity index 56% rename from exercises/practice/triangle/README.md rename to exercises/practice/triangle/.docs/instructions.md index 68e7e85df..0a9c68e3b 100644 --- a/exercises/practice/triangle/README.md +++ b/exercises/practice/triangle/.docs/instructions.md @@ -1,4 +1,4 @@ -# Triangle +# Instructions Determine if a triangle is equilateral, isosceles, or scalene. @@ -21,23 +21,3 @@ length of the third side. See [Triangle Inequality](https://en.wikipedia.org/wik 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. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -The Ruby Koans triangle project, parts 1 & 2 [http://rubykoans.com](http://rubykoans.com) - diff --git a/exercises/practice/triangle/.meta/config.json b/exercises/practice/triangle/.meta/config.json new file mode 100644 index 000000000..5983daec1 --- /dev/null +++ b/exercises/practice/triangle/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "The Ruby Koans triangle project, parts 1 & 2", + "source_url": "http://rubykoans.com" +} diff --git a/exercises/practice/trinary/.docs/instructions.md b/exercises/practice/trinary/.docs/instructions.md new file mode 100644 index 000000000..3638ddb74 --- /dev/null +++ b/exercises/practice/trinary/.docs/instructions.md @@ -0,0 +1,22 @@ +# Instructions + +Convert a trinary number, represented as a string (e.g. '102012'), to its +decimal equivalent using first principles. + +The program should consider strings specifying an invalid trinary as the +value 0. + +Trinary numbers contain three symbols: 0, 1, and 2. + +The last place in a trinary number is the 1's place. The second to last +is the 3's place, the third to last is the 9's place, etc. + +```shell +# "102012" + 1 0 2 0 1 2 # the number +1*3^5 + 0*3^4 + 2*3^3 + 0*3^2 + 1*3^1 + 2*3^0 # the value + 243 + 0 + 54 + 0 + 3 + 2 = 302 +``` + +If your language provides a method in the standard library to perform the +conversion, pretend it doesn't exist and implement it yourself. diff --git a/exercises/practice/trinary/.meta/config.json b/exercises/practice/trinary/.meta/config.json new file mode 100644 index 000000000..669f8779a --- /dev/null +++ b/exercises/practice/trinary/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "All of Computer Science", + "source_url": "http://www.wolframalpha.com/input/?i=binary&a=*C.binary-_*MathWorld-" +} diff --git a/exercises/practice/trinary/README.md b/exercises/practice/trinary/README.md deleted file mode 100644 index 63ef381e1..000000000 --- a/exercises/practice/trinary/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Trinary - -Convert a trinary number, represented as a string (e.g. '102012'), to its -decimal equivalent using first principles. - -The program should consider strings specifying an invalid trinary as the -value 0. - -Trinary numbers contain three symbols: 0, 1, and 2. - -The last place in a trinary number is the 1's place. The second to last -is the 3's place, the third to last is the 9's place, etc. - -```shell -# "102012" - 1 0 2 0 1 2 # the number -1*3^5 + 0*3^4 + 2*3^3 + 0*3^2 + 1*3^1 + 2*3^0 # the value - 243 + 0 + 54 + 0 + 3 + 2 = 302 -``` - -If your language provides a method in the standard library to perform the -conversion, pretend it doesn't exist and implement it yourself. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -All of Computer Science [http://www.wolframalpha.com/input/?i=binary&a=*C.binary-_*MathWorld-](http://www.wolframalpha.com/input/?i=binary&a=*C.binary-_*MathWorld-) - diff --git a/exercises/practice/twelve-days/.docs/instructions.append.md b/exercises/practice/twelve-days/.docs/instructions.append.md new file mode 100644 index 000000000..c1aef0ee5 --- /dev/null +++ b/exercises/practice/twelve-days/.docs/instructions.append.md @@ -0,0 +1,2 @@ +# Instructions append +- Try to capture the structure of the song in your code, where you build up the song by composing its parts. diff --git a/exercises/practice/twelve-days/README.md b/exercises/practice/twelve-days/.docs/instructions.md similarity index 73% rename from exercises/practice/twelve-days/README.md rename to exercises/practice/twelve-days/.docs/instructions.md index 86f502497..c54cd95fc 100644 --- a/exercises/practice/twelve-days/README.md +++ b/exercises/practice/twelve-days/.docs/instructions.md @@ -1,4 +1,4 @@ -# Twelve Days +# Instructions Output the lyrics to 'The Twelve Days of Christmas'. @@ -27,27 +27,3 @@ On the eleventh day of Christmas my true love gave to me: eleven Pipers Piping, On the twelfth day of Christmas my true love gave to me: twelve Drummers Drumming, eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. ``` - -## Hints -- Try to capture the structure of the song in your code, where you build up the song by composing its parts. - - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Wikipedia [http://en.wikipedia.org/wiki/The_Twelve_Days_of_Christmas_(song)](http://en.wikipedia.org/wiki/The_Twelve_Days_of_Christmas_(song)) - diff --git a/exercises/practice/twelve-days/.meta/config.json b/exercises/practice/twelve-days/.meta/config.json new file mode 100644 index 000000000..34de90e37 --- /dev/null +++ b/exercises/practice/twelve-days/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Wikipedia", + "source_url": "http://en.wikipedia.org/wiki/The_Twelve_Days_of_Christmas_(song)" +} diff --git a/exercises/practice/twelve-days/.meta/hints.md b/exercises/practice/twelve-days/.meta/hints.md deleted file mode 100644 index 5911e1b55..000000000 --- a/exercises/practice/twelve-days/.meta/hints.md +++ /dev/null @@ -1,2 +0,0 @@ -## Hints -- Try to capture the structure of the song in your code, where you build up the song by composing its parts. diff --git a/exercises/practice/two-bucket/README.md b/exercises/practice/two-bucket/.docs/instructions.md similarity index 68% rename from exercises/practice/two-bucket/README.md rename to exercises/practice/two-bucket/.docs/instructions.md index 922422a81..73eb450ce 100644 --- a/exercises/practice/two-bucket/README.md +++ b/exercises/practice/two-bucket/.docs/instructions.md @@ -1,4 +1,4 @@ -# Two Bucket +# Instructions Given two buckets of different size, demonstrate how to measure an exact number of liters by strategically transferring liters of fluid between the buckets. @@ -23,28 +23,8 @@ Example: Bucket one can hold up to 7 liters, and bucket two can hold up to 11 liters. Let's say bucket one, at a given step, is holding 7 liters, and bucket two is holding 8 liters (7,8). If you empty bucket one and make no change to bucket two, leaving you with 0 liters and 8 liters respectively (0,8), that counts as one "move". Instead, if you had poured from bucket one into bucket two until bucket two was full, leaving you with 4 liters in bucket one and 11 liters in bucket two (4,11), that would count as only one "move" as well. To conclude, the only valid moves are: -- pouring from one bucket to another -- emptying one bucket and doing nothing to the other -- filling one bucket and doing nothing to the other +- pouring from either bucket to another +- emptying either bucket and doing nothing to the other +- filling either bucket and doing nothing to the other Written with <3 at [Fullstack Academy](http://www.fullstackacademy.com/) by Lindsay Levine. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Water Pouring Problem [http://demonstrations.wolfram.com/WaterPouringProblem/](http://demonstrations.wolfram.com/WaterPouringProblem/) - diff --git a/exercises/practice/two-bucket/.meta/config.json b/exercises/practice/two-bucket/.meta/config.json new file mode 100644 index 000000000..0e64a72b0 --- /dev/null +++ b/exercises/practice/two-bucket/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Water Pouring Problem", + "source_url": "http://demonstrations.wolfram.com/WaterPouringProblem/" +} diff --git a/exercises/practice/two-fer/.docs/instructions.md b/exercises/practice/two-fer/.docs/instructions.md new file mode 100644 index 000000000..f4853c54d --- /dev/null +++ b/exercises/practice/two-fer/.docs/instructions.md @@ -0,0 +1,26 @@ +# Instructions + +`Two-fer` or `2-fer` is short for two for one. One for you and one for me. + +Given a name, return a string with the message: + +```text +One for name, one for me. +``` + +Where "name" is the given name. + +However, if the name is missing, return the string: + +```text +One for you, one for me. +``` + +Here are some examples: + +|Name |String to return +|:-------|:------------------ +|Alice |One for Alice, one for me. +|Bob |One for Bob, one for me. +| |One for you, one for me. +|Zaphod |One for Zaphod, one for me. diff --git a/exercises/practice/two-fer/.meta/config.json b/exercises/practice/two-fer/.meta/config.json new file mode 100644 index 000000000..20830aedb --- /dev/null +++ b/exercises/practice/two-fer/.meta/config.json @@ -0,0 +1,9 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source_url": "https://github.com/exercism/problem-specifications/issues/757" +} diff --git a/exercises/practice/two-fer/README.md b/exercises/practice/two-fer/README.md deleted file mode 100644 index 618b05d6e..000000000 --- a/exercises/practice/two-fer/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# Two Fer - -`Two-fer` or `2-fer` is short for two for one. One for you and one for me. - -Given a name, return a string with the message: - -```text -One for X, one for me. -``` - -Where X is the given name. - -However, if the name is missing, return the string: - -```text -One for you, one for me. -``` - -Here are some examples: - -|Name |String to return -|:-------|:------------------ -|Alice |One for Alice, one for me. -|Bob |One for Bob, one for me. -| |One for you, one for me. -|Zaphod |One for Zaphod, one for me. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -[https://github.com/exercism/problem-specifications/issues/757](https://github.com/exercism/problem-specifications/issues/757) - diff --git a/exercises/practice/variable-length-quantity/README.md b/exercises/practice/variable-length-quantity/.docs/instructions.md similarity index 65% rename from exercises/practice/variable-length-quantity/README.md rename to exercises/practice/variable-length-quantity/.docs/instructions.md index 0c3f35cdd..eadce28d0 100644 --- a/exercises/practice/variable-length-quantity/README.md +++ b/exercises/practice/variable-length-quantity/.docs/instructions.md @@ -1,4 +1,4 @@ -# Variable Length Quantity +# Instructions Implement variable length quantity encoding and decoding. @@ -30,23 +30,3 @@ Here are examples of integers as 32-bit values, and the variable length quantiti 08000000 C0 80 80 00 0FFFFFFF FF FF FF 7F ``` - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -A poor Splice developer having to implement MIDI encoding/decoding. [https://splice.com](https://splice.com) - diff --git a/exercises/practice/variable-length-quantity/.meta/config.json b/exercises/practice/variable-length-quantity/.meta/config.json new file mode 100644 index 000000000..36872a01d --- /dev/null +++ b/exercises/practice/variable-length-quantity/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "A poor Splice developer having to implement MIDI encoding/decoding.", + "source_url": "https://splice.com" +} diff --git a/exercises/practice/word-count/README.md b/exercises/practice/word-count/.docs/instructions.md similarity index 59% rename from exercises/practice/word-count/README.md rename to exercises/practice/word-count/.docs/instructions.md index 3708a55b2..d3548e5d8 100644 --- a/exercises/practice/word-count/README.md +++ b/exercises/practice/word-count/.docs/instructions.md @@ -1,4 +1,4 @@ -# Word Count +# Instructions Given a phrase, count the occurrences of each _word_ in that phrase. @@ -29,23 +29,3 @@ so: 1 i: 1 fled: 1 ``` - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -This is a classic toy problem, but we were reminded of it by seeing it in the Go Tour. - diff --git a/exercises/practice/word-count/.meta/config.json b/exercises/practice/word-count/.meta/config.json new file mode 100644 index 000000000..3f1c1350b --- /dev/null +++ b/exercises/practice/word-count/.meta/config.json @@ -0,0 +1,9 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "This is a classic toy problem, but we were reminded of it by seeing it in the Go Tour." +} diff --git a/exercises/practice/word-search/.docs/instructions.md b/exercises/practice/word-search/.docs/instructions.md new file mode 100644 index 000000000..345fa592e --- /dev/null +++ b/exercises/practice/word-search/.docs/instructions.md @@ -0,0 +1,27 @@ +# Instructions + +In word search puzzles you get a square of letters and have to find specific +words in them. + +For example: + +```text +jefblpepre +camdcimgtc +oivokprjsm +pbwasqroua +rixilelhrs +wolcqlirpc +screeaumgr +alxhpburyi +jalaycalmp +clojurermt +``` + +There are several programming languages hidden in the above square. + +Words can be hidden in all kinds of directions: left-to-right, right-to-left, +vertical and diagonal. + +Given a puzzle and a list of words return the location of the first and last +letter of each word. diff --git a/exercises/practice/word-search/.meta/config.json b/exercises/practice/word-search/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/word-search/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +} diff --git a/exercises/practice/word-search/README.md b/exercises/practice/word-search/README.md deleted file mode 100644 index 2252a8b52..000000000 --- a/exercises/practice/word-search/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Word Search - -In word search puzzles you get a square of letters and have to find specific -words in them. - -For example: - -```text -jefblpepre -camdcimgtc -oivokprjsm -pbwasqroua -rixilelhrs -wolcqlirpc -screeaumgr -alxhpburyi -jalaycalmp -clojurermt -``` - -There are several programming languages hidden in the above square. - -Words can be hidden in all kinds of directions: left-to-right, right-to-left, -vertical and diagonal. - -Given a puzzle and a list of words return the location of the first and last -letter of each word. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/wordy/.meta/hints.md b/exercises/practice/wordy/.docs/instructions.append.md similarity index 91% rename from exercises/practice/wordy/.meta/hints.md rename to exercises/practice/wordy/.docs/instructions.append.md index f626edce4..985a21db9 100644 --- a/exercises/practice/wordy/.meta/hints.md +++ b/exercises/practice/wordy/.docs/instructions.append.md @@ -1,3 +1,3 @@ -## Hints +# Instructions append - To parse the text, you could try to use the [FParsec](http://www.quanttec.com/fparsec/tutorial.html) library. - As an exercise, you could try to represent a question as an [Abstract Syntax Tree](https://en.wikipedia.org/wiki/Abstract_syntax_tree). diff --git a/exercises/practice/wordy/README.md b/exercises/practice/wordy/.docs/instructions.md similarity index 53% rename from exercises/practice/wordy/README.md rename to exercises/practice/wordy/.docs/instructions.md index f81917c31..f65b05acf 100644 --- a/exercises/practice/wordy/README.md +++ b/exercises/practice/wordy/.docs/instructions.md @@ -1,4 +1,4 @@ -# Wordy +# Instructions Parse and evaluate simple math word problems returning the answer as an integer. @@ -66,28 +66,3 @@ If you'd like, handle exponentials. > What is 2 raised to the 5th power? 32 - -## Hints -- To parse the text, you could try to use the [FParsec](http://www.quanttec.com/fparsec/tutorial.html) library. -- As an exercise, you could try to represent a question as an [Abstract Syntax Tree](https://en.wikipedia.org/wiki/Abstract_syntax_tree). - - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## 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) - diff --git a/exercises/practice/wordy/.meta/config.json b/exercises/practice/wordy/.meta/config.json new file mode 100644 index 000000000..2f035626d --- /dev/null +++ b/exercises/practice/wordy/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Inspired by one of the generated questions in the Extreme Startup game.", + "source_url": "https://github.com/rchatley/extreme_startup" +} diff --git a/exercises/practice/yacht/README.md b/exercises/practice/yacht/.docs/instructions.md similarity index 73% rename from exercises/practice/yacht/README.md rename to exercises/practice/yacht/.docs/instructions.md index 155f749c4..dadd286f6 100644 --- a/exercises/practice/yacht/README.md +++ b/exercises/practice/yacht/.docs/instructions.md @@ -1,4 +1,4 @@ -# Yacht +# Instructions # Score a single throw of dice in *Yacht* @@ -35,23 +35,3 @@ the score of the dice for that category. If the dice do not satisfy the requirem of the category your solution should return 0. You can assume that five values will always be presented, and the value of each will be between one and six inclusively. You should not assume that the dice are ordered. - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -James Kilfiger, using wikipedia [https://en.wikipedia.org/wiki/Yacht_(dice_game)](https://en.wikipedia.org/wiki/Yacht_(dice_game)) - diff --git a/exercises/practice/yacht/.meta/config.json b/exercises/practice/yacht/.meta/config.json new file mode 100644 index 000000000..168f46edb --- /dev/null +++ b/exercises/practice/yacht/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "James Kilfiger, using wikipedia", + "source_url": "https://en.wikipedia.org/wiki/Yacht_(dice_game)" +} diff --git a/exercises/practice/zebra-puzzle/README.md b/exercises/practice/zebra-puzzle/.docs/instructions.md similarity index 58% rename from exercises/practice/zebra-puzzle/README.md rename to exercises/practice/zebra-puzzle/.docs/instructions.md index 23459253c..18a8da1d8 100644 --- a/exercises/practice/zebra-puzzle/README.md +++ b/exercises/practice/zebra-puzzle/.docs/instructions.md @@ -1,4 +1,4 @@ -# Zebra Puzzle +# Instructions Solve the zebra puzzle. @@ -24,23 +24,3 @@ drink different beverages and smoke different brands of cigarettes. Which of the residents drinks water? Who owns the zebra? - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - -## Source - -Wikipedia [https://en.wikipedia.org/wiki/Zebra_Puzzle](https://en.wikipedia.org/wiki/Zebra_Puzzle) - diff --git a/exercises/practice/zebra-puzzle/.meta/config.json b/exercises/practice/zebra-puzzle/.meta/config.json new file mode 100644 index 000000000..015649040 --- /dev/null +++ b/exercises/practice/zebra-puzzle/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + }, + "source": "Wikipedia", + "source_url": "https://en.wikipedia.org/wiki/Zebra_Puzzle" +} diff --git a/exercises/practice/zipper/README.md b/exercises/practice/zipper/.docs/instructions.md similarity index 69% rename from exercises/practice/zipper/README.md rename to exercises/practice/zipper/.docs/instructions.md index 53df116c8..d760aa0dd 100644 --- a/exercises/practice/zipper/README.md +++ b/exercises/practice/zipper/.docs/instructions.md @@ -1,4 +1,4 @@ -# Zipper +# Instructions Creating a zipper for a binary tree. @@ -26,19 +26,3 @@ list of child nodes) a zipper might support these operations: - `delete` (removes the focus node and all subtrees, focus moves to the `next` node if possible otherwise to the `prev` node if possible, otherwise to the parent node, returns a new zipper) - -## Running the tests - -To run the tests, run the command `dotnet test` from within the exercise directory. - -## Autoformatting the code - -F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. - -After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. - -## Further information - -For more detailed information about the F# track, including how to get help if -you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). - diff --git a/exercises/practice/zipper/.meta/config.json b/exercises/practice/zipper/.meta/config.json new file mode 100644 index 000000000..ac46491c9 --- /dev/null +++ b/exercises/practice/zipper/.meta/config.json @@ -0,0 +1,8 @@ +{ + "authors": [], + "files": { + "solution": [], + "test": [], + "example": [] + } +}