Weird little math problem

Blitz3D Forums/Blitz3D Programming/Weird little math problem

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Something like this?

Const ArraySize = 30

Dim testArray(ArraySize*ArraySize)


SetArray(2,2,5)
SetArray(3,3,10)

;MAIN LOOP
While Not KeyDown(1)
	Print GetArray(2,2)
	Print GetArray(3,3)
	WaitKey()
	Wend
End
;END MAIN LOOP


Function SetArray(i1,i2, value)
	testArray( (i1 * ArraySize) +i2) = Value
End Function


Function GetArray(i1,i2)
	Return testArray( (i1 * ArraySize) +i2)
End Function


*EDIT*
Damn, beaten to the post.