Results 1 to 2 of 2
  1. #1
    jammas615 is offline Senior Member
    Join Date
    Jul 2011
    Melbourne, Victoria, Australia
    Rep Power

    Default Finding column and row based on id?


    I have a tile class which takes parameters of id, screen width and screen height.

    I have spent that last hour trying to figure out a way of finding the row and column of each tile based on its id.
    Each tile is part of a grid of 16x12 tiles which is 192 tiles in total. Each tile is also 40x40 in a window of 640x480.

    Can i have some help in solving this?
    Or even a better way to do it?


  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Rep Power

    Default Re: Finding column and row based on id?

    How about a Map keyed with the id and valued with the row/column
    The Map Interface (The Java™ Tutorials > Collections > Interfaces)

Similar Threads

  1. Replies: 11
    Last Post: 10-21-2014, 05:46 AM
  2. insert row and column and delete row and column
    By daredavil82 in forum New To Java
    Replies: 13
    Last Post: 09-22-2011, 07:10 PM
  3. i need an example of JSR179 ((Location based Ser)implementation for CDC based device
    By talk_to_vivekmishra in forum CDC and Personal Profile
    Replies: 3
    Last Post: 12-30-2010, 11:07 AM
  4. Replies: 1
    Last Post: 07-06-2010, 05:50 PM
  5. Replies: 1
    Last Post: 07-24-2007, 12:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts