I'm so out of ideas. I'm just owiereiwonvsvksjlfkjdslkfjlskjf;alnvsldk.
I know how to solve the maze, and I wrote an entirely functional program, but it doesn't use recursion to solve it, and I'm just slightly, just slightly freaking out because after all the time, I don't know what's wrong with it.
Monday, 23 December 2013
Sunday, 22 December 2013
Thank you thank you thank you
This should have been posted yesterday, but a day late isn't bad.
So yeah...
Anyways, Ryk helped a lot with the creation of the maze...like that's even an understatement. I don't even..yeah. That is an understatement! He helped debug it and determine what was wrong with it.
I found a way to display the exits, and I know how to do that, but it isn't using recursion. So I'm trying a different technique now.
I found a way to display the exits, and I know how to do that, but it isn't using recursion. So I'm trying a different technique now.
Wednesday, 18 December 2013
Maze now creates itself!
Finally found out how to make the maze create itself..like this:
So this bit creates the maze randomly. In another method, I will be adding walls in the most random places possible. I mean, definitely down all four sides, not including the exits and entrances. And then the program will use the algorithm that Ryk provided to go through the maze and solve it.
Have yet to do that one, but ...... done one part at least!
Tuesday, 17 December 2013
OHMIGAH!
Gosh, I've been a blatant idiot to attempt checkers all this time. I should have known I wouldn't be able to finish it. With all the other projects, I was able to push it. To keep think about it, and finally have it work, and it would be rewarding. And I do know how to do the Checkers, but it's just way too late.
I know how to do the maze, or in theory, I do. I know that I have to create the solution first, using a random count. And that would be done recursively, just calling the method sending different values, and randomly generating it so that it arrives to the exit. And then, I can create diversions, like random walls here and there, that block and have dead ends. And then when solving the maze, I can just use the algorithm on the D2l Website.
And then comes Minesweeper, which almost all my friends and most of the people who have graduated, have also done Minesweeper. Gosh. I don't want to change to that. That's just rushing it, but I have more people to ask questions.
No..but the maze..OH MY GOSH.
Sigh. I'll just spend the whole morning tomorrow doing this. I can't handle it right now..
Pseudocode
Okay, I'm sigh.. I don't know what to do anymore.
I've come up with many problems:
I've come up with many problems:
- How do you limit the number of moves it takes to get from entrance to exit? And if you don't, you would have to double the size of the array, but how do you make it to the set size?
- No matter what I put into the recursion, it's only running twice, someones three times at most. How the heck do I fix that?
And then another problem..which, yeah. Wait..no...if i reuse the method that I wrote for the solving of the maze, I would not have to OH MY GAWD I WOULDN'T...
OH MY GOSH I THINK I HAVE A SOLUTION!
DON'T BOTHER TRACKING AND REMEMBERING WHERE YOU WERE BEFORE! JUST ALLOW THE COMPUTER TO FIND THAT OUT LATTTEER!
Okai. Well, the computer only ran the method 3 times, but i guess that's an improvement..sigh. I don't know what to do!
OH MY GOSH I THINK I HAVE A SOLUTION!
DON'T BOTHER TRACKING AND REMEMBERING WHERE YOU WERE BEFORE! JUST ALLOW THE COMPUTER TO FIND THAT OUT LATTTEER!
Okai. Well, the computer only ran the method 3 times, but i guess that's an improvement..sigh. I don't know what to do!
Laa!
Hip hip hurray! I mean, it's not entirely done, but at least it's starting to come together. You can see that exit and the entrance, you can use it open spaces. Gosh, what an achievement! I just have to create the pathway, and the diverting routes
Monday, 16 December 2013
Pathway
Almost done creating the pathway, until constantly getting an OutOfBoundsException, which I don't know have any idea how to fix. Until tomorrow, then.
Ah well. Going to do other stuff now..get my mind off com pewter science and come back to it some time later. I bet it's just going to make so much sense later...it's always like that. Sigh.
Ah well. Going to do other stuff now..get my mind off com pewter science and come back to it some time later. I bet it's just going to make so much sense later...it's always like that. Sigh.
Maze
Okay. That's settled.
I do know how to do the Checkers thing now, it's just it's a bit late, LOL.
Anyways, maze. I guess I know how to program it. I mean, I do know how to program it. From what I understand, I have to create a pathway first, and then make the maze go around it and make little nooks and crannies here and there. And the walls will all be represented using "W" while all the open spaces will be underscores.
And then, comes the fun part, making an optical illusion so that the user can't find the solution! :D
I do know how to do the Checkers thing now, it's just it's a bit late, LOL.
Anyways, maze. I guess I know how to program it. I mean, I do know how to program it. From what I understand, I have to create a pathway first, and then make the maze go around it and make little nooks and crannies here and there. And the walls will all be represented using "W" while all the open spaces will be underscores.
And then, comes the fun part, making an optical illusion so that the user can't find the solution! :D
Sunday, 15 December 2013
Maze
Okay..well, I've done a small part of the maze, which is create the game board. After all this time. I still don't know how to make a maze with a valid solution, so I'm going to hold off. I'll start the solveMaze method, instead. And implement all the mouse listener things.
This honestly sucks...
Yeah. You know the time when you're so excited to take on something so challenging? I mean..like challenging as in no one has tried in 13 years?
Yeah. That kind.
It backfires badly. The assignment is due in 2 days, and I'm about to change my assignment to a recursive maze, when I don't even know what I'm doing...
I don't know how to make it so that it actually has a solution, or how to draw the little line things. I know how to solve it, but that's cause the teacher provided the solution so I'm very lenient to ask him for help in creating it. Man..this sucks. And right before the Christmas Break makes it even worse.
Yeah. That kind.
It backfires badly. The assignment is due in 2 days, and I'm about to change my assignment to a recursive maze, when I don't even know what I'm doing...
I don't know how to make it so that it actually has a solution, or how to draw the little line things. I know how to solve it, but that's cause the teacher provided the solution so I'm very lenient to ask him for help in creating it. Man..this sucks. And right before the Christmas Break makes it even worse.
Thursday, 12 December 2013
Phew...
Okay, I might actually have a functional idea right now: to use a recursive command instead of a recursive query where the program doesn't return anything, rather just completing an action.
In that case, I have an idea on how to do it, which is testing by if statements whether they have been kinged or not, and then testing whether they can go to the right or go to the left if that spot has not been taking out. And then, there's the jump, where the program will enter every time it can perform a jump.
The recursion will still keep going around until it reaches the end, or close to the end where that pawn's "possibleMoves" value will be determinant of how many jumps or spaces it can move. In another method, the greatest "possibleMoves" value will be compared, and the one that is the highest, the computer will perform the move.
In this case, the computer does not account for the possibility of the opponent eating the pawn, but that can be done with an if statement. That's if I'm doing this the right way, which I don't know if I am.
In that case, I have an idea on how to do it, which is testing by if statements whether they have been kinged or not, and then testing whether they can go to the right or go to the left if that spot has not been taking out. And then, there's the jump, where the program will enter every time it can perform a jump.
The recursion will still keep going around until it reaches the end, or close to the end where that pawn's "possibleMoves" value will be determinant of how many jumps or spaces it can move. In another method, the greatest "possibleMoves" value will be compared, and the one that is the highest, the computer will perform the move.
In this case, the computer does not account for the possibility of the opponent eating the pawn, but that can be done with an if statement. That's if I'm doing this the right way, which I don't know if I am.
Wednesday, 11 December 2013
So confused. So GAH.
I understand the algorithm of how to do it, and that makes like 100% of sense. Total sense. ALL OF IT MAKES SENSE.
But when it comes to programming it, I'm not too sure how to tackle it, cause the recursion should stop once it gets to the end of the board, but that's if I'm doing it for one pawn at a time.
If it isn't, then I can do a general recursion one for the pawns, and I think I would have if statements inside those ones (like saying "if the first pawn is not dead" perform the recursion on that pawn until it reaches the end. If it can only jump once, then the possibleMove for that pawn is 1; adding 1 each time each time that they can do a jump.
Right..but then how would you kill it when it gets to the end of the board? I kind of see where I'm going with this..but..you know. Still super confusing >_<
But when it comes to programming it, I'm not too sure how to tackle it, cause the recursion should stop once it gets to the end of the board, but that's if I'm doing it for one pawn at a time.
If it isn't, then I can do a general recursion one for the pawns, and I think I would have if statements inside those ones (like saying "if the first pawn is not dead" perform the recursion on that pawn until it reaches the end. If it can only jump once, then the possibleMove for that pawn is 1; adding 1 each time each time that they can do a jump.
Right..but then how would you kill it when it gets to the end of the board? I kind of see where I'm going with this..but..you know. Still super confusing >_<
Tuesday, 10 December 2013
AHHH!
Gaaah..I don't understand!
I had the 1D Array all perfect! Y'all saw the pretty one!
And then I converted it to a 2D array and it's killing me! LITERALLY! OH MY GOD IT DOESN'T EVEN LOOK LIKE A CHECKERS THING ANYMORE!
It's probably the most hideous thing that I've ever made in my life cause it only adds it 3 times! Rather than 9! And they aren't even the right colours! ONLY THREE!!
GAH. I'm just so confuzzled! :o
I just emailed the teacher who emailed me back pretty quickly, but one of the thingymabobbers has an error and I'm back to uh..very very confused >_<
I can see what I did wrong before, and that makes a whole lot of sense cause I put something in between two nested for loops when it was supposed to be inside both of them. Now that that has been completed, I'm still not sure what's wrong...at all! It should work, but now there's something wrong with squares[row].length, where there is an apparent boolean (where there isn't!). Gosh. This is really getting annoying.
I'm usually done the assignment and just testing it by now. Still programming it..a week before is going to kill me. I just want to test the 3x3, and then probably go up to 5x5, and maybe stop it at there. I mean, being the first person to try Checkers is cool, but also really hard.
OH MY GOD I JUST FOUND THE ANSWER. I MISSED 4 CHARACTERS..4 Characters! Ryk pulls his trick thing again >.<
I had the 1D Array all perfect! Y'all saw the pretty one!
And then I converted it to a 2D array and it's killing me! LITERALLY! OH MY GOD IT DOESN'T EVEN LOOK LIKE A CHECKERS THING ANYMORE!
It's probably the most hideous thing that I've ever made in my life cause it only adds it 3 times! Rather than 9! And they aren't even the right colours! ONLY THREE!!
GAH. I'm just so confuzzled! :o
I just emailed the teacher who emailed me back pretty quickly, but one of the thingymabobbers has an error and I'm back to uh..very very confused >_<
I can see what I did wrong before, and that makes a whole lot of sense cause I put something in between two nested for loops when it was supposed to be inside both of them. Now that that has been completed, I'm still not sure what's wrong...at all! It should work, but now there's something wrong with squares[row].length, where there is an apparent boolean (where there isn't!). Gosh. This is really getting annoying.
I'm usually done the assignment and just testing it by now. Still programming it..a week before is going to kill me. I just want to test the 3x3, and then probably go up to 5x5, and maybe stop it at there. I mean, being the first person to try Checkers is cool, but also really hard.
OH MY GOD I JUST FOUND THE ANSWER. I MISSED 4 CHARACTERS..4 Characters! Ryk pulls his trick thing again >.<
3x3
Well, according to my teacher, he said I should try the 3x3 checkers grid first (LOL), where only one jump is necessary. I'm still confused on how to do it, which is why I'm starting with the 3x3, and then going to 5x5, 6x6, and then 8x8.
First things first, I need to make my array 2 dimensional rather than 1 dimensional like the Jeopardy...
Second...making that array within a tiles class, and the pawn using a pawn class.
First things first, I need to make my array 2 dimensional rather than 1 dimensional like the Jeopardy...
Second...making that array within a tiles class, and the pawn using a pawn class.
Sunday, 8 December 2013
Pseudocode
I'm done!! I'm done! I'm done the pseudocode!
Okay, that doesn't even sound like a bit of an achievement, but it is for me! I'm happy I finally semi-know how to program it.
The rankings accommodate for the user's possible moves as well, finding out which pawn is the best to move. And that's only for the pawns, not for the kinged pawns. But oh well. I can hand it when I hand in the assignment.
I can totally start programming the pawn part! I'm actually super excited though :)
Okay, that doesn't even sound like a bit of an achievement, but it is for me! I'm happy I finally semi-know how to program it.
The rankings accommodate for the user's possible moves as well, finding out which pawn is the best to move. And that's only for the pawns, not for the kinged pawns. But oh well. I can hand it when I hand in the assignment.
I can totally start programming the pawn part! I'm actually super excited though :)
Subscribe to:
Comments (Atom)





