Ok im pretty lost here about what im supposed to do. I have been given a task for school.
I need to assign 25 locations on a 15x15 2d array randomly. For these locations i would simply use value of 1, and the other locations a value of 0.
My first task is to write this in pseudocode, but this leads on to writing it in VB6 so i hoped this forum would be a good place to start for help. Any and all help would be appreciated. Thanks a bundle.
heres a kindof example of what i think i should be doing (mightn be right though, and its in javascript)
Randomise Array in Javascript
If you need me to rephrase or nething just ask and tell me which part and ill try.
ps. sorry if its in the wrong section, i had a look through all of em, and this looked to be the most correct one
edit
![]()
im slowly figuring out the fake code stuff. im kinda lost though
wat ive figured is
'fill with 0's
until Y = 15 ( (until X = 15 ( array ( X ) = 0 ) X + 1 repeat )( array( Y ) = 0 ) y + 1 repeat )
For Count 1 to 25
'grid location
$randomX = randomnumber() * 15
$randomY = randomnumber() * 15
IF array( $randomX,$randomY ) = 1
Generate new random grid location
Else array( $randomX,$randomY) = 1
would that fill my 2d array with randomly placed 1's?![]()




edit
Reply With Quote