Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- longueur = 0
- largeur = 0
- hauteur = 0
- start_turn = 0
- function start()
- while turtle.detect() do
- turtle.turnLeft()
- start_turn = start_turn + 1
- calculer()
- end
- end
- function prendre()
- while a < 17 do
- a = 1
- turtle.select(a)
- turtle.suck(64)
- end
- end
- function partir()
- while start_turn ~= 0 do
- turtle.turnRight()
- if hauteur % 3 = 0 then
- turtle.up()
- end
- end
- end
- function calculer()
- calc_l = longueur*2
- calc_la = largeur*2
- calc_h = hauteur/3
- coal_1 = calc_l + calc_la + calc_h
- coal_t = coal_1/80
- block_1 = longueur*hauteur*2
- block_2 = largeur*2*hauteur
- block_t = block_1+block_2
- end
- function graph()
- print("Block restants à placer : ", block_t)
- print("Fuel : ", coal_1, "Donc ", coal_t, " de coal")
- end
- function place()
- if hauteur % 3 = 0 then
- turtle.place()
- turtle.placeUp()
- turtle.placeDown()
- end
- elseif hauteur % 2 = 0 then
- turtle.place()
- turtle.placeUp()
- end
- else
- turtle.place()
- end
- end
- start()
- while true do
- graph()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement