• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

can't find the logic  RSS feed

 
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??
 
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 *.
 
Marshal
Posts: 59745
188
  • 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.
 
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???
 
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.

 
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!
 
Bartender
Posts: 5167
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
Boost this thread!