Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- class Board{
- private Box[][] board= new Box[10][10];
- void add(Box b) {
- board[b.getI()][b.getJ()]=b;
- }
- }
- class Box{
- private int i,j;
- Box(int i, int j)
- {
- this.i=i;
- this.j=j;
- }
- int getI()
- {
- return i;
- }
- int getJ()
- {
- return j;
- }
- }
- class Special extends Box{
- private boolean isHead;
- private boolean isSnake;
- private int pairId;
- private boolean specialObject;
- Special(int i0, int j0, boolean isHead0, int pairId0, boolean isSnake0,boolean specialObject0){
- super(i0,j0);
- isHead0=isHead;
- pairId0=pairId;
- isSnake0=isSnake;
- specialObject0=specialObject;
- }
- }
- class Die{
- private int dieValue;
- int roll(){
- Random rn = new Random();
- dieValue=rn.nextInt(6);
- return dieValue;
- }
- }
- class PlayerPiece{
- private int location;
- }
- class SnakeLadder{
- static void fillBoard(Board b){
- for (int i=0;i<10;i++){
- for(int j=0;j<10;j++){
- b.add(new Box(i,j));
- }
- }
- }
- public static void main (String [] args){
- System.out.println("Main");
- Board SLboard = new Board();
- fillBoard(SLboard);
- PlayerPiece Player1 = new PlayerPiece();
- PlayerPiece Player2 = new PlayerPiece();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment