Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. TextView mTextView;
  2.  
  3. for(int i=0;i<16;i++) {
  4. for(int j=0;j<2;j++) {
  5. mTextView.setText(""+table[i][j]);
  6. }
  7.  
  8. for(int i=0;i<16;i++) {
  9. for(int j=0;j<2;j++) {
  10. mTextView.append(""+table[i][j]);
  11. }
  12. mTextView.append("n");
  13. }
  14.  
  15. int x = 1;
  16. for (int i = 0; i < 16; i++){
  17. table[i][0] = x;
  18. x++;
  19.  
  20. boolean found = false;
  21. int emptyCell = 0;
  22.  
  23. id = mEditProcess.getText().toString();
  24. size = mEditProcessSize.getText().toString();
  25. final int idInt = Integer.parseInt(id);
  26. final int sizeInt = Integer.parseInt(size);
  27.  
  28. int count = 0;
  29. for (int i = 0; i < 16; i ++) {
  30. if table[i][1]=0; { //Look for first empty cell
  31. if found = false {
  32. emptyCell = i //Saves the starting cell
  33. found = true //emptyCell cannot be changed
  34. } count ++;
  35. if (count = sizeInt) break; //this section has enough space
  36. }
  37. found = false; //the section wasn't big enough keep searching
  38. }
  39.  
  40. for x < sizeInt
  41. table[emptyCell][1]=idInt; //this cell has process id number x and takes
  42. //up y blocks
  43. emptyCell++;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement