Friday, May 23, 2014

Hoardomatic Code: Doing Something With It

Clever readers will have realized that everything I've posted up to this point doesn't actually do anything. There's a bundle of classes and data representing everything from a pile of treasure down to details of decor, but what to do with it? Ultimately, all one needs to randomly generate a hoard is something like the code below, which generates a hoard of random items worth $2,000. For a bigger or smaller hoard, just change the value of hoard_val.

package hoardomatic;

public class goMonkeygo {
    public static void main(String[] args) {
        Double hoard_val = 2000.0;
        Hoard avarice = new Hoard(hoard_val);
        System.out.println(avarice.hoardReport() );
    }
}





No comments: