// Path: app/src/main/java/com/tos_bot/puzzleslove/solution.java
// @SuppressLint("NewApi")
// public class solution implements Comparator<solution> {
// 	public int[][] board;
// 	public int[][] currentboard;
// 	public pos cursor;
// 	public pos initcursor;
// 	public ArrayList<Integer> path;
// 	public boolean is_done;
// 	public ArrayList<matchPair> matches;
// 	public solution(int[][] inboard,pos c,pos ic,ArrayList<Integer> p,boolean done,ArrayList<matchPair> m){
// 		board = new int[5][6];
// 		for(int i =0;i<5;i++)
// 			for(int j=0;j<6;j++)
// 				board[i][j] = inboard[i][j];
// 		cursor = c;
// 		initcursor = ic;
// 		path = new ArrayList<Integer>();
// 		path.addAll(p);
// 		is_done = done;
// 		matches = m;
// 	}
// 	public solution(){
// 		
// 	}
//     public int compare(solution a, solution b) {
//         return Integer.signum(a.matches.size() - b.matches.size());
//     }
//     public void setCB(int[][] b){
//     	currentboard = new int[5][6];
// 		for(int i =0;i<5;i++)
// 			for(int j=0;j<6;j++)
// 				currentboard[i][j] = b[i][j];
//     }
//  
// 	
// }


import java.util.ArrayList;
import java.util.regex.Pattern;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.tos_bot.puzzleslove.solution;
package com.tos_bot.utility;




/**
 * 原本puzzle server會回傳一組json裡面包含所有solution
 * 為了節省流量將puzzle server只回傳最高分數的那組,所以這
 * 個class沒有使用了.
 * 
 * @author frankwang
 *
 */
public class jsonToSolution {
	public static boolean cmdDone;

// Path: app/src/main/java/com/tos_bot/puzzleslove/solution.java
// @SuppressLint("NewApi")
// public class solution implements Comparator<solution> {
// 	public int[][] board;
// 	public int[][] currentboard;
// 	public pos cursor;
// 	public pos initcursor;
// 	public ArrayList<Integer> path;
// 	public boolean is_done;
// 	public ArrayList<matchPair> matches;
// 	public solution(int[][] inboard,pos c,pos ic,ArrayList<Integer> p,boolean done,ArrayList<matchPair> m){
// 		board = new int[5][6];
// 		for(int i =0;i<5;i++)
// 			for(int j=0;j<6;j++)
// 				board[i][j] = inboard[i][j];
// 		cursor = c;
// 		initcursor = ic;
// 		path = new ArrayList<Integer>();
// 		path.addAll(p);
// 		is_done = done;
// 		matches = m;
// 	}
// 	public solution(){
// 		
// 	}
//     public int compare(solution a, solution b) {
//         return Integer.signum(a.matches.size() - b.matches.size());
//     }
//     public void setCB(int[][] b){
//     	currentboard = new int[5][6];
// 		for(int i =0;i<5;i++)
// 			for(int j=0;j<6;j++)
// 				currentboard[i][j] = b[i][j];
//     }
//  
// 	
// }


// Path: app/src/main/java/com/tos_bot/utility/jsonToSolution.java
import java.util.ArrayList;
import java.util.regex.Pattern;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.tos_bot.puzzleslove.solution;

package com.tos_bot.utility;




/**
 * 原本puzzle server會回傳一組json裡面包含所有solution
 * 為了節省流量將puzzle server只回傳最高分數的那組,所以這
 * 個class沒有使用了.
 * 
 * @author frankwang
 *
 */
public class jsonToSolution {
	public static boolean cmdDone;

	public static ArrayList<solution> passJsonToSol(String str) {