Skip to content

Instantly share code, notes, and snippets.

@franksands
franksands / gcs_list_files.py
Created January 24, 2020 17:48
list files in cloud store
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
public interface FlyingMonster {
public void fly(int speed);
}
public interface MagicMonster {
public void spendMana(int points);
}
public class LivingThing() {
// ...other code in the class...
}
public class Dragon extends LivingThing {
// ...Dragon-specific code in the class...
}
public class LivingThing {
public String name;
private int health;
//class other code
}
hero = LivingThing("Elsa", 50, 80, "Axe");
// ...some more code...
class LivingThing() {
// ...code in the class...
}
hero = LivingThing("Elsa", 50, 80, "Axe");
// ...some more code...
if (someCondition) {
hero.health -= 50;
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!");
}
}
}
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
hero = LivingThing("Elsa", 50, 80, "Axe");
hero.health -= 10; // Elsa takes 10 points of damage
if (hero.health < 0) {
print(hero.name + ' has died!')
}
hero = LivingThing("Elsa", 50, 80, "Axe");
hero.health -= 10 // Elsa takes 10 points of damage
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;