This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Ravielli's profile picture

Count amount of layers mined

Started by Ravielli, 18 March 2017 - 03:34 PM
Ravielli #1
Posted 18 March 2017 - 04:34 PM
Hello!
I am trying to make my turtle mine a 3x3 tunnle forward and make it print 1, 2, 3… for every layer mined.
ill put my code here and hopefully get some help :)/>
Spoilerhttp://pastebin.com/GmrqVrHa
Bomb Bloke #2
Posted 19 March 2017 - 08:09 AM
Well, I guess change:

for i=1,n do
    tunnle33()
end

… to:

for i=1,n do
    print(n)
    tunnle33()
end
Ravielli #3
Posted 19 March 2017 - 11:29 AM
Well that was simpler than i thought :D/>

nvm,
didnt really solve my problem.
i want it to print how many layers it has mined thus far,
not the users input.
like 1 layers mined - 2 layers mined - 3 layers mined…
until it is done with the tunnle
valithor #4
Posted 19 March 2017 - 01:25 PM
Well that was simpler than i thought :D/>/>
nvm,
didnt really solve my problem.
i want it to print how many layers it has mined thus far,
not the users input.
like 1 layers mined - 2 layers mined - 3 layers mined…
until it is done with the tunnle

In bomb blokes example just change the variable "n" to the variable "i" in the print statement.

like this:

print(i)