Hi Matt,
No, in this sense I meant the maths construct (
vector), i.e. a value (such as velocity) that has direction and magnitude, as oppoise to a normal value (such as area) that has just magnitude and is a scalar value.
I would expect this to be a GCSE maths questions, so yes I would assume this is ok for high school. Do'nt know if kids learn programming at GCSE level here, so cant say if its a high school computing question.
However, in answer to your question Vectors are pretty much the same as ArraList, only Vectors are syncronised and thus considered
thread safe. This increases their access time.
If we ignore the puntuation marks, this can be done without any data sturtures, and in fact you could probably do this using recursion so would not require any loops.
What I did was to convert the numerical value of the number to a cell value in the grid, and use that cell value to compute the co-ordinates then work out the vectors. Now you could just go stright from the numerical value of the number to the vectors, but that makes the maths look a lil untidy to my mind.
Here is my code:
Glad you found a solution.
Gavin
PS, the instance variable _gridSize represents the size of teh grid in the x axis, I think this is because we are moving in the X direction as we build our grid, so if we had two long columns rather then a square (ish) grid we would have a _gridSize of 2... I think.
[ March 03, 2008: Message edited by: Gavin Tranter ]
[ March 03, 2008: Message edited by: Gavin Tranter ]
[ March 03, 2008: Message edited by: Gavin Tranter ]
[ March 03, 2008: Message edited by: Gavin Tranter ]