Monday, 23 December 2013

GJFLDKSJFLKDSJF

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.

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. 

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:


  1. 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? 
  2. 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! 

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.

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

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.

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.

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 >_<

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 >.<

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.

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 :)

Saturday, 30 November 2013

Uh oh.

I've run into the hardest part of checkers: the recursion. I understand backtracking algorithms and how it works, and I can see how it applies to Checkers, but I don't know how it would apply to the other user. In other words, I know how I can do it for the computer playing, but in order to judge how well the user move is, that, I'm not to sure yet.

For one, I do know that I need to make a two dimensional array rather than one long one dimensional array because I'm going to have to change the coordinates constantly.

As Ryk suggested, the -1 could represent that after a move, where the computer would be at a disadvantage because the player could move the pawn and eat it.

A 0 could represent one possible jump.

And just like the backtracking maze, that's a similar outcome.

I'm still not too sure how to find out whether the user is going to eat the computer if I move to a certain spot.

Friday, 22 November 2013

Pawns Finished (black)

I mean, it isn't the best photo-shop. It's going to be relatively small on the screen, so I am not too too worried about the "ugliness" or the "prettyness" of the photo-shop. But hey, at least Harry's head is on there :) 

And then of course, you must not forget about Voldemort! They are fighting...in a game of checkers :( Unfortunately it isn't Ron and the Chess Set, but hey. It's fandom related.


Wednesday, 20 November 2013

Colour Change and Board

This is colour coded based on what square the board is on. The numbers are just for future reference, where I can find which numbers will be blue and which numbers will be purple...

The index numbers on each of the squares.
Well if you haven't yet noticed, yeah. My board will be blue and purple. Specifically light blue and light purple! You see, that's just the lives of teenagers these days. Bright and flashy colours. If I had to choice, don't worry, I would do neon green and neon yellow. But I suspect my teacher will slightly hate me for it, so I won't put him through that misery. Otherwise he might be harder in marking. Trust me though, after it's done, I'll temporary change it to neon colours to see just how well it looks. I look forward to seeing the final result. But this...this is only the beginning....

So I've programmed the board (LOL). It looks almost too girlish. I'll debate on changing it later. It's just a matter of taking the default square in pages and changing the colour then changing one little line of code which isn't too too hard to do.
This is what the board currently looks like. Yeah, I know. So much blue and purple but the colour can always change later, haha :) 

From what I understand....

From what I half understand...is that I have to use recursion to check the "good" moves in the coding. So if one move is good, then it can be assigned a value of something 0-3 determining which is the best move to play.

Constant Declarations:

0: There's nowhere to move.
1: MOOOVEE! Otherwise the opponent is going to take your pawn!
2: Computer's move doesn't accomplish anything because the player can take your pawn.
3: Computer's move will take one opponent's pawn.
4: Computer's move can take 2 opponent pawns.
5: Get to the end of the board and become a king!

In terms of whether they can move backwards or forwards, that depends on whether they are pawns or kings.

Anyways, I'm going to start making the board really wacky. I should start on editing the pawns (listed on the first post). I guess I'll start with a normal black and red one, and the pawns will be unique...I think that's a decently okay idea. I mean, I hope it's creative enough and more "me" enough.

FANDOMS :)

Friday, 15 November 2013

Check! Check!

Okay. So I've finally chosen +Vivian Luu!

Anyways, I'm going to program a game of checkers in java. But it's not going to be your normal little checker game. Given the name, it has to be fandom related, eh?? So this is what I'm thinking. The tiles will not  be red and black. That's boring.

But in terms of the little red and black pieces, you'll have a choice between:

1. Merlin vs Morgana (Merlin BBC)
2. Harry Potter vs Voldemort (Harry Potter)
3. Sherlock vs Moriarty (Sherlock BBC)
4. Percy Jackson vs Kronos (Percy Jackson)
5. Peter Bishop vs Observers (Fringe)
6. Temperance Brennan vs Christopher Pelant (Bones)

^I will add 1 or 2 to that through the course of the programming thing.

Anyways, going to start at the flowchart :D