| Author |
Message |
|
|
Hi I am currently at College and want to learn how to create a Rubiks Cube solver in Java. Could anyone recommend a good book that could help me? I need it to solely focus on Matrix's and help me with matrix calculations. My knowledge and skill with Java is quite basic but I really would like to learn. I can see I would need to set up 6 separate matrices, each of them being a 3x3 representing each side of the cube. Then I would need to set up some kind of loop that would take the current state of the cube and solve it in the least amount of steps possible. If anyone could suggest a good book / learning resource or comment on my proposed method, that would be great.
Thanks in Advance
|
 |
|
|
|
oh sorry..lol..i duno what the whole stack trace is??..oh and yea the garage and car class are in the same file..im sure of it..shal i try n make a new file and copy and paste into the new1, would that help??..thnx
|
 |
|
|
|
ive wrote error where the errror message "identifier expected<identifier>" . its in the second chunk of code at the top in the fields list. i dont know what ive done wrong with the array??..and also i dont understand what you mean by the two classes are not in the same package??..cheers!!
|
 |
|
|
im really stuck on this, i was given 2classes, a car and garage..i wasnt allowed to change any method or field names i was only allowwed to alter the code in the brackets and i keep gettin errors..the two classes are shown below..can anyone see any problems??..it says "identifier expected<identifier>" for the field in the second class "Garage" called"private ArrayList<Car> cars;"
can anyone help me??..Thanks
|
 |
|
|
|
thanks for the help destin..your code was great..i learnt alot from it..thanks alot..i understand so much more now than before..!!..cheers!!
|
 |
|
|
|
cheers for the help Stdunbar..that kinda makes sense..im just guna keep reading thru ur answer and try and learn it properly..cheers
|
 |
|
|
destin wrote:Looks like you have a Vote class too, would you mind posting that? (and use
the code tags  )
|
 |
|
|
sorry, i forgot that..lol..ive posted it below now..thanks.
public class Vote {
private String voteID;
private boolean inFavour;
/**
* Constructor for objects of type vote.
* @param id the String identifier for this vote.
* @param inFavour true if the vote is in favour,
* false otherwise.
*/
public Vote(String id, boolean inFavour) {
this.voteID = id;
this.inFavour = inFavour;
}
/**
* Find out if the vote is in favour or not.
* @return true if the vote is in favour and false
* otherwise.
*/
public boolean isInFavour() {
return inFavour;
}
/**
* Get the value of voteID.
* @return value of voteID.
*/
public String getVoteID() {
return voteID;
}
}
|
 |
|
|
Can anyone help me with this..i have added the java documentation as a word file. i was given it and told to turn it into my own code and i have kind of above..lol.. but im still struggling and im not sure if what ive dun is ok??..can anyone help??..i think there should be some loops in there, i dnuo where or why??..lol..but i jus get the feeling ther should be..thanks.
|
 |
|
|
tfecw wrote:In the future it actual error messages are a useful thing to post, otherwise it's like bringing your car in and telling him to "Fix it" Sometimes he can see that you have a flat tire, but other times he's going to have to tear apart the engine and check everything to see the problem.
Luckily this time it seems you have a flat tire.
I'm not sure what you reasoning behind this line of code, but you are sort of on the right track.
Give that a shot, and let me know if you need a better explination!
Good Luck
sorry bout that, i was just eager to write my problem down and forgot to rite the error message..lol ..thanks for your help, it sorted my code out great!!..and il remember ur advice for next time.
|
 |
|
|
public void listNotes()
{
int index = 0; //could do this ....int indexB = notes.size();
while(index < notes.size()){
System.out.println(notes.get(index));
index++;
}
}
does anybody konw how to alter this code so that when it displays in the terminal window it will come up with the index number besides the note accompanying that specific note number??..i nkow at the moment only the note will print out but no index number..i tried to alter the code so it read
public void listNotes()
{
int index = 0; //could do this ....int indexB = notes.size();
while(index < notes.size()){
System.out.println(index+":")(notes.get(index));
index++;
}
}
but i just keep getting error messages with this??
|
 |
|
|
public Student(String fullName, String studentID)
{
if (fullName.length() >= 4)
{
name = fullName;
}
else
{
System.out.println ("name must b longer than 4 letters");
}
id = studentID;
credits = 0;
}
Thanks for your help mate, ive changed my code to this and YESSS it finally compiles..lol..thanks agen.
|
 |
|
|
stdunbar wrote:What isn't working for you? The code you provided looks like it should work with some minor changes. More information will help us to help you.
it keeps saying "else without if"??..but ive got else and if??..i was just tryin to do sum exercises from my book but couldnt get past this question.
|
 |
|
|
public Student(String fullName, String studentID)
{
if (fullName.length() >= 4);
{
name = fullName;
}
else
{
System.out.println ("name must b longer than 4 letters");
}
id = studentID;
credits = 0;
}
[edit = destin]
bleh! i hit edit instead of quote by accident! i'm so sorry... i tried to put up what you (sufs200) had.. sorry ... i will make sure to never do this again
|
 |
|
|