Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
anpl
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ziyuan Nan
anpl
Commits
7182bd82
Commit
7182bd82
authored
May 09, 2023
by
nzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix print_array & Work around ChatGPT's error
parent
d21b14ac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
11 deletions
+19
-11
robotA.py
+9
-1
utils.py
+10
-10
No files found.
robotA.py
View file @
7182bd82
...
...
@@ -28,7 +28,15 @@ def syn_anpl(anpl: ANPL):
if
newanpl
:
logger
.
log
(
"system"
,
"parse_gpt"
,
"success"
)
if
not
hole
.
startswith
(
"_hole"
):
newanpl
.
clean
(
hole
)
if
hole
in
newanpl
.
funs
:
newanpl
.
clean
(
hole
)
else
:
logger
.
log
(
"system"
,
"parse_gpt"
,
"do not synthesis the specific hole"
)
continue
else
:
if
newanpl
.
entry
in
anpl
.
funs
:
logger
.
log
(
"system"
,
"parse_gpt"
,
"synthesis codes with a used name"
)
continue
anpl
.
fill_fun
(
hole
,
newanpl
)
break
logger
.
log
(
"system"
,
"parse_gpt"
,
"error"
)
...
...
utils.py
View file @
7182bd82
...
...
@@ -14,19 +14,19 @@ colors = ["#000000", "#0000FF", "#FF0000", "#008000", "#FFFF00",
"#808080"
,
"#FFC0CB"
,
"#FFA500"
,
"#008080"
,
"#800000"
]
def
array_to_str
(
matrix
):
if
matrix
.
ndim
==
2
:
if
np
.
issubdtype
(
matrix
.
dtype
,
np
.
integer
)
:
text
=
Text
()
for
row
in
list
(
matrix
):
for
pixel
in
row
:
if
matrix
.
ndim
==
2
:
for
row
in
list
(
matrix
):
for
pixel
in
row
:
text
.
append
(
"⬛"
,
style
=
colors
[
pixel
])
text
.
append
(
"
\n
"
)
elif
matrix
.
ndim
==
1
:
for
pixel
in
list
(
matrix
):
text
.
append
(
"⬛"
,
style
=
colors
[
pixel
])
text
.
append
(
"
\n
"
)
elif
matrix
.
ndim
==
1
:
text
=
Text
()
for
pixel
in
list
(
matrix
):
text
.
append
(
"⬛"
,
style
=
colors
[
pixel
])
return
text
else
:
text
=
Text
(
str
(
matrix
))
return
text
return
Text
(
str
(
matrix
))
def
rich_dumps
(
obj
):
def
_dump_recursive
(
obj
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment