Guest User

Untitled

a guest
Jul 23rd, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. private void lineToNode(String line, int matrixLine) {
  2.  
  3. if (matrixLine <= mazeDimensions.height) { //PROBLEM HERE...
  4. String[] nodesLine = line.split("\s+");
  5.  
  6. for (int matrixColumn = 0; matrixColumn < nodesLine.length; matrixColumn++) {
  7. Node node;
  8. Dimension currentPosition = new Dimension(matrixColumn, matrixLine);
  9.  
  10. if (currentPosition.equals(startPoint)) {
  11. node = new Node(NodeType.START);
  12. } else if (currentPosition.equals(endPoint)) {
  13. node = new Node(NodeType.END);
  14.  
  15. 5 5 //Dimensions of square
  16. 1 1 //Start point
  17. 3 3 //End point
  18. 1 1 1 1 1
  19. 1 0 1 0 1
  20. 1 0 1 0 1
  21. 1 0 0 0 1
  22. 1 1 1 1 1
  23.  
  24. 5 6 //Dimensions of rectangle
  25. 1 1 //Start point
  26. 3 4 //End point
  27. 1 1 1 1 1
  28. 1 0 0 0 1
  29. 1 0 1 0 1
  30. 1 0 1 0 1
  31. 1 0 1 0 1
  32. 1 1 1 1 1
Add Comment
Please, Sign In to add comment