Guest User

Untitled

a guest
Feb 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. proc eotw args {set week [clock format [clock seconds] -format "%U"]; if {[lsearch [array names eotws] $week] < 0} {set a 0;set b 0;set c 0;set d 0; while {!$a} {set a [expr int(12*rand())-6]};while {!$b} {set b [expr int(12*rand())-6]};while {!$c} {set c [expr int(12*rand())-6]};while {!$d} {set d [expr int(12*rand())-6]};set eotws($week) [list [expr $a*$c] [expr $a*$d+$b*$c] [expr $b*$d]];};set a "[lindex $eotws($week) 0]x^2";set b [lindex $eotws($week) 1];if {$b > 0} {set b " + [expr $b]x"} elseif {$b eq 0} {set b ""} else {set o " - [expr abs($b)]x"};set c [lindex $eotws($week) 2];if {$c > 0} {set c " + $c" } elseif {$c eq 0} {set c ""} else {set c " - [expr abs($c)]"};return "Congratulations y = $a$b$c\nYou are the\nequation of the week";}
Add Comment
Please, Sign In to add comment