Changes
Page history
add rotate code to ex1
authored
Apr 17, 2015
by
Lasse Brøsted Pedersen
Show whitespace changes
Inline
Side-by-side
Lesson-7.markdown
View page @
db22aa7c
...
...
@@ -44,7 +44,20 @@ if(leftDistance < stopThreshold &&
}
```
The full code is
The
`rotate`
function added to the
`PrivateCar`
class is defined as follows:
```
java
public
void
rotate
(
boolean
left
,
int
power
)
{
int
leftControl
=
left
?
backward
:
forward
;
int
rightControl
=
left
?
forward
:
backward
;
leftMotor
.
controlMotor
(
power
,
leftControl
);
rightMotor
.
controlMotor
(
power
,
rightControl
);
}
```
The full code is available at [Single behavior].
## Concurrent behaviors
...
...
...
...