Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to make this java code Random using OO?

 
Andres John
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12126
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Andres John
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12126
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andres John wrote:i already what it said in HowToAskQuestionsOnJavaRanch thank for the link
it my first time using the this link

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
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this kind of project its knight's tour that do not use recursive but back tracking.
 
Andres John
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


can't get the ideas of t 64 move
 
Andres John
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic