Thread: Help 2

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    12
    Rep Power
    0

    Help 2


    i have created another main class, but in this class i have to add tiles onto a grid by order, starting with top left hand corner and down to row by row.

    here is my code:

    Code:
    import java.util.Scanner;
    
    /**
     *
     * @author usmanm2
     */
    public class Main {
        static Scanner input;
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            input = new Scanner(System.in);
            int i, j;
            // TODO code application logic here
            EdgeMatch em = new EdgeMatch(5, 5, 10);
            //em.randomYesInstance();
            EdgeMatchSolution ems = new EdgeMatchSolution(em);
            
            EdgeMatchDisplay emd = new EdgeMatchDisplay(ems, 400, 400);
            emd.setVisible(true);
            
            input.next();
            ems.add(3, 3, 0);
            emd.repaint();
        }
        public static void addTiles(EdgeMatchSolution ems, int i, int j)
        {
            for(i = 0; i < 36; i++)
            {
                for (j = 0; j < 36; j++)
                    System.out.println(ems);
            }
        }
    }
    when compiled it shows the empty grid.
    Last edited by usman2; December 26th, 2012 at 06:37 AM. Reason: wrap in code tags
  2. #2
  3. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,724
    Rep Power
    348
    Please edit your post and wrap the code in code tags.
    Where is the CovUni package defined? The code can't be tested without it.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    12
    Rep Power
    0
    Each threads belong to different tasks.

IMN logo majestic logo threadwatch logo seochat tools logo