Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the grid world display size issue. #53

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
venv
envs
*.ipynb
traverseCraft/__pycache__
*/*/__pycache__
src/traverseCraft/__pycache__
tests/__pycache__
test_grid.py
test_tree.py
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "traverseCraft"
version = "0.5.2"
version = "0.6.0"
authors = [
{name = "Srajan Chourasia", email = "[email protected]"},
{name = "Varun Patrikar", email = "[email protected]"},
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='TraverseCraft',
version='0.5.0',
version='0.6.0',
author='Srajan Chourasia, Varun Patrikar',
author_email='[email protected], [email protected]',
maintainer='Srajan Chourasia, Varun Patrikar',
Expand Down
Binary file removed src/traverseCraft/__pycache__/__init__.cpython-35.pyc
Binary file not shown.
Binary file removed src/traverseCraft/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file removed src/traverseCraft/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file removed src/traverseCraft/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file removed src/traverseCraft/__pycache__/agent.cpython-36.pyc
Binary file not shown.
Binary file removed src/traverseCraft/__pycache__/agent.cpython-37.pyc
Binary file not shown.
Binary file removed src/traverseCraft/__pycache__/agent.cpython-38.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed src/traverseCraft/__pycache__/world.cpython-36.pyc
Binary file not shown.
Binary file removed src/traverseCraft/__pycache__/world.cpython-37.pyc
Binary file not shown.
Binary file removed src/traverseCraft/__pycache__/world.cpython-38.pyc
Binary file not shown.
6 changes: 3 additions & 3 deletions src/traverseCraft/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ def __init__(self, worldName:str, rows:int, cols:int, cellSize:int=10, pathColor
self._goalCells = None

# ~~~~~ Window Attributes ~~~~~ #
self._windowHeight = ((self._rows + 2) * (self._cellSize + 2*self._cellPadding))
self._windowWidth = (int)(self._cols + 0.75) * (self._cellSize + 2*self._cellPadding)
self._windowHeight = (int)((self._rows + 0.5) * (self._cellSize + 2*self._cellPadding)) + 45
self._windowWidth = max((int)((self._cols + 0.5) * (self._cellSize + 2*self._cellPadding)), 200)

# ~~~~~ Button Attributes ~~~~~ #
self._buttonBgColor = buttonBgColor
Expand Down Expand Up @@ -188,7 +188,7 @@ def aboutWorld(self):
about.add_row(["Columns", self._cols])
about.add_row(["Cell Size", self._cellSize])
about.add_row(["Cell Padding", self._cellPadding])
about.add_row(["Window Size", f"{self._windowWidth}x{self._windowHeight}"])
about.add_row(["Window Size", f"{self._windowHeight}x{self._windowWidth}"])
about.add_row(["Path Color", self._pathColor])
about.add_row(["Block Color", self._blockColor])
about.add_row(["Goal Color", self._goalColor])
Expand Down
Loading