Difference between revisions of "Computer Science/61b/Homework/hw9/MazeTest.java"

From lensowiki
< Computer Science‎ | 61b‎ | Homework‎ | hw9
Jump to: navigation, search
 
(No difference)

Revision as of 06:00, 14 November 2010

This page contains computer code. Unlike all articles on the lensowiki, which are released under the GFDL, this code is released under the GPL.

Copyright 2006, 2007 Paul Borokhov. All rights reserved.

This code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

The code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

//  MazeTest.java
//  
//
//  Created by Paul Borokhov on 11/24/06.
//  Copyright 2006 Paul Borokhov. All rights reserved.
//

public class MazeTest {
	public static void main(String[] args) throws Exception {
		int i1;
		int i2;
		for (int i=0; i<10000000; i++) {
			i1 = ((int) (Math.random() * 10.0)) * ((int) (Math.random() * 10.0)) + 2;
			i2 = ((int) (Math.random() * 10.0)) * ((int) (Math.random() * 10.0)) + 2;
			Maze maze = new Maze(i1, i2);
			System.out.println("Testing maze dimension " + i1 + " by " + i2 + ", iteration " + i);
			maze.diagnose();
		}
	}
}