JuliaKara.jl Documentation

JuliaKara.jl Documentation

Functions

World

JuliaKara.@WorldMacro.
@World [name] defintion

definition is either a String describing the path to a world-file which should be loaded or a Tuple{Int,Int} describing the height and the width of the world

In case a name is provided (Must be a name that can be used as a variable name) a variable in global scope named name and a macro named @name are created which allow access to the world (See Examples).

In case no name is provided the world is stored in global scope in a variable named world and kara is placed at location 1,1 and refereced with a global variable named kara. Furthermore all function used for interaction with kara (move(), turnLeft(), ...) are extended with methods to allow calls like move(kara).

Examples

julia> @World (10,10)
julia> move(kara) # moves kara in world
julia> @world testw (10,10)
julia> lara = @testw place_kara()
julia> @testw move(lara) # moves lara in testw
source

Interaction

move(wo::World,ac::Actor)

Moves the actor ac a step forward in the world wo.

source
move(wo::World_GUI,ac::Actor)

Moves the actor ac a step forward in the world wo.

This function is a wrapper around JuliaKara_noGUI.move to support GUI.

source
turnLeft(wo::World,ac::Actor)

Turns the actor ac counter clockwise.

source
turnLeft(wo::World_GUI,ac::Actor)

Turns the actor ac counter clockwise.

This function is a wrapper around JuliaKara_noGUI.turnLeft to support GUI.

source
turnRight(wo::World,ac::Actor)

Turns the actor ac clockwise.

source
turnRight(wo::World_GUI,ac::Actor)

Turns the actor ac clockwise.

This function is a wrapper around JuliaKara_noGUI.turnRight to support GUI.

source
putLeaf(wo::World,ac::Actor)

Places an actor of type leaf the location ac is at.

source
putLeaf(wo::World_GUI,ac::Actor)

Places an actor of type leaf the location ac is at.

This function is a wrapper around JuliaKara_noGUI.putLeaf to support GUI.

source
removeLeaf(wo::World,ac::Actor)

Removes an actor of type leaf from the location ac is at.

source
removeLeaf(wo::World_GUI,ac::Actor)

Removes an actor of type leaf from the location ac is at.

This function is a wrapper around JuliaKara_noGUI.removeLeaf to support GUI.

source

Sensors

treeFront(wo::World,ac::Actor)

Checks if there is an actor of type tree in front of actor ac.

source
treeFront(wo::World_GUI,ac::Actor)

Checks if there is an actor of type tree in front of actor ac.

This function is a wrapper around JuliaKara_noGUI.treeFront to support GUI.

source
treeLeft(wo::World,ac::Actor)

Checks if there is an actor of type tree left of actor ac.

source
treeLeft(wo::World_GUI,ac::Actor)

Checks if there is an actor of type tree left of actor ac.

This function is a wrapper around JuliaKara_noGUI.treeLeft to support GUI.

source
treeRight(wo::World,ac::Actor)

Checks if there is an actor of type tree right of actor ac.

source
treeRight(wo::World_GUI,ac::Actor)

Checks if there is an actor of type tree right of actor ac.

This function is a wrapper around JuliaKara_noGUI.treeRight to support GUI.

source
mushroomFront(wo::World,ac::Actor)

Checks if there is an actor of type mushroom in front of actor ac.

source
mushroomFront(wo::World_GUI,ac::Actor)

Checks if there is an actor of type mushroom in front of actor ac.

This function is a wrapper around JuliaKara_noGUI.mushroomFront to support GUI.

source
onLeaf(wo::World,ac::Actor)

Checks if there is an actor of type leaf below of actor ac.

source
onLeaf(wo::World_GUI,ac::Actor)

Checks if there is an actor of type leaf below of actor ac.

This function is a wrapper around JuliaKara_noGUI.onLeaf to support GUI.

source

Index