• Post Reply Bookmark Topic Watch Topic
  • New Topic

Extracting elements from a 2D array in another class

 
Natasha Reaney
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure if anyone will be able to help me with this but I am completely stuck so I figured it is worth a shot...

I am writing a program for an assignment and one of the steps is to use the index variable (created under a method called NTS.mapLetterIndexOf) and the direction constants (WEST, EAST, NORTH and
SOUTH) (which I declared and created in a class called NTS) to extract an element from the 2D array into the Main class. My teacher provides this example for extracting: westMap = adjMapLetters[mapPosition][WEST]. Only I have tried that and it does not work. Here is most of the code:

Main.java:



NTS.java:


... other code...



I need to figure out how I can extract the element from the array in the NTS class into the Main class. Any thoughts?
It is this part of the code that doesn't work.

[/code]

Thank you!!!
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!