Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7782845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:40:04+00:00 2026-06-01T19:40:04+00:00

basically what i am trying to do is to set each spot in my

  • 0

basically what i am trying to do is to set each spot in my maze to a specific enumerated type based on a random number i.e i randomly place 10 walls on the maze and those 10 spaces would be wall enum types. This is the code i have so far, and i cant figure out how to get it to work.

public enum CellType {
   CHEESE, OPEN, WALL, VISITED, MOUSE
}

public class Cell {

private Color color;
private ImageIcon image;
CellType type;


public Color getColor() {
    return color;
}
public void setColor(Color color) {
    this.color = color;
}
public ImageIcon getImage() {
    return image;
}
public void setImage(ImageIcon image) {
    this.image = image;
}
public CellType getType() {
    return type;
}
public void setType(CellType type) {
    this.type = type;
}

}

maze = new int[row][col];       
Random randomMaze = new Random();
for (int ran = 0; ran <= numWalls ; ran++)
    maze[randomMaze.nextInt(maze.length)][randomMaze.nextInt(maze.length)].setType(WALL);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:40:05+00:00Added an answer on June 1, 2026 at 7:40 pm

    maze should be a 2D array of Cells, not a 2D array of ints.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, I'm trying to create an object of unique objects, a set. I had
Basically, what I'm trying to do, is get the item ID, and set a
I'm trying to basically trying to separate a specific amount of text from the
I'm basically trying to do a dropdown jquery plugin. HTML <script type='text/javascript' src='script.js'></script> <div
Basically am trying to set a time and a date in PHP then set
I'm trying to create a GUI (WPF) Library where each (custom) control basically wraps
I have a list of events, these events are each of a specific type,
I'm trying to set up a social networking type of site, where users can
Suppose I want to create a set of observers based on type. That is
I'm trying to build a auto-logout function in a Django application. Basically, with each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.