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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
robotA.py
+8
-0
utils.py
+4
-4
No files found.
robotA.py
View file @
7182bd82
...
@@ -28,7 +28,15 @@ def syn_anpl(anpl: ANPL):
...
@@ -28,7 +28,15 @@ def syn_anpl(anpl: ANPL):
if
newanpl
:
if
newanpl
:
logger
.
log
(
"system"
,
"parse_gpt"
,
"success"
)
logger
.
log
(
"system"
,
"parse_gpt"
,
"success"
)
if
not
hole
.
startswith
(
"_hole"
):
if
not
hole
.
startswith
(
"_hole"
):
if
hole
in
newanpl
.
funs
:
newanpl
.
clean
(
hole
)
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
)
anpl
.
fill_fun
(
hole
,
newanpl
)
break
break
logger
.
log
(
"system"
,
"parse_gpt"
,
"error"
)
logger
.
log
(
"system"
,
"parse_gpt"
,
"error"
)
...
...
utils.py
View file @
7182bd82
...
@@ -14,19 +14,19 @@ colors = ["#000000", "#0000FF", "#FF0000", "#008000", "#FFFF00",
...
@@ -14,19 +14,19 @@ colors = ["#000000", "#0000FF", "#FF0000", "#008000", "#FFFF00",
"#808080"
,
"#FFC0CB"
,
"#FFA500"
,
"#008080"
,
"#800000"
]
"#808080"
,
"#FFC0CB"
,
"#FFA500"
,
"#008080"
,
"#800000"
]
def
array_to_str
(
matrix
):
def
array_to_str
(
matrix
):
if
matrix
.
ndim
==
2
:
if
np
.
issubdtype
(
matrix
.
dtype
,
np
.
integer
)
:
text
=
Text
()
text
=
Text
()
if
matrix
.
ndim
==
2
:
for
row
in
list
(
matrix
):
for
row
in
list
(
matrix
):
for
pixel
in
row
:
for
pixel
in
row
:
text
.
append
(
"⬛"
,
style
=
colors
[
pixel
])
text
.
append
(
"⬛"
,
style
=
colors
[
pixel
])
text
.
append
(
"
\n
"
)
text
.
append
(
"
\n
"
)
elif
matrix
.
ndim
==
1
:
elif
matrix
.
ndim
==
1
:
text
=
Text
()
for
pixel
in
list
(
matrix
):
for
pixel
in
list
(
matrix
):
text
.
append
(
"⬛"
,
style
=
colors
[
pixel
])
text
.
append
(
"⬛"
,
style
=
colors
[
pixel
])
else
:
text
=
Text
(
str
(
matrix
))
return
text
return
text
else
:
return
Text
(
str
(
matrix
))
def
rich_dumps
(
obj
):
def
rich_dumps
(
obj
):
def
_dump_recursive
(
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