Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int aleatorio=(int)Math.floor(Math.random()*4);
- int aleatorio2=(int)Math.floor(Math.random()*7+2);
- int aleatorio0=(int)Math.floor(Math.random()*5);
- int aleatorio3=aleatorio2+aleatorio0;
- for(int z=0;z<map.length;z++){
- for(int x=0;x<map[z].length;x++){
- switch(aleatorio){
- case 0:
- map[0][x]=new Square(2);
- if(x>aleatorio2){
- map[1][x]=new Square(2);
- }
- if(x>aleatorio3){
- map[2][x]=new Square(2);
- }
- break;
- case 1:
- map[9][x]=new Square(2);
- if(x>aleatorio2){
- map[8][x]=new Square(2);
- }
- if(x>aleatorio3){
- map[7][x]=new Square(2);
- }
- break;
- case 2:
- map[z][0]=new Square(2);
- if(z>aleatorio2){
- map[z][1]=new Square(2);
- }
- if(z>aleatorio3){
- map[z][2]=new Square(2);
- }
- break;
- case 3:
- map[z][9]=new Square(2);
- if(z>aleatorio2){
- map[z][8]=new Square(2);
- }
- if(z>aleatorio3){
- map[z][7]=new Square(2);
- }
- break;
- default:;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement