public class Right extends Instruction
The value returned by evaluating a RIGHT instruction is the expression itself, representing the degrees to turn the turtle to the right.
Modifier and Type | Field and Description |
---|---|
private GrammarElement |
expression |
gelementsToValue
Constructor and Description |
---|
Right(GrammarElement e)
Constructs a RIGHT instruction that can be executed.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
evaluate(Context c)
Evaluate this instruction in a Context.
|
java.lang.String |
toString() |
private GrammarElement expression
public Right(GrammarElement e)
e
- number of degrees to turn to the rightpublic java.lang.Object evaluate(Context c)
evaluate
in class Instruction
c
- the Context for the evaluationpublic java.lang.String toString()
toString
in class java.lang.Object