Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rod_Quarry
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
roaa1g19
Rod_Quarry
Commits
6fe5b6e2
Commit
6fe5b6e2
authored
3 years ago
by
Rodrigo Amaral
Browse files
Options
Downloads
Patches
Plain Diff
V1.4
parent
13991ae8
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Rod_Quarry.lua
+82
-35
82 additions, 35 deletions
Rod_Quarry.lua
with
82 additions
and
35 deletions
Rod_Quarry.lua
+
82
−
35
View file @
6fe5b6e2
...
@@ -159,6 +159,7 @@ function Go_Home()
...
@@ -159,6 +159,7 @@ function Go_Home()
end
end
end
end
if
Is_Even
(
CURRENT_LAYER
)
then
--Move to 0th Row
--Move to 0th Row
for
i
=
0
,
CURRENT_ROW
-
1
,
1
do
for
i
=
0
,
CURRENT_ROW
-
1
,
1
do
r
,
err
=
turtle
.
forward
()
r
,
err
=
turtle
.
forward
()
...
@@ -179,6 +180,30 @@ function Go_Home()
...
@@ -179,6 +180,30 @@ function Go_Home()
return
-
3
return
-
3
end
end
end
end
turtle
.
turnLeft
()
else
--Move to 0th column
turtle
.
turnRight
()
for
i
=
0
,
CURRENT_COL
-
1
,
1
do
r
,
err
=
turtle
.
forward
()
if
(
not
r
)
then
print
(
err
)
print
(
"3: GO HOME CRITICAL ERROR: Unable to move Forwards!!!"
)
return
-
3
end
end
turtle
.
turnLeft
()
--Move to 0th Row
for
i
=
0
,
CURRENT_ROW
-
1
,
1
do
r
,
err
=
turtle
.
forward
()
if
(
not
r
)
then
print
(
err
)
print
(
"2: GO HOME CRITICAL ERROR: Unable to move Forwards!!!"
)
return
-
2
end
end
end
-- Move 0th Layer
-- Move 0th Layer
for
i
=
1
,
CURRENT_LAYER
-
1
,
1
do
for
i
=
1
,
CURRENT_LAYER
-
1
,
1
do
...
@@ -190,8 +215,6 @@ function Go_Home()
...
@@ -190,8 +215,6 @@ function Go_Home()
end
end
end
end
turtle
.
turnLeft
()
return
0
return
0
end
end
...
@@ -210,6 +233,7 @@ function Go_Back()
...
@@ -210,6 +233,7 @@ function Go_Back()
end
end
end
end
if
Is_Even
(
CURRENT_COL
)
then
-- Move to previous Column
-- Move to previous Column
turtle
.
turnRight
()
turtle
.
turnRight
()
for
i
=
0
,
CURRENT_COL
-
1
,
1
do
for
i
=
0
,
CURRENT_COL
-
1
,
1
do
...
@@ -220,9 +244,9 @@ function Go_Back()
...
@@ -220,9 +244,9 @@ function Go_Back()
return
-
3
return
-
3
end
end
end
end
turtle
.
turnLeft
()
--Move to previous Row
--Move to previous Row
turtle
.
turnLeft
()
for
i
=
0
,
CURRENT_ROW
-
1
,
1
do
for
i
=
0
,
CURRENT_ROW
-
1
,
1
do
r
,
err
=
turtle
.
forward
()
r
,
err
=
turtle
.
forward
()
if
(
not
r
)
then
if
(
not
r
)
then
...
@@ -231,6 +255,29 @@ function Go_Back()
...
@@ -231,6 +255,29 @@ function Go_Back()
return
-
2
return
-
2
end
end
end
end
else
--Move to previous Row
for
i
=
0
,
CURRENT_ROW
-
1
,
1
do
r
,
err
=
turtle
.
forward
()
if
(
not
r
)
then
print
(
err
)
print
(
"2: GO HOME CRITICAL ERROR: Unable to move Forwards!!!"
)
return
-
2
end
end
-- Move to previous Column
turtle
.
turnRight
()
for
i
=
0
,
CURRENT_COL
-
1
,
1
do
r
,
err
=
turtle
.
forward
()
if
(
not
r
)
then
print
(
err
)
print
(
"3: GO BACK CRITICAL ERROR: Unable to move Forwards!!!"
)
return
-
3
end
end
turtle
.
turnLeft
()
end
-- Move one layer down
-- Move one layer down
if
(
CURRENT_LAYER
>
0
)
then
if
(
CURRENT_LAYER
>
0
)
then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment