Nherwyziant
Be better than you were yesterday :D
- Reaction score
- 96
JASS:
//Here, I made a loop test.
scope LoopTest
globals
private constant integer COUNT = 5 //Number of loops
endglobals
private struct S1
private real r1
private real r2
private real r3
private integer i
private real array ra1[COUNT]
private real array ra2[COUNT]
private real array ra3[COUNT]
private static method onInit takes nothing returns nothing
local thistype this = thistype.create()
set .i = 0
loop
set .i = .i+1
set .r1 = GetRandomReal(0,700)
set .r2 = GetRandomInt(0,360)*bj_DEGTORAD
set .ra1[.i] = 0+.r1*Cos(.r2)
set .ra2[.i] = 0+.r1*Sin(.r2)
set .r3 = SquareRoot((.ra1[.i]-0)*(.ra1[.i]-0)+(.ra2[.i]-0)*(.ra2[.i]-0))
set .ra3[.i] = .r3/(.r3*.03125)
call BJDebugMsg("======")
call BJDebugMsg(R2S(.r3)+": Distance / ( Distance * 0.03125 ) is equal to...")
call BJDebugMsg(R2S(.ra3[.i]))//Shows wrong value?
//.ra3[.i] shows same values on all loops
exitwhen .i == COUNT
endloop
endmethod
endstruct
endscope
//Or is there something wrong?