This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import unittest | |
import cloudstorage | |
GOOGLE_APP_ENGINE_PATH = os.environ.get("GAE_PATH") | |
sys.path.append(GOOGLE_APP_ENGINE_PATH + 'lib/yaml-3.10') | |
from google.appengine.ext import testbed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface FlyingMonster { | |
public void fly(int speed); | |
} | |
public interface MagicMonster { | |
public void spendMana(int points); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LivingThing() { | |
// ...other code in the class... | |
} | |
public class Dragon extends LivingThing { | |
// ...Dragon-specific code in the class... | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LivingThing { | |
public String name; | |
private int health; | |
//class other code | |
} | |
hero = LivingThing("Elsa", 50, 80, "Axe"); | |
// ...some more code... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LivingThing() { | |
// ...code in the class... | |
} | |
hero = LivingThing("Elsa", 50, 80, "Axe"); | |
// ...some more code... | |
if (someCondition) { | |
hero.health -= 50; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LivingThing() { | |
// ...other code in the class... | |
public void takeDamage(int amount) { | |
this.health = this.health - amount; | |
if (this.health <= 0) { | |
print(this.name + " is dead!"); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void takeDamage(livingThingObject, dmgAmount) { | |
livingThingObject.health = livingThingObject.health - dmgAmount | |
if (livingThingObject.health < 0) { | |
print(livingThingObject.name + ' is dead!') | |
} | |
} | |
hero = LivingThing("Elsa", 50, 80, "Axe"); | |
takeDamage(hero, 10); // Elsa takes 10 points of damage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hero = LivingThing("Elsa", 50, 80, "Axe"); | |
hero.health -= 10; // Elsa takes 10 points of damage | |
if (hero.health < 0) { | |
print(hero.name + ' has died!') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hero = LivingThing("Elsa", 50, 80, "Axe"); | |
hero.health -= 10 // Elsa takes 10 points of damage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LivingThing { | |
public String name; | |
public int health; | |
public int magicPoints; | |
public String attack; | |
public int hunger; | |
public LivingThing(String name, int health, int magicPoints, String attack) { | |
this.name = name; | |
this.health = health; |
NewerOlder