Skip to main content

cege_gopher

A Karel-style grid robot for teaching introductory Python, themed as Goldy Gopher. Written for CEGE 3101 — Computer Applications I at the University of Minnesota.

Ported from the MATLAB robot used in earlier offerings of the course, which was itself a port of the KAIST CS101 HUBO exercise (otfried/cs101) — Karel the Robot, at the root of it.

Why this exists

The original libraries open a live window and animate each command as it runs. Google Colab cannot host one.

So this version records, then replays. Every command appends a frame to a buffer; nothing is drawn until show(), which renders the whole run as an inline animation:

write the whole program → run the cell → watch it play back

Students never drive the robot interactively; every program is pre-coded, which is also how the homework is graded.

Install

pip install cege-gopher

Or, from the course repository:

pip install "git+https://github.com/benchoi93/CEGE3101_Computer_Applications.git#subdirectory=packages/cege-gopher"

The 13 world files ship inside the package, so nothing needs uploading — load_world("harvest1.wld") just works.

Use

from cege_gopher import *

load_world("harvest1.wld")       # or: create_world(10, 10)
goldy = Gopher()
goldy.set_trace("maroon")

while goldy.front_is_clear():
    if goldy.on_carrot():
        goldy.pick_carrot()
    goldy.move()

show()                           # the animation renders here

list_worlds() returns the bundled world names.

API

Module create_world(avenues, streets), load_world(name), list_worlds(), show(fps=), show_final(), get_world()
Move move(), turn_left(), turn_right()
Carrots pick_carrot(), drop_carrot()
Sense front_is_clear(), left_is_clear(), right_is_clear(), facing_north(), on_carrot(), carries_carrots()
Display set_trace(color), get_pos()

Robot is an alias for Gopher, and pick_beeper/pick_coin for pick_carrot, so code written against cs1robots or the MATLAB version still runs.

A bug fixed in this port

The MATLAB version had leftIsClear and rightIsClear swapped — facing east it checked south for "left", when turnLeft rotates counter-clockwise (E→N) so left of east is north. This port uses left = (-dy, dx), right = (dy, -dx).

License

MIT.

Metadata

Release files for cege-gopher 0.6.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cege-gopher 0.6.3
File Size Uploaded Provenance
cege_gopher-0.6.3.tar.gz 25.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cege-gopher 0.6.3
File Interpreter ABI Platform
cege_gopher-0.6.3-py3-none-any.whl Python 3 none any Details

Total release size: 53.7 kB

Release files / cege_gopher-0.6.3.tar.gz

Download URL cege_gopher-0.6.3.tar.gz
Size 25.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c98fb4b85df3ee7c51575ba94e873d9d31b76dc3629bafce09fb7866ba4daa5f
BLAKE2b-256 checksum
How to use checksums
c2154caab2af43ba559e6b052d70ad59cac91afd30331347c605631d33654cd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / cege_gopher-0.6.3-py3-none-any.whl

Download URL cege_gopher-0.6.3-py3-none-any.whl
Size 27.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c57a685b7a29c4e470e2f9d3ec907363e1ff0d2214ecdfd4f26713cb50e9246
BLAKE2b-256 checksum
How to use checksums
edf9c8332d685042acd1979ccad41ffb5d6b3c6d0c2f7d50fef7f9b7279210b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for cege-gopher 0.6.3

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page