r/ComputerCraft • • Dec 23 '20

I made a simple Turtle staircase program! Not too complicated, but it's my first real program and I'm new to Lua. Criticism welcome!

68 Upvotes

9 comments sorted by

8

u/bryceio Dec 23 '20

You can definitely make it more efficient by having it mine before it moves down instead of having it move down, forward, and up.

Edit; actually maybe not that simple, but the movement I think can be more efficient

3

u/Nayzal Dec 23 '20

Ok, thanks! I'll work on it.

1

u/aijada Dec 24 '20

You could also spare yourself a little movement by doing some cuttinng on your way back up.

I have one that is very min-max for the amount of headspace it clears out:

https://pastebin.com/Sbr4Sbd3

1

u/ChrisCringe Nov 22 '22

You can use turtle.detectdirection to see if there is a block above you. This would save you some up and down movement in the beginning

3

u/Nayzal Dec 23 '20

Here's the Pastebin if you want it! Since I recorded the video, I also made it so it says each time it loops. pastebin get Xy5uV33P stairs

4

u/DoctorCube Dec 23 '20

Pretty good for a first program. Congrats!

3

u/WurmIGuess Dec 23 '20

Nice, you should be proud.

2

u/ChrisCringe Nov 22 '22

Great work for a first program!

1

u/Bad_Dog_Games Dec 23 '20

i like it. personally i like 2 or 3 wide stair cases (claustrophobia) but i could modify it for my personal use, or run it 2 or 3 times. but very nice for a first program