public static WordSearch loadFromFile(File file)
	{
		WordSearch wordSearch = new WordSearch();
		BufferedReader reader;
		List<Character> chars = new ArrayList<>();

		try
		{
			reader = new BufferedReader(new FileReader(file));

			int character;
			while ((character = reader.read()) != ':')
			{
				char c = (char) character;
				if (Character.isLetter(c))
					chars.add(c);
			}

			String wordLine = reader.readLine();
			wordSearch.words = wordLine.substring(0, wordLine.length() - 1).split(" ");

			reader.close();

		} catch (IOException e)
		{
			e.printStackTrace();
		}

		int size = (int) Math.sqrt(chars.size());

		char[][] grid = new char[size][size];
		int x = 0, y = 0;

		for (Character c : chars)
		{
			grid[x][y++] = c;
			if (y == size)
			{
				x++;
				y = 0;
			}
		}

		wordSearch.grid = grid;
		wordSearch.size = size;

		return wordSearch;
	}