Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AI Chess Robot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jhur22
AI Chess Robot
Commits
c108322d
Commit
c108322d
authored
10 months ago
by
zalonzo2
Browse files
Options
Downloads
Patches
Plain Diff
push new path find
parent
0563e594
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
breadboard_set_up/breadboard_set_up.ino
+1
-1
1 addition, 1 deletion
breadboard_set_up/breadboard_set_up.ino
planning.py
+8
-1
8 additions, 1 deletion
planning.py
with
9 additions
and
2 deletions
breadboard_set_up/breadboard_set_up.ino
+
1
−
1
View file @
c108322d
...
...
@@ -32,7 +32,7 @@ bool capture = false;
bool
promotion
=
false
;
bool
setPromotion
=
false
;
bool
moveDone
=
false
;
int
constOffset
=
25
;
int
constOffset
=
19
;
int
counter
=
0
;
char
tempCoords
[]
=
"00"
;
int
coordPlace
=
0
;
...
...
This diff is collapsed.
Click to expand it.
planning.py
+
8
−
1
View file @
c108322d
...
...
@@ -109,7 +109,14 @@ class Path_planning():
for
cell
in
neighbors
:
if
(
cell
not
in
visited
):
g
=
curCell
[
1
]
+
1
h
=
abs
(
goal
[
0
]
-
cell
[
0
])
+
abs
(
goal
[
1
]
-
cell
[
1
])
numWalls
=
0
for
rowOffset
in
range
(
-
1
,
2
):
for
colOffset
in
range
(
-
1
,
2
):
if
(((
rowOffset
==
-
1
or
rowOffset
==
1
)
and
colOffset
!=
0
)
or
(
colOffset
==
0
and
rowOffset
==
0
)
or
(
curCell
[
2
]
==
(
cell
[
0
]
+
rowOffset
,
cell
[
1
]
+
colOffset
))):
continue
if
(
self
.
walls_array
[(
cell
[
0
]
+
rowOffset
)][(
cell
[
1
]
+
colOffset
)]
==
1
):
#If there is no wall from the cell we're at and were we could go in a square around the cell, add it as a neighbor
numWalls
+=
1
h
=
abs
(
goal
[
0
]
-
cell
[
0
])
+
abs
(
goal
[
1
]
-
cell
[
1
])
+
numWalls
f
=
g
+
h
# print(cell, f)
heapq
.
heappush
(
frontier
,
(
f
,
g
,
cell
,
curCell
[
2
]))
...
...
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