Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean buscaBloco(int x, int y) {
- mensageiro.mensagem(mensageiro.BUSCA, x, y);
- if(sala.marcadorEm(x, y) == ISala.BLOCO_PRESENTE){
- mensageiro.mensagem(mensageiro.CAPTURA, x, y);
- sala.marcar(x, y, ISala.POSICAO_VAZIA);
- return true;}
- sala.marcar(x, y, ISala.MARCA_PRESENTE);
- if(testaPasso(x, y, DIREITA_X, DIREITA_Y))return true;
- if(testaPasso(x, y, BAIXO_X, BAIXO_Y))return true;
- if(testaPasso(x, y, ESQUERDA_X,ESQUERDA_Y))return true;
- if(testaPasso(x, y, CIMA_X, CIMA_Y))return true;
- return false;}
- public void buscaBlocos() {
- boolean resultado = true;
- while(BLOCOS_RESTANTES > 0 && resultado == true){
- resultado = buscaBloco(POS_X,POS_Y);
- if(resultado){
- if(guardaBloco())sala.removeMarcador(ISala.MARCA_PRESENTE);}}
- if(BLOCOS_RESTANTES == 0)mensageiro.msgFim();
- else mensageiro.msgNaoAchou();}
Advertisement
Add Comment
Please, Sign In to add comment