#copying array in nodeJS
33 messages · Page 1 of 1 (latest)
Haha. why?
It's correct.
For example.
const arrowsBuf = [1,2,3,4,5,6,7]
const arrows = [ ...arrowsBuf ]
arrows.pop()
console.log(arrowsBuf, arrows)
output
[1,2,3,4,5,6,7]
[1,2,3,4,5,6]
ok i redid the test a little diffrently and it seems to work now, but i still have a prob not in this question though
how do i close the question?
screenshot
ok
so what i just send is a function that tries to use a simple algorithm to pathfind in minecraft using mineflayer
This is BFS algorithm?
its supposte to spawn arrow blocks around the target outward
if theres a block dont spawn
idk the name of the algorithm
the target is gold and this is the first iteration
What is the error here?
well when iteration number 2 happens, instead of growing by 1 block it grows in +x and +z like this:
and also i had to manually put the gold block because it also gets replaced for some reason
Only these button have to show?
no, thats the second iteration so 1 more block outward, since the program doesnt work ill try to show aproximently how it should look
Hm... I don't know what is what only see this.
should i add comments to the code?