Skip to content

Instantly share code, notes, and snippets.

@alexchiri
Created January 13, 2013 20:00
Show Gist options
  • Save alexchiri/4525905 to your computer and use it in GitHub Desktop.
Save alexchiri/4525905 to your computer and use it in GitHub Desktop.
package com.alexchiri;
import com.alexchiri.bank.Bank;
import com.alexchiri.bank.MoneyBag;
import com.alexchiri.robber.Heist;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
/**
* Alexandru Chiritescu
* 13-1-13
*/
public class CrimeSetup {
public static void main(String[] args) {
List<MoneyBag> moneyBags = new ArrayList<MoneyBag>();
int randomNumber = Math.abs(new Random().nextInt(10));
System.out.println("Random number of money bags to load the safe with: " + randomNumber);
for(int i = 0; i< randomNumber; i++) {
moneyBags.add(new MoneyBag());
}
Bank bank = new Bank(moneyBags, "Cool bank");
Heist heist = new Heist("Kansas", 2, bank);
new Thread(heist).start();
Heist heist2 = new Heist("Charlie's Angels", 3, bank);
new Thread(heist2).start();
Heist heist3 = new Heist("Lottery ticket", 3, bank);
new Thread(heist3).start();
Heist heist4 = new Heist("Who wants to be a millionaire?", 4, bank);
new Thread(heist4).start();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment