RosettaCodeData/Task/Pinstripe-Display/Tcl/pinstripe-display.tcl
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

17 lines
493 B
Tcl

package require Tcl 8.5
package require Tk 8.5
wm attributes . -fullscreen 1
pack [canvas .c -highlightthick 0] -fill both -expand 1
set colors {black white}
set dy [expr {[winfo screenheight .c]/4}]
set y 0
foreach dx {1 2 3 4} {
for {set x 0} {$x < [winfo screenwidth .c]} {incr x $dx} {
.c create rectangle $x $y [expr {$x+$dx}] [expr {$y+$dy}] \
-fill [lindex $colors 0] -outline {}
set colors [list {*}[lrange $colors 1 end] [lindex $colors 0]]
}
incr y $dy
}