Current Forum: Homework 2 Forum |
Date: Fri Sep 21 2001 6:01 pm |
Author: Zaman, Rashid <rzaman@andrew.cmu.edu> |
Subject: Exception for Rows=1 or Columns=1 |
|
|
I am able to create mazes but when I set rows or colums to 1 then I get the following: Exception occurred during event dispatching: java.lang.IllegalArgumentException: n must be positive at java.lang.Throwable.fillInStackTrace(Native Method) at java.lang.Throwable.fillInStackTrace(Compiled Code) at java.lang.Throwable.(Compiled Code) at java.lang.Exception.(Compiled Code) at java.lang.RuntimeException.(RuntimeException.java:47) at java.lang.IllegalArgumentException.(IllegalArgumentException.java:43) at java.util.Random.nextInt(Compiled Code) at MazeCreator.getDestroyedList(Compiled Code) at MazeApplet.generateMaze(MazeApplet.java:22) at MazeApplet$1.actionPerformed(MazeApplet.java:60) at java.awt.Button.processActionEvent(Button.java:308) at java.awt.Button.processEvent(Compiled Code) at java.awt.Component.dispatchEventImpl(Compiled Code) at java.awt.Component.dispatchEvent(Compiled Code) at java.awt.EventQueue.dispatchEvent(Compiled Code) at java.awt.EventDispatchThread.pumpOneEvent(Compiled Code) at java.awt.EventDispatchThread.pumpEvents(Compiled Code) at java.awt.EventDispatchThread.run(EventDispatchThread.java:83)
My code works for all other maze dimensions. Is this ok and/or any suggestions on what's wrong? |
|