function octagon takes real StartX, real StartY, real Length returns nothing
local integer i = 0
loop
exitwhen i > 7
set Location[i] = Location(StartX + Length * Cos((360/8)*i),StartY + Length * Sin((360/8)*i))
set i = i + 1
endloop
endfunction