Add Bracket Push Exercise#513
Conversation
| ] | ||
| }, | ||
| { | ||
| "slug": "bracket-push", |
There was a problem hiding this comment.
Not 100% sure it is difficulty 3. Perhaps I'm overcomplicating it?
There was a problem hiding this comment.
It's true that once one realizes one can use a stack, it is easy. So the hard part is not writing the implementation. It is figuring out how to tackle the problem at all.
Because of this, I would actually rate higher, maybe 4 or 5.
If it helps to see how other tracks rated it:
for i in tracks/*/config.json; do echo $i; jq 'if any(.exercises[]; .difficulty != 1) then .exercises | map(select(.slug == "bracket-push")) else [] end' < $i; done
tracks/ceylon/config.json
[
{
"slug": "bracket-push",
"difficulty": 6,
"topics": [
"Parsing",
"Stacks",
"Strings"
]
}
]
tracks/csharp/config.json
[
{
"slug": "bracket-push",
"difficulty": 5,
"topics": [
"Parsing",
"Strings"
]
}
]
tracks/elixir/config.json
[
{
"slug": "bracket-push",
"difficulty": 3,
"topics": []
}
]
tracks/fsharp/config.json
[
{
"slug": "bracket-push",
"difficulty": 7,
"topics": [
"Parsing",
"Strings"
]
}
]
tracks/java/config.json
[
{
"slug": "bracket-push",
"difficulty": 5,
"topics": []
}
]
tracks/lua/config.json
[
{
"slug": "bracket-push",
"difficulty": 5,
"topics": [
"stacks",
"strings",
"algorithms",
"control-flow (if-else statements)",
"control-flow (loops)"
]
}
]
tracks/objective-c/config.json
[
{
"difficulty": 5,
"slug": "bracket-push",
"topics": [
"Strings",
"Conditionals",
"Looping"
]
}
]
tracks/ocaml/config.json
[
{
"slug": "bracket-push",
"difficulty": 4,
"topics": [
"Stacks"
]
}
]
tracks/rust/config.json
[
{
"slug": "bracket-push",
"difficulty": 4,
"topics": [
"From trait",
"stack or recursion"
]
}
]
tracks/swift/config.json
[
{
"difficulty": 7,
"slug": "bracket-push",
"topics": [
"Parsing",
"Strings"
]
}
]
There was a problem hiding this comment.
In that case, I'll include Stack in the list of topics and increase its difficulty to 5. I agree it shouldn't go any higher than that.
There was a problem hiding this comment.
OK.
The only other exercise I can think of that would get Stack in its topic list at the same time would be forth.
f0df545 to
7539199
Compare
| ] | ||
| }, | ||
| { | ||
| "slug": "bracket-push", |
There was a problem hiding this comment.
It's true that once one realizes one can use a stack, it is easy. So the hard part is not writing the implementation. It is figuring out how to tackle the problem at all.
Because of this, I would actually rate higher, maybe 4 or 5.
If it helps to see how other tracks rated it:
for i in tracks/*/config.json; do echo $i; jq 'if any(.exercises[]; .difficulty != 1) then .exercises | map(select(.slug == "bracket-push")) else [] end' < $i; done
tracks/ceylon/config.json
[
{
"slug": "bracket-push",
"difficulty": 6,
"topics": [
"Parsing",
"Stacks",
"Strings"
]
}
]
tracks/csharp/config.json
[
{
"slug": "bracket-push",
"difficulty": 5,
"topics": [
"Parsing",
"Strings"
]
}
]
tracks/elixir/config.json
[
{
"slug": "bracket-push",
"difficulty": 3,
"topics": []
}
]
tracks/fsharp/config.json
[
{
"slug": "bracket-push",
"difficulty": 7,
"topics": [
"Parsing",
"Strings"
]
}
]
tracks/java/config.json
[
{
"slug": "bracket-push",
"difficulty": 5,
"topics": []
}
]
tracks/lua/config.json
[
{
"slug": "bracket-push",
"difficulty": 5,
"topics": [
"stacks",
"strings",
"algorithms",
"control-flow (if-else statements)",
"control-flow (loops)"
]
}
]
tracks/objective-c/config.json
[
{
"difficulty": 5,
"slug": "bracket-push",
"topics": [
"Strings",
"Conditionals",
"Looping"
]
}
]
tracks/ocaml/config.json
[
{
"slug": "bracket-push",
"difficulty": 4,
"topics": [
"Stacks"
]
}
]
tracks/rust/config.json
[
{
"slug": "bracket-push",
"difficulty": 4,
"topics": [
"From trait",
"stack or recursion"
]
}
]
tracks/swift/config.json
[
{
"difficulty": 7,
"slug": "bracket-push",
"topics": [
"Parsing",
"Strings"
]
}
]
| @@ -0,0 +1,36 @@ | |||
| module BracketPush (isPaired) where | |||
There was a problem hiding this comment.
I would just call the module Brackets. the Push is too much of an implementation detail and I don't even think it should go in the name: exercism/problem-specifications#693
I would maybe call the function arePaired so that can read like Brackets.arePaired, and this makes sense since it handles multiple brackets not just one pair.
| @@ -0,0 +1 @@ | |||
| resolver: lts-8.6 | |||
There was a problem hiding this comment.
same q as #511 (comment) - same across all exercises, or allow to be different?
|
|
||
| -- Test cases adapted from | ||
| -- `exercism/x-common/exercises/bracket-push/canonical-data.json` | ||
| -- on 2017-03-29. |
There was a problem hiding this comment.
same q as #511 (comment) - how should we put the version in here?
|
thanks for the feedback @petertseng, they have been addressed. |
|
I think this will be ready if we make the Stack version uniform. |
5792a9c to
337c2a9
Compare
d31e019 to
e94cc6f
Compare
e94cc6f to
7246fd5
Compare
Port Bracket Push to the Haskell Track.
For the Example Solution, I tried to explore Data constructors and the Maybe type.