Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cocobotdemo
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
Container 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
Sebastiano Gigliobianco
cocobotdemo
Commits
54fa5305
Commit
54fa5305
authored
2 years ago
by
seba
Browse files
Options
Downloads
Patches
Plain Diff
use config with 1 step size
parent
b36a70f3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
app/blueprints/__pycache__/home.cpython-39.pyc
+0
-0
0 additions, 0 deletions
app/blueprints/__pycache__/home.cpython-39.pyc
app/blueprints/home.py
+14
-2
14 additions, 2 deletions
app/blueprints/home.py
with
15 additions
and
2 deletions
.gitignore
0 → 100644
+
1
−
0
View file @
54fa5305
__pycache__
This diff is collapsed.
Click to expand it.
app/blueprints/__pycache__/home.cpython-39.pyc
deleted
100644 → 0
+
0
−
0
View file @
b36a70f3
File deleted
This diff is collapsed.
Click to expand it.
app/blueprints/home.py
+
14
−
2
View file @
54fa5305
...
...
@@ -20,7 +20,7 @@ with open("piece_variables.json", encoding="utf-8") as infile:
PIECE_VARIABLES
=
json
.
load
(
infile
)
CONFIG
=
{
"
width
"
:
4.0
,
"
height
"
:
4.0
,
"
move_step
"
:
0.5
,
"
prevent_overlap
"
:
False
}
CONFIG
=
{
"
width
"
:
4.0
,
"
height
"
:
4.0
,
"
move_step
"
:
1
,
"
prevent_overlap
"
:
False
}
OBJS
=
{
"
bridge
"
:
{
"
id_n
"
:
0
,
...
...
@@ -67,6 +67,18 @@ COLORS = {
}
def
name_generator
():
"""
make sure objects are placed with increasing id
"""
n
=
0
while
True
:
yield
n
n
+=
1
NAME_GEN
=
name_generator
()
@socketio.on
(
'
click
'
)
def
sample_preview_board
(
config
):
golmi_server
=
f
'
http://
{
current_app
.
config
[
"
golmi_host
"
]
}
:
{
current_app
.
config
[
"
golmi_port
"
]
}
'
...
...
@@ -90,7 +102,7 @@ def sample_preview_board(config):
obj
[
"
x
"
]
=
x
#- len(obj["block_matrix"][0]) // 2
obj
[
"
y
"
]
=
y
#- len(obj["block_matrix"]) // 2
id_n
=
str
(
len
(
state
[
"
objs
"
]
))
id_n
=
str
(
next
(
NAME_GEN
))
obj
[
"
id_n
"
]
=
id_n
state
[
"
objs
"
][
id_n
]
=
obj
...
...
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