2019-08-12 14:33:39 +03:00
|
|
|
## Creating Classes (#3)
|
2019-07-15 17:01:04 +03:00
|
|
|
|
2019-08-12 14:33:39 +03:00
|
|
|
Create a `Robot` class with the following four member functions:
|
2019-10-10 18:58:14 +03:00
|
|
|
`right(steps: Int)`, `left(steps: Int)`, `down(steps: Int)` and
|
|
|
|
`up(steps: Int)`. Each function should display one of the following phrases
|
2019-08-12 14:33:39 +03:00
|
|
|
on the console:
|
2019-07-15 17:01:04 +03:00
|
|
|
|
2019-08-11 21:39:35 +03:00
|
|
|
```
|
2019-08-12 14:33:39 +03:00
|
|
|
Right N steps
|
|
|
|
Left N steps
|
|
|
|
Down N steps
|
|
|
|
Up N steps
|
2019-08-11 21:39:35 +03:00
|
|
|
```
|
|
|
|
|
2019-08-12 14:33:39 +03:00
|
|
|
where N is the provided number of steps.
|