Getting Started

Installation

To use the roboworld package, you can install it via pip

pip install roboworld

or install the most recent updated version via git

git clone https://github.com/BZoennchen/robo-world.git

sudo python setup.py install

The Jupyter Environment

roboworld was developed to be used within the Jupyter notebook environment. Notebooks allow us to display the current state of the World and its Robo via a matrix plot generated by matplotlib. A recorder ArrayRecorder saves a frame (basically a matrix) every time Robo changes its or the world’s state. Furthermore, it is possible to display an animation of the executed instructions within a Jupyter notebook.

Direct visual feedback is an essential feature of roboworld and is meant to improve the student’s learning process. Therefore, we recommend that teachers use Jupyter notebook. Follow the installaiton instructions.

The Student’s Workflow

Students should receive a specific World and a description of what to do with it. For example:

Exercise 1. Given is the following World. Move robo from the left to its goal in the east.

Hint: robo is oriented towards the east.

[1]:
import roboworld as rw
[2]:
world = rw.corridor()
robo = world.robo
[3]:
world.show()
[3]:
_images/getting-started_4_0.png

Solution 1.

[4]:
while not robo.is_at_goal():
    robo.move()
move (0, 0) -> (0, 1)
move (0, 1) -> (0, 2)
move (0, 2) -> (0, 3)
move (0, 3) -> (0, 4)
move (0, 4) -> (0, 5)
move (0, 5) -> (0, 6)
move (0, 6) -> (0, 7)
move (0, 7) -> (0, 8)
move (0, 8) -> (0, 9)

Check your Solution

[5]:
world.show()
[5]:
_images/getting-started_8_0.png
[6]:
rw.animate(world)