CS代写 https://powcoder.com

专业留学生程序代写


代写代考加微信 powcoder
Assignment Project Exam Help
Add WeChat powcoder

Copyright By PowCoder代写 加微信 powcoder

package Maze;

* Class that solves maze problems with backtracking.
* @author Koffman and Wolfgang
public class Maze implements GridColors {

/** The maze */
private TwoDimGrid maze;

public Maze(TwoDimGrid m) {

/** Wrapper method. */
public boolean findMazePath() {
return findMazePath(0, 0); // (0, 0) is the start point.

* Attempts to find a path through point (x, y).
* @pre Possible path cells are in BACKGROUND color;
* barrier cells are in ABNORMAL color.
* @post If a path is found, all cells on it are set to the
* PATH color; all cells that were visited but are
* not on the path are in the TEMPORARY color.
* @param x The x-coordinate of current point
* @param y The y-coordinate of current point
* @return If a path through (x, y) is found, true;
* otherwise, false
public boolean findMazePath(int x, int y) {
// COMPLETE HERE FOR PROBLEM 1
return false;

// ADD METHOD FOR PROBLEM 2 HERE

// ADD METHOD FOR PROBLEM 3 HERE

/**/
public void resetTemp() {
maze.recolor(TEMPORARY, BACKGROUND);
/*
*/

/**/
public void restore() {
resetTemp();
maze.recolor(PATH, BACKGROUND);
maze.recolor(NON_BACKGROUND, BACKGROUND);
/*
*/
/**/

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com