Aria Villano wrote:. . . . Could I just make an int array to store the coordinates?
I am afraid I think that means over‑specifying the assignment; I also think restricting you to two classes forces you into poor design.. . . it's required to only have 2 classes. . . .
If the user enters the board dimensions at runtime, how can you say that?Aria Villano wrote:And the file won't have coordinates that are not on the grid.
Why? That sounds weird; you are given ints for your locations. That sounds like making things more complicated than they have to be.Aria Villano wrote:. . . I used a char array . . .
No. The more arrays you have the more can go wrong. You do not need to store space characters; you simply need to display them. Work out how to take an array and display a space if the element is 0/false. Maybe you can find a Unicode character for a bee and display that insteadAria Villano wrote:. . . . So should I make a third array that's of type int?
As a thread discussion continues it is often necessary to repost your code to make sure everyone's in sync again.Aria Villano wrote:I basically did what you did except I have: ...
You and Carey have both demonstrated how easy it is to get confused with multiple arrays and their indicesCarey Brown wrote:Sorry, I swapped the x and y . . .
That worries me; each additional array constitutes an opportunity for something to go wrong.. . . . . .
That's a pleasureCampbell - Thanks . . .
Those who dance are thought mad by those who hear not the music. This tiny ad plays the bagpipes:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
|