Skip to content

Instantly share code, notes, and snippets.

@chikien276
Last active September 24, 2016 07:27
Show Gist options
  • Save chikien276/6a1892ed96e6d510c98519cd16162920 to your computer and use it in GitHub Desktop.
Save chikien276/6a1892ed96e6d510c98519cd16162920 to your computer and use it in GitHub Desktop.
class plant{
id: string;
damage: int;
hp: int;
attack: int;
attkSpeed: int;
static final int maxHp = 10;
int getSpeed(){
return attkSpeed;
}
void increaseSpeed(spd: int){
if (spd > 0){
this.speed := this.speed + spd;
}
}
void print(){
}
}
class zoombie{
id: string;
attkSpeed: int;
damage: int;
hp: int;
static final int maxHp := 10;
int getShot(){
return attkSpeed;
}
}
class sum{
int cal(input: int){
sum: int;
sum := 0;
for i:= 1 to input do
sum := sum + i;
return sum;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment