Skip to content

[WIP] queen-attack: use Algebraic Notation for coordinates? #446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

jtigger
Copy link
Contributor

@jtigger jtigger commented Nov 11, 2016

(this PR is not intended to be merged, but start a conversation; additional changes edits to the README would be required to make this edit complete)

Typically, chess coordinates are expressed in AN. Wouldn't it add some flavor to this exercise to use that notation?

Doing so...

  • ups the fun factor 🎉 by increasing the depth of the exercise by pulling concepts from the domain of the problem space;
  • makes the exercise slightly more challenging 💪 ;
  • with numeric tuples, it's really easy to slip into primitive obsession (passing around arrays of integers, for example) — by using AN, it's easier to make the "argument" to address that code smell 🐽 .

Typically, chess coordinates are expressed in [AN](https://en.wikipedia.org/wiki/Algebraic_notation_(chess)).  Wouldn't it add some flavor to this exercise to use that notation?

Doing so...
- ups the fun factor 🎉  by increasing the depth of the exercise by pulling concepts from the domain of the problem space;
- makes the exercise slightly more challenging 💪  ;
- with numeric tuples, it's really easy to slip into [primitive obsession](http://wiki.c2.com/?PrimitiveObsession) (passing around arrays of integers, for example) — by using AN, it's easier to make the "argument" to address that code smell 🐽 .
@rbasso
Copy link
Contributor

rbasso commented Nov 11, 2016

I think that queen-attack used an unfortunate indexing system, as I already pointed out in #313 (comment), so I think that it deserves to be updated.

At least, we need to change the indexing system to be (1,1) based, right-up oriented, to match chess, but I'm still uncertain about if using chess notation in a string would be putting to much in a single exercise.

If all the exercises involve parsing, we dilute what makes each one of them interesting, so I'm usually against mixing too many things in the same problem. I believe that the problems should be short and focused, this way they don't get tiring and boring.

Maybe it is OK in this case, because it is related to chess anyway. I don't know...

Taking the opportunity to discuss another thing in the test suite, the create section has an interesting description:

Test creation of Queens with valid and invalid positions

It seems that this was written with OOP in mind. What is being created

@Insti
Copy link
Contributor

Insti commented Nov 12, 2016

I am in favour of using chess co-ordinates.

Reasoning:

  • This is phrased as a chess problem.
  • Working out if the queen is on the board is irrelevant to the problem.
  • Which way the board/co-ordinates are oriented is irrelevant to the problem.
  • We could add a different problem 'chess-co-ordinates' that is a simple one to handle
    algebraic notation mappings that the student will have encountered before reaching this problem.

Additional proposal:

  • Remove co-ordinate validation checks from the test cases.

@jtigger
Copy link
Contributor Author

jtigger commented Nov 20, 2016

@rbasso said:

Taking the opportunity to discuss another thing in the test suite, the create section has an interesting description:

Test creation of Queens with valid and invalid positions

It seems that this was written with OOP in mind. What is being created ❓

... and @Insti replied:

Working out if the queen is on the board is irrelevant to the problem.

👍

},
"expected": -1
},
{
"description": "queen must have positive file",
"queen": {
"position": "(2,-2)"
"position": "_3"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not represent a negative file.

@IanWhitney
Copy link
Contributor

I would like us to think about the complexity we're adding to the problem by making this change.

  • Instead of checking numbers students will now parsing & validating a string.
  • Instead of math boundaries for ranks students are now checking presence of a char.
  • Instead of math for diagonal checking, students are (probably) converting chars to integers and doing math

Which, fine, if there's some benefit to it. But I don't see what the benefit is beyond "It makes it more chess like." It certainly gives the students more things to do, but I don't think it makes the problem any better.

I don't think verisimilitude should be our goal in these problems. If making the problem more realistic makes the learning experience better, then I'm all for it. But I don't see it here.

@jtigger
Copy link
Contributor Author

jtigger commented Dec 26, 2016

I don't think verisimilitude should be our goal in these problems. If making the problem more realistic makes the learning experience better, then I'm all for it. But I don't see it here.

Yeah, well put, @IanWhitney... we don't want difficulty for difficulty's sake; that's just annoying. Having had a chance to go away and come back to the idea, I see how the added requirement would likely just layer on more work, not change the solution fundamentally. That is, practitioners would probably just have to do the work to interpret the AN into integer tuples and then everything would remain the same.

Thanks for the discussion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants