JavaRanch » Java Forums »
Java »
Beginning Java
| Author |
how to make this java code Random using OO?
|
Andres John
Ranch Hand
Joined: Jun 07, 2012
Posts: 33
|
|
the prof is asking me to do this
Create an alternate KtR that solves knight's tour problem for an 8 by 8 board by randomly picking a move from 0 to 7 and if legal make the move. If not legal, try doing this 100 times and if no legal moves after 100 tries abort the game as a failure.
If you make 64 moves print the board.
i modify the the start method instead of giving the number in sequence it will random some the sequence number, but other two questions im not sure about it
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 10032
|
|
Hello and welcome to the ranch.
My guess is you won't get much help with a post like that. You may want to take a few minutes and read our HowToAskQuestionsOnJavaRanch FAQ. Generally speaking, broad questions don't get near the help of specific, focused questions.
Your post basically reads as "Please do my homework for me", which most folks find off-putting - especially with over 200 lines of code. Kudos on using code tags on your first post - that does help a LOT, but I think your question is a little broad.
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
Andres John
Ranch Hand
Joined: Jun 07, 2012
Posts: 33
|
|
fred rosenberger wrote:Hello and welcome to the ranch.
My guess is you won't get much help with a post like that. You may want to take a few minutes and read our HowToAskQuestionsOnJavaRanch FAQ. Generally speaking, broad questions don't get near the help of specific, focused questions.
Your post basically reads as "Please do my homework for me", which most folks find off-putting - especially with over 200 lines of code. Kudos on using code tags on your first post - that does help a LOT, but I think your question is a little broad.
i already what it said in HowToAskQuestionsOnJavaRanch thank for the link
it my first time using the this link
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 10032
|
|
I understand that you are new. I'm trying to help you get a better experience here. I'm trying to give you hints on what you can do to get the help you need. Folks here will give you an AMAZING amount of help...but only if you make it possible for them to do so.
|
 |
William P O'Sullivan
Ranch Hand
Joined: Mar 28, 2012
Posts: 860
|
|
If this is a school or educational assignment, no one will do it for you.
At least lay out how you would attempt to code this by designing on paper or at least in your head!
WP
|
 |
Andres John
Ranch Hand
Joined: Jun 07, 2012
Posts: 33
|
|
|
this kind of project its knight's tour that do not use recursive but back tracking.
|
 |
Andres John
Ranch Hand
Joined: Jun 07, 2012
Posts: 33
|
|
William P O'Sullivan wrote:If this is a school or educational assignment, no one will do it for you.
At least lay out how you would attempt to code this by designing on paper or at least in your head!
WP
that what i'm trying to do, so i just think what the prof mean by this kind of question, and this is a knight's out which a complex problem, yet require a lot of thinking and algorithm
|
 |
Andres John
Ranch Hand
Joined: Jun 07, 2012
Posts: 33
|
|
Andres John wrote:the prof is asking me to do this
Create an alternate KtR that solves knight's tour problem for an 8 by 8 board by randomly picking a move from 0 to 7 and if legal make the move. If not legal, try doing this 100 times and if no legal moves after 100 tries abort the game as a failure.
If you make 64 moves print the board.
i modify the the start method instead of giving the number in sequence it will random some the sequence number, but other two questions im not sure about it
|
 |
Andres John
Ranch Hand
Joined: Jun 07, 2012
Posts: 33
|
|
can't get the ideas of t 64 move
|
 |
Andres John
Ranch Hand
Joined: Jun 07, 2012
Posts: 33
|
|
I will end this boring and hard java program that nobody could help me :C
here it the final result now it over, game over Happy !!
|
 |
Jeff Verdegan
Bartender
Joined: Jan 03, 2004
Posts: 6109
|
|
Andres John wrote:I will end this boring and hard java program that nobody could help me :C
There are plenty of people here who could have helped you. You just didn't ask a clear question that would have made it easy for people to understand what your problem is.
|
 |
 |
|
|
subject: how to make this java code Random using OO?
|
|
|
|