• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can't find the logic

 
riris wijaya
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hy all, i can't figure out the logic of this



The position of A and B is random. And A and B is linked by *. What is the logic of this?? do i have to make an array 10 x 10, and access the index randomly to put A??? or what??
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the actual assignment, find the A and B positions and putting *'s? If so first of all find exact location of 'A' and 'B', then put the star's.
 
riris wijaya
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The assignment is to place A and B randomly, and connect it with *. So, whenever the program is run, the position of A and B is change and linked with *.
 
Campbell Ritchie
Sheriff
Posts: 48381
56
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pencil and paper. That’s what you need. Write down an explanation of how you would do that. Once you have got it into very simple words (pseudo-code), it will be easy to convert to code.
 
tarun mall
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
riris wijaya wrote:hy all, i can't figure out the logic of this



The position of A and B is random. And A and B is linked by *. What is the logic of this?? do i have to make an array 10 x 10, and access the index randomly to put A??? or what??



The solution is pretty easy ;)

1. Fill A's row till B's column
2. Fill B's column till A's row
 
riris wijaya
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have found the way to place A and B randomly. Here is my scrip


but still, i can conect A and B with *. Is there any suggestion???
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
riris wijaya wrote:
but still, i can conect A and B with *. Is there any suggestion???


Same suggestion you've already received:
Campbell Ritchie wrote:Pencil and paper. That’s what you need. Write down an explanation of how you would do that. Once you have got it into very simple words (pseudo-code), it will be easy to convert to code.
 
dennis deems
Ranch Hand
Posts: 808
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My suggestion is to scrap what you have done, turn off the computer, and follow Campbell's suggestion of solving the problem with pencil and paper. If you really do this, then writing the code will be simple. Well, okay I have a second suggestion: use the power of objects!
 
Darryl Burke
Bartender
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
riris, please BeForthrightWhenCrossPostingToOtherSites <-- link
http://www.java-forums.org/new-java/57266-cant-find-logic.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic