Starcode Labyrinth
Copyright (C) 2022 - Benjamin Paassen
starcode
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/.
Introduction
This module provides functions to draw labyrinth maps and execute agents in form of finite state machines on them. This module is intended for teaching, in particular during the courses of starcode.
Overview
The key concept for this module is that of an agent which navigates a labyrinth. To initialize a new agent, you need to initialize a new game state as follows:
from starcode_labyrinth import state
my_state = state.State(level = 0)
The state object receives a level as input. Our package offers several standard levels which are part of the didactic concept of starcode. You can also provide your own levels, if you wish. Please refer to the source code documentation for more details.
Once you have initialized your game state, you can tell the agent
to move(), turn_left(), or turn_right().
my_state.move()
my_state.turn_left()
my_state.turn_right()
To display the agent's current state, use the draw_state() function.
my_state.draw_state()
To display the entire motion up to this point, use the draw_trace() function.
my_state.draw_trace()
As additional functions, we provide is_free() which returns True
if and only if the agent could move ahead, and is_goal() if and only if the agent is currently located at a goal position (the orange star in the pictures).
Metadata
Release files for starcode-labyrinth 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| starcode_labyrinth-0.2.1.tar.gz | 20.5 kB | Without provenance | Details for starcode_labyrinth-0.2.1.tar.gz |
Release files / starcode_labyrinth-0.2.1.tar.gz
| Download URL | starcode_labyrinth-0.2.1.tar.gz |
|---|---|
| Size | 20.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f758c51fad9366d23b5a720fc4d53a274bc1e32156e7e7db1c90458e2beed14
|
|
BLAKE2b-256 checksum How to use checksums |
5f26a2d90568fa45b04e6cea85fff7024598c8f0d28f4cbf04dce9d1300b3a04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 CPython/3.10.5
|
Security for starcode-labyrinth 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.