Posted 22 February 2014 - 10:04 PM
Hey this issues is hard to describe, so i urge you to download the pastebin here WhPjs6dL to see for yourself
alright so for starters I know there are a million turtle digging programs out there, the point of this program is not to be better than the rest but to simply function. It is mostly being made as a test, as well as an early game basic quarry (currently only set to dig up but its not the most user friendly program then lol) the idea is you run the program with three arguments, depth, width, and height , represented by D,W, and z because my mind associates z with up for some reason. then the program should dig forward the D amount, then turn, right or left depending on what it previously did, eg if its last turn was right, the next turn will then be left. to make a zig zag style line, at the end of each flat d-w pass, the turtle goes up turns around and depending on weather or not the with is even or odd will decide weather it will invert at each pass or not, odd being that it won't invert because it ends up on the opposing corner meaning it can safely continue the way it had initially, where even nubmers mean it needs to invert each time, because it will be on the same side but opposing ends each time meaning it will need to go from left, to right, and back again.
sorry if this is confusing lol but that's programming i guess.
after doing some testing it seems that only evens, or odds will work properly depending on how i set up certain variables. can any body lend their mind here and take a small crack at it, see if theres something that really needs to be changed? any help is appreciated!
edit - forgot to mention how things are going wrong!
basically i know its not working when it is supposed to go up, it goes up, then goes a line, and instead of going the proper direction it goes the opposit direction. i am rewriting this code from scratch at the moment but any assistance will still be helpful
edit 2- please close, i got it working finally, after nearly 2 hours of brainstorming i finally found a way around it, here is the updated code if anybody is interested - Abz736vf
alright so for starters I know there are a million turtle digging programs out there, the point of this program is not to be better than the rest but to simply function. It is mostly being made as a test, as well as an early game basic quarry (currently only set to dig up but its not the most user friendly program then lol) the idea is you run the program with three arguments, depth, width, and height , represented by D,W, and z because my mind associates z with up for some reason. then the program should dig forward the D amount, then turn, right or left depending on what it previously did, eg if its last turn was right, the next turn will then be left. to make a zig zag style line, at the end of each flat d-w pass, the turtle goes up turns around and depending on weather or not the with is even or odd will decide weather it will invert at each pass or not, odd being that it won't invert because it ends up on the opposing corner meaning it can safely continue the way it had initially, where even nubmers mean it needs to invert each time, because it will be on the same side but opposing ends each time meaning it will need to go from left, to right, and back again.
sorry if this is confusing lol but that's programming i guess.
after doing some testing it seems that only evens, or odds will work properly depending on how i set up certain variables. can any body lend their mind here and take a small crack at it, see if theres something that really needs to be changed? any help is appreciated!
edit - forgot to mention how things are going wrong!
basically i know its not working when it is supposed to go up, it goes up, then goes a line, and instead of going the proper direction it goes the opposit direction. i am rewriting this code from scratch at the moment but any assistance will still be helpful
edit 2- please close, i got it working finally, after nearly 2 hours of brainstorming i finally found a way around it, here is the updated code if anybody is interested - Abz736vf
Edited on 22 February 2014 - 10:36 PM