funk powa

BlitzMax Forums/BlitzMax Programming/funk powa

Red(Posted 2005) [#1]
I love func pointers. :)


Strict 

Local unknown:Int[](A)

Function known1:Int[](A)
	Print "known1 = "+A
	
	Local array[]=New Int[1]	
	array[0]=Rand(5)
	array[1]=Rand(5)
	Return array
End Function 

Function known2:Int[](A)
	Print "known2 = "+A
	
	Local array[]=New Int[1]	
	array[0]=Rand(50)
	array[1]=Rand(50)
	Return array
End Function


Function gimme_da_funk:Int[](A)( funkList:Int[](A)[] )
	Return funkList[Rand(1,2)]
EndFunction 

'**** START ******

unknown=gimme_da_funk( [ known1, known2 ] )
Local array[]=unknown(1000)
Print array[0]+" "+array[1]