🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.tcl
Article #237

Re: Optymalizacja skryptu

#237
From: Derek KuliƄski / takeda
Date: Wed, 28 Dec 2005 21:05
34 lines
1801 bytes
On Wed, 28 Dec 2005 09:42:45 +0100, Googie wrote:

> proc calculate_timer_value {time_left} {
> 	foreach {v1 v2} {
> 		86400 86400
> 		72000 14400
> 		1800 1800
> 		900 900
> 		300 300
> 		60 60
> 		30 30
> 		15 15
> 		5 5
> 		0 1
> 	} {
> 		if {$time_left > $v1} {
> 			return $v2
> 		}
> 	}
> 	return 0
> }

No wygląda to duuuĆŒo lepiej (i znowu to foreach =)))
Niemniej musiaƂem zmienić to:
| 			return $v2
na:
|			return [adjust_timer $time_left $v2]

Inaczej nie przechodziƂo testów :)

-- 
ダレック
takeda@IRCnet.EFnet, ICQ# 15827691, YahooIM: takeda64
http://ircwiki.takeda.tk - strona wiki poƛwięcona IRC
Technical Details
Message-ID: <vp3r1q00wjwc.dlg@takeda.tk.invalid>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!feed.news.interia.pl!news.cyf-kr.edu.pl!news.ceti.pl!not-for-mail
References: <spguu0moj949$.dlg@takeda.tk.invalid> <dotin8$ub2$1@srv.cyf-kr.edu.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!feed.news.interia.pl!news.cyf-kr.edu.pl!news.ceti.pl!not-for-mail
From: Derek KuliƄski / takeda <d.kulinski@gmail.com>
Newsgroups: pl.comp.lang.tcl
Subject: Re: Optymalizacja skryptu
Date: Wed, 28 Dec 2005 13:05:53 -0800
Organization: CETI S.C. (Krakow, Poland)
Lines: 34
Message-ID: <vp3r1q00wjwc.dlg@takeda.tk.invalid>
References: <spguu0moj949$.dlg@takeda.tk.invalid> <dotin8$ub2$1@srv.cyf-kr.edu.pl>
NNTP-Posting-Host: node-402413e2.sna.onnet.us.uu.net
Mime-Version: 1.0
X-Trace: alfa.ceti.pl 1135803953 76173 64.36.19.226 (28 Dec 2005 21:05:53 GMT)
X-Complaints-To: abuse@tech.ceti.pl
NNTP-Posting-Date: Wed, 28 Dec 2005 21:05:53 +0000 (UTC)
User-Agent: 40tude_Dialog/2.0.15.1
X-Face: ptH}o2-v0T<^mQ%"Un18TXgE#jj}qUfAK;3\x;'$hO%[N&Jr^1FC~dtAe&p%]WWfXhhT_G%@!$|Nw,nq|M07r2[Jf._,ZqGWv@aULt6&Y+`2Wp9y]|=K.GgSR=]7ObD?8S|{I:D=+1K_'tn/:T0pyTQN=x).#~Z="SWp0V)P5D"8]rf=j5|{;O{0]8X;GHjl6p1R\VXngOe
X-Antivirus: avast! (VPS 0552-1, 12/28/2005), Outbound message
X-Antivirus-Status: Clean
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit