Guest User

Untitled

a guest
Jun 25th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.13 KB | None | 0 0
  1. package oving4;
  2. import java.util.*;
  3.  
  4.  
  5. public class Sokoban
  6. {
  7.     char wall = '#';
  8.     char empty = ' ';
  9.     char target = '.';
  10.     char player = '@';
  11.     char pt = '+';
  12.     char box = '$';
  13.     char bt = '*';
  14.    
  15.     int y, x;
  16.     char c;
  17.    
  18.     public Sokoban()
  19.     {
  20.     }
  21.    
  22.     String [] level1 = {"*###########*",
  23.                         "#           #",
  24.                         "#  ... ...  #",
  25.                         "#  *$$ $.$  #",
  26.                         "# $*+$ $*$$ #",
  27.                         "#  *$$ $.$  #",
  28.                         "#  ...  .   #",
  29.                         "#           #",
  30.                         "*###########*"};
  31.     char [][] brett = new char [level1.length][level1[0].length()];
  32.     // for å få ut brettet!
  33.  
  34.    
  35.     public void fyllbrett(int x, int y)
  36.     {
  37.         for(y = 0; y < level1.length; y++)
  38.         {
  39.             for(x = 0; x < level1[0].length(); x++)
  40.             {
  41.                 brett[y][x] = level1[y].charAt(x);
  42.                 // vi trenger ikke to linjer, en for y og en for x. med å skrive slik får vi skrevet ut alt på en gang. alle rutene.
  43.                
  44.             }
  45.         }
  46.         System.out.println(brett);
  47.     }
  48.    
  49.    
  50.     public void run()
  51.     {
  52.        
  53.     }
  54.     public void setCell(int x, int y, char c)
  55.     {
  56.        
  57.     }
  58.    
  59. /*  public boolean isTarget(int x, int y)
  60.     {
  61.         return true;
  62.     }*/
  63.     public void doMove(int dx, int dy)
  64.     {
  65.        
  66.     }
  67.     }
Add Comment
Please, Sign In to add comment