import java.net.*; import java.io.*; import java.util.*; public class Klient2{ public static void main(String[] arg) throws IOException{ int ise=-1; Socket sc=new Socket("127.0.0.1", 11111); PrintWriter kirjutaja=new PrintWriter(sc.getOutputStream()); BufferedReader lugeja=new BufferedReader( new InputStreamReader(sc.getInputStream()) ); kirjutaja.print("play corner jaagup\n"); kirjutaja.flush(); String rida=lugeja.readLine(); System.out.println(rida); String[] m=rida.split(" "); Halma1 h=new Halma1(); h.algseis( Integer.parseInt(m[0]), Integer.parseInt(m[1]), Integer.parseInt(m[2]), Integer.parseInt(m[3]) ); if(rida.endsWith("start")){ ise=1; } else { ise=2; rida=lugeja.readLine(); System.out.println(rida); m=rida.split(" "); h.astu( Integer.parseInt(m[0]), Integer.parseInt(m[1]), Integer.parseInt(m[2]), Integer.parseInt(m[3]) ); } while(true){ List k2igud=h.leiaK2igud(ise); int heakaik=-1; for(int i=0; iabi.x1 || abi.y2>abi.y1)){ heakaik=i; } if(ise==2 && (abi.x2