Advertisement
Guest User

Untitled

a guest
Mar 11th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 0.44 KB | None | 0 0
  1. proc rotateImage {a} {
  2.     array set retVal {}
  3.     set retList {}
  4.    
  5.     for {set i 0} {$i < [llength [split [lindex $a 0] " "]]} {incr i} {
  6.         set row [split [lindex [lreverse $a] $i]]
  7.         set j 0
  8.         foreach val $row {
  9.             lappend retVal($j) $val
  10.             incr j
  11.         }
  12.     }
  13.    
  14.     for {set i 0} { $i < [array size retVal]} { incr i} {
  15.         lappend retList $retVal($i)
  16.     }
  17.     return $retList
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement