Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local r = require("robot")
- local w=0
- local l=0
- while (not r.detect()) and (r.detectDown()) do
- r.forward() w = w + 1 end;
- if not r.detectDown() then r.back() end;
- r.turnRight()
- while (not r.detect()) and (r.detectDown()) do
- r.forward() l = l + 1 end;
- if not r.detectDown() then r.back() end;
- print(w,l)
- print(w*l)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement