mirror of
https://codeberg.org/andyscott/exercism.git
synced 2024-12-22 14:43:10 -05:00
22 lines
576 B
Markdown
22 lines
576 B
Markdown
|
# Hints
|
||
|
|
||
|
## 1. Create the `Alien` Class
|
||
|
|
||
|
- The `constructor` does not have a return type and has the same name as the `class`.
|
||
|
- A common convention for `classes` is using names in __PascalCase__.
|
||
|
|
||
|
## 2. The `hit` Function
|
||
|
|
||
|
- Remember the invariant: health points can't be negative.
|
||
|
|
||
|
## 3. The `is_alive` Function
|
||
|
|
||
|
- life points at `0` is the only 'dead' condition.
|
||
|
|
||
|
## 4. The `teleport` Function
|
||
|
|
||
|
- Member variables can be updated by any function of the class.
|
||
|
|
||
|
## 5. The `collision_detection` Function
|
||
|
|
||
|
- All `public` member variables can be accessed from outside the class.
|