mirror of
https://codeberg.org/andyscott/exercism.git
synced 2024-11-09 13:20:48 -05:00
576 B
576 B
Hints
1. Create the Alien
Class
- The
constructor
does not have a return type and has the same name as theclass
. - 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.