Fix Unix folder bug

pull/1/head
Yong Zhu 5 years ago
parent ce65e3da5f
commit c0012ed968

@ -21,12 +21,13 @@ public class Application {
static { static {
String classpath = new File("").getAbsolutePath(); String classpath = new File("").getAbsolutePath();
int core = classpath.indexOf("\\frog\\"); int i = classpath.indexOf("\\frog\\");
if (core > 0) if (i > 0)
CLASSPATH = classpath.substring(0, core) + "\\frog\\"; CLASSPATH = classpath.substring(0, i) + "\\frog\\";// windows
else else
CLASSPATH = classpath.substring(0, core) + "/frog/"; // UNIX CLASSPATH = classpath + "/"; // UNIX
} }
public static JFrame mainFrame = new JFrame(); public static JFrame mainFrame = new JFrame();
public static Env env = new Env(); public static Env env = new Env();
public static BrainPicture brainPic = new BrainPicture(Env.ENV_WIDTH + 5, 0, Env.FROG_BRAIN_XSIZE, public static BrainPicture brainPic = new BrainPicture(Env.ENV_WIDTH + 5, 0, Env.FROG_BRAIN_XSIZE,

Binary file not shown.

@ -11,11 +11,11 @@ public class Application {
public static final String CLASSPATH; public static final String CLASSPATH;
static { static {
String classpath = new File("").getAbsolutePath(); String classpath = new File("").getAbsolutePath();
int core = classpath.indexOf("\\frog\\"); int i = classpath.indexOf("\\frog\\");
if (core > 0) if (i > 0)
CLASSPATH = classpath.substring(0, core) + "\\frog\\"; CLASSPATH = classpath.substring(0, i) + "\\frog\\";// windows
else else
CLASSPATH = classpath.substring(0, core) + "/frog/"; // UNIX CLASSPATH = classpath + "/"; // UNIX
} }
public static JFrame mainFrame = new JFrame(); public static JFrame mainFrame = new JFrame();

@ -20,11 +20,11 @@ public class Application {
static { static {
String classpath = new File("").getAbsolutePath(); String classpath = new File("").getAbsolutePath();
int core = classpath.indexOf("\\frog\\"); int i = classpath.indexOf("\\frog\\");
if (core > 0) if (i > 0)
CLASSPATH = classpath.substring(0, core) + "\\frog\\"; CLASSPATH = classpath.substring(0, i) + "\\frog\\";// windows
else else
CLASSPATH = classpath.substring(0, core) + "/frog/"; // UNIX CLASSPATH = classpath + "/"; // UNIX
} }
public static JFrame mainFrame = new JFrame(); public static JFrame mainFrame = new JFrame();
public static Env env = new Env(); public static Env env = new Env();

@ -22,11 +22,11 @@ public class Application {
static { static {
String classpath = new File("").getAbsolutePath(); String classpath = new File("").getAbsolutePath();
int core = classpath.indexOf("\\frog\\"); int i = classpath.indexOf("\\frog\\");
if (core > 0) if (i > 0)
CLASSPATH = classpath.substring(0, core) + "\\frog\\"; CLASSPATH = classpath.substring(0, i) + "\\frog\\";// windows
else else
CLASSPATH = classpath.substring(0, core) + "/frog/"; // UNIX CLASSPATH = classpath + "/"; // UNIX
} }
public static JFrame mainFrame = new JFrame(); public static JFrame mainFrame = new JFrame();
public static Env env = new Env(); public static Env env = new Env();

@ -22,11 +22,11 @@ public class Application {
static { static {
String classpath = new File("").getAbsolutePath(); String classpath = new File("").getAbsolutePath();
int core = classpath.indexOf("\\frog\\"); int i = classpath.indexOf("\\frog\\");
if (core > 0) if (i > 0)
CLASSPATH = classpath.substring(0, core) + "\\frog\\"; CLASSPATH = classpath.substring(0, i) + "\\frog\\";// windows
else else
CLASSPATH = classpath.substring(0, core) + "/frog/"; // UNIX CLASSPATH = classpath + "/"; // UNIX
} }
public static JFrame mainFrame = new JFrame(); public static JFrame mainFrame = new JFrame();
public static Env env = new Env(); public static Env env = new Env();

@ -21,11 +21,11 @@ public class Application {
static { static {
String classpath = new File("").getAbsolutePath(); String classpath = new File("").getAbsolutePath();
int core = classpath.indexOf("\\frog\\"); int i = classpath.indexOf("\\frog\\");
if (core > 0) if (i > 0)
CLASSPATH = classpath.substring(0, core) + "\\frog\\"; CLASSPATH = classpath.substring(0, i) + "\\frog\\";// windows
else else
CLASSPATH = classpath.substring(0, core) + "/frog/"; // UNIX CLASSPATH = classpath + "/"; // UNIX
} }
public static JFrame mainFrame = new JFrame(); public static JFrame mainFrame = new JFrame();
public static Env env = new Env(); public static Env env = new Env();

Loading…
Cancel
Save