Monday, December 14, 2015

HAPPY HOLIDAYS

 Created with EViews program xmas.prg.
Best Wishes And Warmest Thoughts
For A Wonderful Holiday
And A Happy New Year.

1. logmode -e
setmaxerrs 2
!builddate = @dateval(@builddatestr)
if @vernum = 9 and @errorcount>0 then
@uiprompt(%msg)
stop
endif

create u 36
smpl if @mod(@trend,2)=0
series x=@trend
series y=-@trend
smpl if @mod(@trend,2)>0
x=@trend-5
x = @recode(x<=0, @trend/2.5, x)
y=-@trend+5
y = @recode(y>=0, -@trend/2.5, y)
smpl 7 31
x = x * (1 + nrnd/100)
y = y * (1 + nrnd/100)
smpl 1 1
x=na
y=na
smpl 32 36
x=3
y=-3

for !count = 5 to 32 step 4
smpl !count !count
series tinsel = x
smpl !count+2 !count+2
series tinsel = y
smpl !count+1 !count+1
series tinsel = (tinsel(-1)+tinsel(+1))/2 + 40/(36-@trend)
next

group all x y tinsel
smpl @all
freeze(tree) all.band(l,rotate)
tree.setelem(1) axis(b)
tree.setelem(2) axis(b)
tree.setelem(3) axis(b)
tree.options size(2.6,3) -barspace fillcolor(0,0,107)
tree.setelem(1) fillcolor(0,168,0)
tree.setelem(1) linecolor(white)
tree.setelem(1) linewidth(2)
tree.legend -display
tree.axis(l) -label ticksnone range(0,36)
tree.axis(b) -label ticksnone range(-40,40)
tree.addrect axisctr(0,34) height(2) width(4) linewidth(5) color(64,0,0)
tree.addrect axisctr(0,34) height(5) width(4) linewidth(5) color(64,0,0)

'random balls
!ball = 0
while !ball < 50
!y = @floor(@runif(3,32))
!x = @round(@runif(@min(y),@max(x)))
if @abs(!x/!y) < 1 then
tree.addellipse axisctr(!x,!y,b) height(0.1) width(0.1) color(red) linewidth(5)
!ball = !ball + 1
endif
wend

'random snow
!snow = 0
while !snow < 200
!y = @floor(@runif(1,35))
!x = @round(@runif(-40,40))
if @abs(!x/!y) > 1 or (!y > 32 and @abs(!x)>4) then
tree.addellipse axisctr(!x,!y,b) height(0.1) width(0.1) color(white) linewidth(1)
!snow = !snow + 1
endif
wend