Angela Li

Greenhorn
+ Follow
since Nov 04, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Angela Li

thanks for making my code more concise, i was getting confused myself with all the if statements. It works now that I took your suggestion, thanks so much. I spent so long on this.
13 years ago
So, I expected the method to open up just the cell (x,y) if it is next to a mine so its not zero. But if it is zero or no mines are adjacent to it then I expect it to recursively open the cells around it. But the method is failing to recursively open.
13 years ago
This is my code for inspecting a cell in minesweeper, and it is not working as I had expected but I can't quite figure out what is wrong. Some help would be appreciated.
13 years ago
I'm writing minesweeper for class and we don't have to have a working GUI but we still need to have some type of grid that will show up on command prompt when the game is run. I am thinking about building a grid that will look something like this +-----+-----+
| X | X | for two cells. How should i design it so that i can connect the grid to my 2D arrays that represent what is inside the cell.
+-----+-----+
13 years ago

I can't get b to print out to be 32 and I keep getting 16.



I also tried this but it also didn't work.
13 years ago
I am trying to write a method that returns the list of factors when I input an integer.




When I run it using my main I get an error message:
Exception in thread "main" java.lang.ArithmeticException: / by zero
at QuadraticEqn.getIntegerFactors(QuadraticEqn.java:51)
at QuadraticEqn.main(QuadraticEqn.java:9)

What am I doing wrong?
13 years ago
Can you give me a suggestion on what to use besides a while loop?
13 years ago
I am writing a part of the craps game, and I am having trouble getting from the else loop to the while loop. My method just seems to ignore the while loop but I need the while loop to work.
13 years ago
Thanks Aniket, that was a stupid of me.
13 years ago
Thanks for the code suggestion, I appreciate it.
13 years ago
I'm suppose to write a class that asks for an int between one and five inclusive, then check if the int is really in the range, then use-- switch, case, break--to generate an appropriate message that corresponds with the number entered. And last return to the ask for int step.
This is what I have did so far but I am having trouble when I input an int inside the accepted range, it gives me the default.

13 years ago