Results 1 to 4 of 4
  1. #1
    coyne20 is offline Member
    Join Date
    Feb 2009
    Posts
    20
    Rep Power
    0

    Default Problem design issue

    I am rather unsure as to how to go about starting this problem so here goes:

    1. I need to design and develop a Java package that can analyze arbitrary-sized Bliffoscope images,
    returning a list of targets found. Each target found should include the target type
    found (starship or slime torpedo), the coordinates of the target on the Bliffoscope data,
    and some indication of your confidence in the target detection.

    2. Design and write test code that submits the test data to your package and prints the
    results returned by your package.

    So far I have written code to load in the attached files to create a 2d array as shown below:

    Java Code:
    import java.io.*; 
    import java.util.*; 
      
    public class SlimeTorpedo { 
        public static void main(String[]args) { 
            File file = new File("SlimeTorpedo.txt"); 
            ArrayList<String> arrayList = new ArrayList<String>(); 
            try { 
                //reads each line from the text file and places it into a string array 
                BufferedReader br = new BufferedReader(new FileReader(file)); 
                String str; 
                while ((str = br.readLine()) != null) { 
                    arrayList.add(str); 
                } 
                  
                //creates a stringFormat array and places the strings in the array list onto the stringFormat array 
                String stringFormat[] = new String[arrayList.size()]; 
                arrayList.toArray(stringFormat); 
                  
                //creates 2d char array and writes the characters from the stringFormat array onto the 2d char array 
                char charFormat[][] = new char[stringFormat.length][]; 
                for (int i = 0; i < stringFormat.length; i++) { 
                    charFormat[i] = stringFormat[i].toCharArray(); 
                } 
                  
                //for testing purposes, prints the 2d charFormat array 
                for (int i = 0; i < stringFormat.length; i++) { 
                    for (int j = 0; j < charFormat[i].length; j++) { 
                        System.out.print(charFormat[i][j]); 
                    } 
                    System.out.println(""); 
                } 
            }  
            catch (FileNotFoundException ex) { 
                ex.printStackTrace(); 
            }  
            catch (IOException ex) { 
                ex.printStackTrace(); 
            } 
        } 
    }
    How do I go about matching the 2d char array of both the slime torpedo and starships to the data within the test file?
    Attached Files Attached Files

  2. #2
    matrix123 is offline Member
    Join Date
    Mar 2012
    Posts
    1
    Rep Power
    0

    Default Re: Problem design issue

    I am new to this forum and was generally browsing and saw this question. This is an interesting problem. Were you able to solve it?

  3. #3
    karthickjo is offline Member
    Join Date
    Oct 2012
    Posts
    2
    Rep Power
    0

    Default Re: Problem design issue

    did you already find answers for this? it is interesting one..if you find the answers, could you pls share to me or in this forum?

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: Problem design issue

    Don't post to old dead threads, and don't hijack another poster's thread. When you have a question, start a new thread.

    db

    THREAD CLOSED
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Overriding methods - design problem
    By viking90 in forum New To Java
    Replies: 1
    Last Post: 03-23-2011, 10:13 PM
  2. Design Problem
    By crystalClear in forum Advanced Java
    Replies: 3
    Last Post: 02-09-2011, 01:02 PM
  3. Netbeans 6.8 GUI design problem
    By newbiejava in forum NetBeans
    Replies: 0
    Last Post: 01-14-2010, 03:02 AM
  4. Java Design Problem
    By hencre in forum Advanced Java
    Replies: 2
    Last Post: 02-25-2009, 08:08 AM
  5. Design Issue
    By naveenmails in forum Advanced Java
    Replies: 3
    Last Post: 07-29-2008, 04:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •