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 6032171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:17:40+00:00 2026-05-23T05:17:40+00:00

For example, if the array is like 0 0 0 0 … 0 0[n]s

  • 0

For example, if the array is like 0 0 0 0 ... 0 0[n]s o m e d a t a 4 9 9 9 9 9 9 8 3 7 ..., how to move the pointer by n, without changing s o m e d a t a 4 9 9 9 ... after the pointer is moved?

  • 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-23T05:17:40+00:00Added an answer on May 23, 2026 at 5:17 am

    Nice challenge. I love this language 🙂

    My solution is (I think) somewhat correct, it moves the cursor after the data of length n without changing it, but it moves the data two cells to the left (or one, provided certain conditions are met). Here is the code, hope you find it useful.

    The requirements are:

    • there is an empty cell to the left of the data and
    • the pointer is pointing to that empty cell and
    • there are no empty cells in the data itself.

    Here is the code:

    >[<->+]<[>>[-<+>]<<[->>+<<]>[-<+>]>[-<+>]<-]
    

    Example: an array 7 9 6, so 3 tells how far to move the cursor.

    0 3 7 9 6 ?   this line represents data; values are numbers in cells
    ^             this shows the pointer location
    
    >[<->+]< gives
    
    3 0 7 9 6 ?
    ^
    
    now the loop; while the pointer is not zero
    [
    
    >>[-<+>] gives in first iteration
    3 7 0 9 6 ?
        ^
    
    <<[->>+<<] gives in first iteration
    0 7 3 9 6 ?
    ^
    
    >[-<+>] gives in first iteration
    7 0 3 9 6 ?
      ^
    
    >[-<+>] gives in first iteration
    7 3 0 9 6 ?
        ^
    
    <- decreases the loop pointer and gives in first iteration
    7 2 0 9 6 ?
      ^
    
    which means the loop can continue giving
    7 2 9 0 6 ?
    7 0 9 2 6 ?
    7 9 0 2 6 ?
    7 9 2 0 6 ?
    7 9 1 0 6 ? after the second iteration and finally
        ^
    7 9 6 0 0 ? after the last
          ^
    ] which is where the loop will end
    

    Now, if there is an additional empty cell to the left of the whole sequence, then we can move the data one cell to the right.

    0 7 9 6 0 0 ?
            ^
    
    <[[>+<-]<] gives
    0 0 7 9 6 0 ?
    ^
    
    >>[>] gives finally
    0 0 7 9 6 0 ?
              ^
    

    So the cursor is moved behind the data of an arbitrary length, however shifting the data one cell to the left.

    Disclaimer There might be errors in the code, but the idea itself should be clear. Feel free to correct the code whenever it does not match the example.

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

Sidebar

Related Questions

For example i have an array like this: $test= array(0 => 412, 1 =>
I have a PHP array which looks like this example: $array[0][0] = 'apples'; $array[0][1]
I have an array result like this, example 1: Array ( [0] =>15 [1]
If, for example, I had array like this: array(34) { [ahostel.lt/img/background.png]=> array(4) { [name]=>
For example we can construct such an array like this: new ElementType[0]; I seen
For example, I have an array like this: array(4) ( a => string(0) b
let's say I have a matrix (array) like this example, but much larger: 0
I have a multidimensinal array.. Something like this for example: Array ( [0] =>
need to return an array like this for example: array(30 => 'Mercedes Benz 310
I have an array like so: array{ [39] => src=http://www.google.com/jsapi> [111] => src=http://www.example.com/wp-content/themes/code.js [55]

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.