public static void main(String[] args) {
		List<Pattern> patternList = new LinkedList<Pattern>();
		try{
			if (args[0].startsWith("http://"))
			{patternList = PatternLoader.loadFromURL(args[0]);}
			else 
			{patternList = PatternLoader.loadFromDisk(args[0]);}
			try{
				int index = Integer.parseInt(args[1]);
				if (index < 0 || patternList.size()<=index){
					throw new NumberFormatException("Pattern number isn't in array");
				}
				Pattern p = patternList.get(index);
				boolean[][] world = new boolean[p.getHeight()][p.getWidth()];
				p.initialise(world);
				play(world);
			}
			catch (ArrayIndexOutOfBoundsException e){
				for (int i = 0; i<patternList.size();i++){
					Pattern p=patternList.get(i);
					System.out.println(i+") "+p.format());
				}
			}
		}
		catch (NumberFormatException e){
			System.out.println("Error"+e.getMessage());
		}
		catch (IOException e){
			System.out.println("Error in stream input");
		}
		catch (ArrayIndexOutOfBoundsException e){
			System.out.println("Incorrect number of arguments, expected\n[ URL | FILE ] [INDEX]");
		}
	}