Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.*;
- public class Bug
- {
- private int startingPoint;
- private char mrBug;
- private char placeholder;
- private int postition;
- private int matrixLength;
- private int matrixRows;
- private String lineGet;
- private String txtFile;
- private char[][] Data = new char[3][];
- /**
- Constructs a computer class with title, days, time and room
- */
- public Bug(int initialPosition, char bug, String inputFile)
- {
- startingPoint = initialPosition;
- mrBug = bug;
- txtFile = inputFile;
- }
- public void matrixPrinter()
- {
- System.out.print(Data);
- }//End of matrixBuilder Method
- public void matrixBuilder()
- {
- Scanner in = new Scanner(txtFile);
- matrixRows = 0;
- while (in.hasNextLine())
- {
- lineGet = in.next();
- matrixLength = lineGet.length();
- Data[matrixRows] = new char[matrixLength];
- for(int i = 0; i < matrixLength; i++)
- {
- placeholder = lineGet.charAt(i);
- Data[matrixRows][i]= placeholder;
- }//End of For
- matrixRows++;
- }//End of While
- in.close();
- }//End of matrixBuilder Method
- /**
- Gets the title
- @return the title
- */
- public void turn()
- {
- //return title;
- }
- public void move()
- {
- // your work here
- }
- /**
- Gets Postition
- @return the postition
- */
- public int getPostion()
- {
- return postition;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement