Search found 137 matches

by Wesley
Sun 01 Nov, 2009 7:06 am
Forum: Programming Help
Topic: [Java] Minesweeper Concepts
Replies: 27
Views: 46531

Re: [Java] Minesweeper Concepts

Okay, I am really having trouble getting the flooding to work. I keep trying and failing. I'm not sure where I'm fowling up. Does anyone think they can explain the algorithm under "Most practical implementations use a loop for the west and east directions as an optimization to avoid the overhea...
by Wesley
Fri 30 Oct, 2009 11:50 pm
Forum: Programming Help
Topic: [Java] Minesweeper Concepts
Replies: 27
Views: 46531

Re: [Java] Minesweeper Concepts

From what I 'think' I get is, if the user clicks on an empty space, then do I add the cells around it to a queue? Then, remove each cell from the queue and check if those cells are empty? Then, if they are, create a new queue? So am I right? If you (or anyone) want more details on that implementati...
by Wesley
Fri 30 Oct, 2009 8:30 pm
Forum: Programming Help
Topic: [Java] Minesweeper Concepts
Replies: 27
Views: 46531

Re: [Java] Minesweeper Concepts

Yes, that all makes sense. I've been learning about queues in my class for awhile now. I'm not sure how it would work in this program though. From what I 'think' I get is, if the user clicks on an empty space, then do I add the cells around it to a queue? Then, remove each cell from the queue and ch...
by Wesley
Fri 30 Oct, 2009 3:20 pm
Forum: Programming Help
Topic: [Java] Minesweeper Concepts
Replies: 27
Views: 46531

Re: [Java] Minesweeper Concepts

I guess that means that my Minesweeper implementations are wrong. Oh well. ;) I thought that might be possible ;) I can't see anything obviously wrong with your implementation of the flood-fill, other than it being very unfair on the stack. You'll need to switch to a queue-based method for anything...
by Wesley
Fri 30 Oct, 2009 12:54 pm
Forum: Programming Help
Topic: [Java] Minesweeper Concepts
Replies: 27
Views: 46531

Re: [Java] Minesweeper Concepts

Doh, I should've posted the code at the start. Here is my recursive method: public void floodFill(int row, int col) { if (!board[row][col].isEmpty()) return; //sides board[row+1][col].reveal(); board[row][col+1].reveal(); board[row-1][col].reveal(); board[row][col-1].reveal(); //corners board[row+1]...
by Wesley
Fri 30 Oct, 2009 2:35 am
Forum: Programming Help
Topic: [Java] Minesweeper Concepts
Replies: 27
Views: 46531

Re: [Java] Minesweeper Concepts

That's right! In Minesweeper, the corners also have to be checked, not just the west, east, north, and south. Hm... I did implement a method that uses a loop, but it doesn't work. It leaves cells covered that should be revealed. The reason why is because I am only making a single pass down the grid....
by Wesley
Thu 29 Oct, 2009 10:14 pm
Forum: Programming Help
Topic: [Java] Minesweeper Concepts
Replies: 27
Views: 46531

Re: [Java] Minesweeper Concepts

I got a little spare time and I quickly looked back at this project. I've come very far, but am having problems with flood fill. As for the uncovering algorithm, that can be performed using a flood fill . See, Java can't handle the recursion of that algorithm. That was a good link, by the way! I've ...
by Wesley
Wed 28 Oct, 2009 1:16 am
Forum: Staff Side Projects & Featured Projects
Topic: [Featured][Dev] F-Zero
Replies: 53
Views: 133941

Re: [Featured][Dev] F-Zero

That looks awesome! I really like the 3D implementation.
Maybe keep the splitscreen as an option (so you can choose to use splitscreen or not)?

Way to go calc84maniac!
by Wesley
Sat 10 Oct, 2009 12:02 am
Forum: Programming Help
Topic: Stack and Heap
Replies: 18
Views: 28245

Re: Stack and Heap

Oh, I'm not saying books are the only source of learning. The Internet has a plethora of free information as well as many other places. I was commenting on how much I like to learn. I love to read and bore into books and soak up material. (I also don't like reading on the computer all that much.) I ...
by Wesley
Fri 09 Oct, 2009 9:26 pm
Forum: Programming Help
Topic: Stack and Heap
Replies: 18
Views: 28245

Re: Stack and Heap

you're allowed to learn in your own time 100% agreed. When you graduate, your degree is just a nice piece of paper. Your portfolio is what really counts. Of course! It's just tough when you don't have much of "your own time". This is a crammed semester for me. I love to learn on my own th...
by Wesley
Fri 09 Oct, 2009 1:07 pm
Forum: Programming Help
Topic: Stack and Heap
Replies: 18
Views: 28245

Re: Stack and Heap

So.. you go to a Chinese college? :? I'm not sure what you mean... I was simply looking around for how Hirschberg solved the problem. I spent an awful long time reading other articles and trying to figure out the algorithm, but to no avail. Until, I found Hirschberg's paper. But, by the time I foun...
by Wesley
Fri 09 Oct, 2009 3:00 am
Forum: Programming Help
Topic: Stack and Heap
Replies: 18
Views: 28245

Re: Stack and Heap

So much for working ahead! My professor just posted Hirschberg's paper on his algorithm for computing the LCS. LCS is somewhat different from the Edit Distance problem, but the algorithm can be used in the same fashion. Why, oh why, must the diligent suffer!? See the article here . :cry: I'm kind of...
by Wesley
Wed 07 Oct, 2009 1:09 pm
Forum: Programming Help
Topic: Stack and Heap
Replies: 18
Views: 28245

Re: Stack and Heap

That's awesome and crazy all at the same time! I originally had the idea presented in the Hirschberg algorithm. I didn't think it would work. It's basically implementing the same thing as my second idea, the "Cell" objects, but with only the arrays and no "Cell"s. Great! I will g...
by Wesley
Wed 07 Oct, 2009 3:13 am
Forum: Programming Help
Topic: Stack and Heap
Replies: 18
Views: 28245

Re: Stack and Heap

Hmm... From what I'm finding, the Needleman-Wunsch algorithm seems to only compute in O(MN) (M and N being the size of the two strings being compared) time and takes up at least MN memory (depending on the type of objects being used). I'm not sure what more I can do. I guess I could use shorts or ev...
by Wesley
Wed 07 Oct, 2009 12:27 am
Forum: Programming Help
Topic: Stack and Heap
Replies: 18
Views: 28245

Re: Stack and Heap

King Harold, you are now on the same track as me. Wow. We are thinking the exact same thing! I am trying to implement dynamic programming. That's where my idea of the "Cell" objects comes in. Where each cell progressively has a path back to the beginning (or in this case the end of the str...