What is an avenue in a karel world




Who is Karel?

is an R package created with the purpose of providing an environment that enables the teaching of programming principles in a dynamic and interactive way, for students with no previous experience who are studying at the secondary level or in the early years of their undergraduate education.
Karel
is a robot that lives and walks in certain
worlds
, in which it can perform certain actions if we ask it to, while we learn to program in R.

The robot Karel assists in the teaching of fundamental programming concepts, such as the processor (Karel), environment (its world), objects (called
beepers
), and actions (the activities it can perform). In addition, as can be seen in the examples of the tutorials presented on this page, along with Karel, it is possible to instruct on the concept of algorithmic decomposition: on numerous occasions, the robot must fulfill objectives whose resolution requires breaking down the problem into smaller parts, for each of which students must program a function in R. It also facilitates the exemplification of the use of sequential code control structures, conditionals (), and iterative structures (, ).

The first step to programming wi

About Karel's World


What is Karel
Karel is a robot living in a simple world represented on your computer screen.

Karel (facing north)


A little picture of Karel's world.

How can Karel get about in his world?
Karel's world is crisscrossed by horizontal
streets
and vertical
avenues
which are represented by lines on your computer screen. Karel can only stand at
corners
where a street and avenue intersect. He can move and turn about, but he must stay on the streets and avenues and can only stop at corners.
What directions can Karel face?
Karel can face in any of the directions
north
(toward the top of the screen),
south
(toward the bottom),
east
(toward the right), and
west
(toward the left).
What objects appear in Karel's World
There are two other kinds of things in Karel's world besides Karel:
walls
, and
beepers
.
What are walls?
The walls in Karel's world are made of neutronium (an impenetrable metal). They appear as dar obstructions between street corners in Karel's world.

Wall Section (east-west)


What are beepers?
Beepers are small platic cones that make a quiet beeping sound. They may appear at street corners and may be picked up or plac


This page provides an
overview of Karel's world and what he can do
.

You may also want to read a reference guide that describes the details of the commands and functions Karel understands and/or a reference guide for the .

Karel's World:


General Comments

Karel lives in a flat world with the standard north, south, east, and west compass points. The world is bounded on all four sides by boundaries. Karel cannot bump into these walls; if he tries to move into one, he will crash.

Crisscrossing the world are horizontal
streets
(running east-west) and vertical
avenues
(running north-south). An
intersection
(or street corner or corner) is located wherever a street and avenue intersect. Karel can be positioned on any corner, facing one of the four compass points. Both streets and avenues are numbered; consequently each intersection may be identified by its street and avenue numbers.

The corner of 1st Street and 1st Avenue is named the
origin
. This is the most southwesterly corner in Karel's world. Street numbers increase as Karel travels east and avenue numbers increase as Karel travels north.

Karel's Locat


In this section, we will present other examples that will help us continue thinking about the principle of algorithmic decomposition and, furthermore, how to think of solutions that are general enough to address different versions of the same problem.


Some examples presented in this tutorial were adapted from “Karel the robot learns Java” (Eric Roberts, 2005).




Fixing the street again


In the previous section, we proposed the following program to solve the problem of filling the holes in the street:

This program works for worlds with streets of any length. However, it would not work if the holes were not evenly spaced as we initially assumed. It would be better to have a more general program that works under these conditions:



The world can have streets of any length.



The holes can be located at any position along the street, without restrictions on the number or spacing.



Some holes may already be filled, so Karel should not put a
thing
in them.



An example of this type of world is:



To solve this problem, instead of starting each iteration with a move, we should first check if there is a hole where Karel is standing. If there is, Karel should fill it in if