Groovy web console

subscribe to the feed Subscribe
to this
site

Test

Published 5 years ago by test
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
[1,1,1,1]//[N,E,S,W]
def fui(l) {t='+-----+';s='     ';m='|     |';x='-----';v=(1..5).collect{s};n=(1..5).collect{[s,((it%2)?'|  |  |':m),s]};e=[x,s,'- - -',s,x];c=[l[3]?e:v,[t,m,m,m,t],l[1]?e:v];(l[0]?n.collect{it}:[])+((0..4).collect{x->((0..2).collect{y->c[y][x]})})+(l[2]?n.collect{it}:[])}
fui([0,0,0,0]).collect{it.join()}.join('\n')