Guest User

Untitled

a guest
Jul 15th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. x = y = (size + 1) / 2;
  2. matrix[x][y]=1; //default of the matrix
  3.  
  4. x1=y1=rand()%(size-1); //random selection of matrix position
  5.  
  6. number= switch(rand() %4){
  7. case 0;
  8. matrix[x1][0]==1;
  9. break;
  10. case 1;
  11. matrix[size-1][y1]==1;
  12. break;
  13. case 2;
  14. matrix[0][y1]==1;
  15. break;
  16. case 3;
  17. matrix[x1][size-1]==1;
  18. break
  19. }
Add Comment
Please, Sign In to add comment