Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. package Project;
  2.  
  3. public class Rules {
  4.  
  5. public boolean goodMove(Board b, int i){
  6. return(isEmptyField(b,i) && isGravityValid(b,i) );
  7. }
  8.  
  9. public boolean isEmptyField(Board b, int i){
  10. return b.isEmptyField(i);
  11. }
  12.  
  13. public boolean isGravityValid(Board b, int i){
  14. if(i>=0 && i<=41){
  15. if(i>=35 && i<=41){
  16. return true;
  17. }
  18. else{
  19. if(b.isEmptyField(i+7)){
  20. return false;
  21. }
  22. else{
  23. return false;
  24. }
  25. }
  26. }else{
  27. return false;
  28. }
  29.  
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement