Skip to content

Instantly share code, notes, and snippets.

@housemeow
Created October 18, 2013 12:02
Show Gist options
  • Select an option

  • Save housemeow/7040572 to your computer and use it in GitHub Desktop.

Select an option

Save housemeow/7040572 to your computer and use it in GitHub Desktop.
boolean canPut(float x, float y){
if(25<x && x<=120){
//x左邊
if(130<y && y<=225){
//y上方
if(topLeft==0){
//沒有放過旗子
topLeft =1;
return true;
}
}else if(225<y && y<=320){
//y中間
if(left==0){
//沒放過旗子
left =1;
return true;
}
}else if(320<y && y<=415){
//y下方
}
}else if(120<x && x<=215){
//x正中間
}else if(x<215 && x<=310){
//x右邊
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment