This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

creating random mole and removing it.  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here i Created Ovals and loop it until 3 . My question is how can i

1) Draw a Oval at a random location and
2) If there are more than 5 Oval present how can i remove a random Oval, So far i have done this:









I hope this question make sense whoever is trying to help me. Thank YOU













 
Marshal
Posts: 58378
178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would need to create an array of moles and remove a member of that array.
That is one way to do it. There are lots of others.

I think you ought to create a Mole class.
 
Mac Subedi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
would you give me some hints in code. ThankYOU
 
Campbell Ritchie
Marshal
Posts: 58378
178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Mac Subedi wrote:would you give me some hints in code. ThankYOU

No. Sorry.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!