
December 25th, 2012, 04:18 AM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 12
Time spent in forums: 2 h 2 m 47 sec
Reputation 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 05:37 AM.
Reason: wrap in code tags
|