lambdaway
::
color_bar_display
5
|
list
|
login
|
load
|
|
_h1 pinStripe _h2 1) N&B _ul [[https://rosettacode.org/wiki/Pinstripe/Display|https://rosettacode.org/wiki/Pinstripe/Display]] {pre '{def window {lambda {:w :h} div {@ style="position:relative; top:0; left:0; width::wpx; height::hpx; background:#eee;"}}} -> {def window {lambda {:w :h} div {@ style="position:relative; top:0; left:0; width::wpx; height::hpx; background:#eee;"}}} '{def rec {lambda {:x :y :w :h :c} {div {@ style="position:absolute; top::ypx; left::xpx; width::wpx; height::hpx; background::c;"}}}} -> {def rec {lambda {:x :y :w :h :c} {div {@ style="position:absolute; top::ypx; left::xpx; width::wpx; height::hpx; background::c;"}}}} '{def row {lambda {:w :h :k} {S.map {{lambda {:dx :dy :h :i} {rec :i :dy :dx :h #000} {rec {+ :i :dx} :dy :dx :h #fff} } {pow 2 :k} {* :k {/ :w 8}} {/ :h 4}} {S.serie 0 {- :w 1} {pow 2 {+ :k 1}}}}}} -> {def row {lambda {:w :h :k} {S.map {{lambda {:dx :dy :h :i} {rec :i :dy :dx :h #000} {rec {+ :i :dx} :dy :dx :h #fff} } {pow 2 :k} {* :k {/ :w 8}} {/ :h 4}} {S.serie 0 {- :w 1} {pow 2 {+ :k 1}}}}}} '{def WIDTH 640} -> {def WIDTH 640} '{def HEIGHT 480} -> {def HEIGHT 480} '{{window {WIDTH} {HEIGHT}} {S.map {row {WIDTH} {HEIGHT}} 0 1 2 3 4}} -> } {{window {WIDTH} {HEIGHT}} {S.map {row {WIDTH} {HEIGHT}} 0 1 2 3 4}} _h2 2) 8 colors _ul [[https://rosettacode.org/wiki/Colour_pinstripe/Display#BASIC256|https://rosettacode.org/wiki/Colour_pinstripe/Display#BASIC256]] {pre w = 640 : h = 480 graphsize w, h dim k = '{black, red, green, blue, purple, cyan, yellow, white} h /= 4 for i = 1 to 4 col = 0 y = (i-1) * h for x = 1 to w step i if col mod 8 = 0 then col = 0 colour k[col] rect (x, y, x + i, y + h) col += 1 next x next i }
lambdaway v.20211111