diff --git a/ProblemOfTheWeek.md b/ProblemOfTheWeek.md deleted file mode 100644 index b7ed3c9..0000000 --- a/ProblemOfTheWeek.md +++ /dev/null @@ -1,22 +0,0 @@ -## Poor Polynomials - -We want to represent polynomials using lists, such that the coefficients are stored from the most significant to the least significant. That is, the polynomial - -```haskell - 2x^3 - 3x^2 + 7 -``` - -would be represented as - -```haskell - [2,-3,0,7] -``` - -Propose a data type, `Poly`, such that it exhibits the following behavior: - -* (1 points) The toPoly function allows you to receive an arbitrary list of numbers and "convert" it into a Poly. -* (1 points) The Show instance shows the polynomials in algebraic notation instead of a simple list. -* (1 point) The `addPoly p0 p1` function allows adding two polynomials. -* (2 points) The `evalPoly p x` function allows to evaluate the value of the polynomial `p` at point `x`. - -You cannot use `length` or `reverse` in its implementation. To obtain all the points, the implementation of each function has to make a single pass through the list that internally represents the polynomial. diff --git a/ProblemOfTheWeek.md b/ProblemOfTheWeek.md new file mode 120000 index 0000000..160019d --- /dev/null +++ b/ProblemOfTheWeek.md @@ -0,0 +1 @@ +submissions/gloss.md \ No newline at end of file diff --git a/README.md b/README.md index 7b975d6..9507210 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # Orange Combinator - Problem of the Week +# Problem of the week is here: + +[ProblemOfTheWeek.md](/ProblemOfTheWeek.md) + ## What is this This repository holds the weekly problems for the Orange Combinator functional programming meetup. This activity serves as a learning activity for those new to FP and good practice for the seasoned veteran. diff --git a/submissions/poor-polynomials.md b/submissions/poor-polynomials.md new file mode 100644 index 0000000..b7ed3c9 --- /dev/null +++ b/submissions/poor-polynomials.md @@ -0,0 +1,22 @@ +## Poor Polynomials + +We want to represent polynomials using lists, such that the coefficients are stored from the most significant to the least significant. That is, the polynomial + +```haskell + 2x^3 - 3x^2 + 7 +``` + +would be represented as + +```haskell + [2,-3,0,7] +``` + +Propose a data type, `Poly`, such that it exhibits the following behavior: + +* (1 points) The toPoly function allows you to receive an arbitrary list of numbers and "convert" it into a Poly. +* (1 points) The Show instance shows the polynomials in algebraic notation instead of a simple list. +* (1 point) The `addPoly p0 p1` function allows adding two polynomials. +* (2 points) The `evalPoly p x` function allows to evaluate the value of the polynomial `p` at point `x`. + +You cannot use `length` or `reverse` in its implementation. To obtain all the points, the implementation of each function has to make a single pass through the list that internally represents the polynomial.