Please check the attachment. The issue is that if I run more than 1 thread all the threads write to the same array even though each thread have their own thread number and are supposed to write at array X coordinate corresponding to their thread number.
I've been pulling my hair out trying multiple different ways of making it work to no avail.
Any help would be greatly appreciated. Sorry in advance for the messy code, I quickly ripped out everything from it that isn't relating to the issue at hand.