Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6347133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:09:09+00:00 2026-05-24T21:09:09+00:00

I need to traverse a rectangular grid in continuous manner . Here is an

  • 0

I need to traverse a rectangular grid in continuous manner. Here is an example of what I want, the number means sequence:

   + x
   y 0  1  2
     5  4  3
     6  7  8

At each step I know the index in matrix. Is there any way to calculate the coordinates? The inverse mapping for [x + y * width] doesn’t help, beacuse it creates “steps” or “jumps”. Is there any solution?

Here is explanation for “steps” mentioned above:

  + x
   y 0  1  2
     3  4  5 //at this moment the X coordinate changes by 3, thus create step
     6  7  8
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:09:10+00:00Added an answer on May 24, 2026 at 9:09 pm
    y = index / width
    if( y % 2 == 0 )
       x = index % width
    else
       x = width - index % width - 1
    

    I think that should do it. It’s a single modification of the standard way of calculating with “steps” as you call them. You are only changing the way the calculation is done based upon the row.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large filesystem that I need to traverse for errors. Each file
I've got a 1-based array of four items which I need to traverse. For
Need some help about with Memcache. I have created a class and want to
I need to be able to traverse through my entire object graph and log
I need to validate information from a grid: - check if all the rows
I need to traverse a binary tree, skipping the children of any node for
I need a pattern that will traverse the document and get me all links
We use jQuery to parse some HTML. I then need to traverse that document
I need to traverse in VB.Net I have 4 command buttons namely Move First,
here's a very simple js but i don't know where to begin. in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.