Jump to content

How to flag this point?


Recommended Posts

I have been twirling my fork around for a few hours and have finally reached a fairly solid point in my script. One thing which is not coming to me though, is ideas on how to flag a specific point. I have attempted doing it a few ways with no avail.

I won't be posting my code unless it's REALLY required (It will be extremely difficult to understand + it's for work). I think the following will be able to get the idea across easily.

What my code does:
- Go as deep as you can ($depth ;Goes from 1 -> 5).
- Increase the value of $X[$depth] as much as you can ($X[$depth] ;Can be a number 0 -> 5).
- When the value of $X[$depth] = 5, decrease the depth by 1.
- When the sum of all $X[$depth] elements = 10, shuffle 1 to the highest point (left-most numbers = depths):
Picture1.png.de90c5619cc1bafaf56fb20d43b08bf2.png
- When $depth = 1, decrement $X[$depth] and jump back up to the first non-0 AND do not increment it, causing it to do:
Picture2.png.b63e4498103b72f0d729bf95a623e3c7.png

^ Is what I don't have working. I currently go back to depth 5, see a 5, jump out to depth 4, see a 4, then increment it to 5 (don't want this to happen) before decrementing it by 1. I want to go back to depth 4 and decrement it, then do the +1/-1 shuffle while jumping out to higher depths.

 

Thank you in advance.

Edited by IAMK
Link to comment
Share on other sites

  • Moderators
5 minutes ago, FrancescoDiMuro said:

Posting some code? :)

Best Regards.

Unable to read the OP? :)

@IAMK to give people a better understanding, you might try writing the function in pseudo-code if you don't have that piece coded entirely:

for $depth = 1 To -5
    ;do this
    ;then this
next

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

FYI: I have scrapped this extremely complex method and started from scratch with a much simpler design (one anyone can read and understand - New thread).

I'm closing this thread.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...