// ############################## START FUNC ############################################ // Integers: n,m, number_of_atoms // Integer matrix: connection_table // String matrix: atoms_connected_to // Strings: temp function neighbours(connection_table) { var n=0; var m=0; // temp is a strictly temporary variable used to avoid long expressions var temp=""; // Note that connection_table.length = the length in one dimension var number_of_atoms=connection_table.length; var atoms_connected_to=new Array(number_of_atoms); // ************ START LOOP (n) BELOW ********************* for(n=0;n0) temp=temp.substring(0,temp.length-1); atoms_connected_to[n]=temp.split(" "); } // ************ END OF LOOP (n) ABOVE ******************** return atoms_connected_to; } // ############################### end func ############################################