Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TextView mTextView;
- for(int i=0;i<16;i++) {
- for(int j=0;j<2;j++) {
- mTextView.setText(""+table[i][j]);
- }
- for(int i=0;i<16;i++) {
- for(int j=0;j<2;j++) {
- mTextView.append(""+table[i][j]);
- }
- mTextView.append("n");
- }
- int x = 1;
- for (int i = 0; i < 16; i++){
- table[i][0] = x;
- x++;
- boolean found = false;
- int emptyCell = 0;
- id = mEditProcess.getText().toString();
- size = mEditProcessSize.getText().toString();
- final int idInt = Integer.parseInt(id);
- final int sizeInt = Integer.parseInt(size);
- int count = 0;
- for (int i = 0; i < 16; i ++) {
- if table[i][1]=0; { //Look for first empty cell
- if found = false {
- emptyCell = i //Saves the starting cell
- found = true //emptyCell cannot be changed
- } count ++;
- if (count = sizeInt) break; //this section has enough space
- }
- found = false; //the section wasn't big enough keep searching
- }
- for x < sizeInt
- table[emptyCell][1]=idInt; //this cell has process id number x and takes
- //up y blocks
- emptyCell++;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement