exercism / fortran

Exercism exercises in Fortran.
https://exercism.org/tracks/fortran
MIT License
23 stars 30 forks source link

Fix matrix exercise according to issue #170 #174

Closed pclausen closed 2 years ago

pclausen commented 2 years ago

Fix matrix exercise according to issue #170

The row/columns where switched.

zmoon commented 2 years ago

Hi @pclausen. I think r and c of the stub (matrix.f90) are good to go with this change to the tests, but the m still needs its dimension and I would vote to remove the A declaration since it isn't part of the result or argument.

zmoon commented 2 years ago

I think r and c of the stub (matrix.f90) are good to go with this change to the tests, but the m still needs its dimension and I would vote to remove the A declaration since it isn't part of the result or argument.

@pclausen, from what I can see, these haven't yet been addressed, matrix.f90 doesn't seem to have been changed.

pclausen commented 2 years ago

@zmoon OK, I think I was a bit too fast and did not read your comments carefully enough.

but the m still needs its dimension

I guess I am not sure what you are hinting at here. Do you suggest a solution without giving m a dimension ie removing m_dim? I have not thought too much about it but it seems to complicate this exercise more than necessary but maybe that is because I am missing an obvious solution.

Could you share what you think the solution should be to this problem ?

zmoon commented 2 years ago

Sorry @pclausen, what I meant was that the m input has character(len=*) only in its declaration, it doesn't have dimension(:) like the example (.meta/example.f90) does, marking it as an array.

Edit: I guess dimension(m_dim(1)) could be used even for m.

I don't suggest removing m_dim. I think that providing m_dim and providing m as an array of strings instead of a single string allows the problem to stay firmly in the "easy" category, which I think it is meant to be, having done this problem in other tracks.

And then my other comment was to remove to A declaration in matrix.f90. I think providing the declarations for the arguments and result only keeps it cleaner.