Enter the mouse!
Neko loves to chase mice (and eat them)!
Type the following at the Python prompt:
place_mouse(0, 2)
Yes - we now have a mouse at row zero column two!
It seems that `place_mouse’ also is a `function’
- but we are now putting two numbers within the
brackets - what’s that for?
Simple. You want place_mouse to know at which row
and column position the mouse is to be placed;
putting the row and column values in brackets is
a way to do this.
You will not be surprised to hear that programmers
describe this very simple idea in
a complicated way - a programmer will say that “you
are passing row and column values as PARAMETERS to
the FUNCTION place_mouse” … whew, that is quite a
mouthful!
Anyway, because some of you may become great programmers
in the future, just remember:
We call commands like place_mouse, sleep, wakeup, right
etc as “functions”. Some functions may require values placed
inside the brackets - we call these values “parameters”
Ok, enough of this boring stuff!
Try to place the mouse at some other location.
Just for fun, try to put the poor mouse at the location
where Neko is sitting right now … what do you see?
Another experiment. Put the mouse in some cell and
make Neko go to that cell. Neko will be really happy!
Try this function at the Python prompt:
kill_mouse()
What does it do?