|
颜色随机0123456789F
[codes=jass]function Color takes returns nothing
local integer i[0] = 0
local string s[0] = 0
set i[0] = 0
set i[1000] = 1
loop
exitwhen i[1000] > 8
set i[0] = ( i[0] + 1 )
set i[i[0]] = GetRandomInt(1, 16)
if ( not ( i[i[0]] >= 10 ) ) then
if ( return ( i[i[0]] == 10 ) ) then
set s[( 1000 + i[0] )] = "A"
else
endif
if ( return ( i[i[0]] == 11 ) ) then
set s[( 1000 + i[0] )] = "B"
else
endif
if ( return ( i[i[0]] == 12 ) ) then
set s[( 1000 + i[0] )] = "C"
else
endif
if ( return ( i[i[0]] == 13 ) ) then
set s[( 1000 + i[0] )] = "D"
else
endif
if ( return ( i[i[0]] == 14 ) ) then
set s[( 1000 + i[0] )] = "E"
else
endif
if ( return ( i[i[0]] == 15 ) ) then
set s[( 1000 + i[0] )] = "F"
else
endif
else
set s[( 1000 + i[0] )] = I2S(i[i[0]])
endif
set i[1000] = i[1000] + 1
else
endif
endloop
set s[0] = ( "|C" + ( s[1001] + ( s[1002] + ( s[1003] + ( s[1004] + ( s[1005] + ( s[1006] + ( s[1007] + s[1008] ) ) ) ) ) ) ) )
call DisplayTimedTextToForce( GetPlayersAll(), 0.01, ( s[0] + ( "随机颜色" + "|R" ) ) )
endfunction[/codes] |
-
|