title: I just need to make this code working on p5.js as my code isn't really functioning
body: <ol>
  <li><p>just need to edit this code to make it working</p>
  </li>
  <li><p>I think I placed the coords in the wrong section so please assist if possible.</p>
  </li>
  </ol>
  <pre><code>    let loadTSP;
      let loadSol;
      let City = new Array();
      citySize = 12;
      let minX, maxX, minY, maxY;
      let mulX,mulY;
  
      var myData = [{id: [0]},{xCords: [1]},{yCords: [2]}];
      function preload() {
        loadTSP = loadStrings(&quot;TSP_EUC_Problems/berlin52.tsp&quot;);
        // loadTSP = loadStrings(&quot;TSP_EUC_Problems/a280.tsp&quot;); 
        // loadTSP = loadStrings(&quot;TSP_EUC_Problems/ch150.tsp&quot;); 
        // loadSol = loadSol(solutionFileName);
        // loadSol = loadStrings(solutionFileName);
      }
  
      function setup() {
        createCanvas(windowWidth, windowHeight);
        background(255, 200, 200);
  
  
        coords = new Array(myData.length);
        showLoadedTSP();
        showSolution();
        coords[i].x = map(coords[i].x,minX,maxX,0,width);
        coords[i].y = map(coords[i].y,minY,maxY,0,height);
      //   minX = myData[i][1], myData[i][2];
      //   maxX = myData[i][1], myData[i][2];
      //   minY = myData[i][1], myData[i][2];
      //   maxY = myData[i][1], myData[i][2];
  
  
  
      //   if (coords[i].x &gt; maxX) {
      //     maxX = coords[i].x
      //   }
      //   if (coords[i].x &lt; minX) {
      //     minX = coords[i].x
      //   }
      //   if (coords[i].y &gt; maxY) {
      //     maxY = coords[i].y
      //   }
      //   if (coords[i].y &lt; minY) {
      //     minY = coords[i].y
      //   }
      // }
       
      // let coords = map(maxX, 0,maxY) 
  
  
      function showLoadedTSP() {
        loadTSP.splice(0, 6); // removes first 6 lines of file 
        loadTSP.splice(loadTSP.length - 1, 1)
        for (let i = 0; i &lt; loadTSP.length; i++) { // loops through the length of the tsp file 
          myData[i] = split(loadTSP[i], ' ');  //
         
          if (myData[i].length &gt; 3) { // if more than 3 parameters in file it removes excess 
            let voidSpaces = myData[i].length - 3;
            myData[i].splice(0, voidSpaces);
          
          }
          for(let i= 0; i &lt; myData.length; i++){
            stroke(255);
            strokeWeight(2);
            fill(&quot;blue&quot;);
              ellipse(myData[i][1], myData[i][2], citySize); // draws the ellipse from the x, y coordinate
          } 
         // use map function to scale 
  
  
        }
        console.log(myData);
      }
  
      function showSolution() {
  
      }
  
      function draw() {
  
        // berlin52
        text(&quot;berlin52&quot;, 100,80);
        text(&quot;Berlin&quot;, 100,100);
        text(&quot;52 cities&quot;, 100,120);
      //ludwig a280
        // text(&quot;a280&quot;, 100,80);
        // text(&quot;Ludwig&quot;, 100,100);
        // text(&quot;280 cities&quot;, 100,120);
  
        // ch150
      // text(&quot;ch150&quot;, 100,80);
      //   text(&quot;churritz&quot;, 100,100);
      //   text(&quot;150 cities&quot;, 100,120);
      }
      }
  </code></pre>