Alex,
: rows-score ( level n -- score )
{
{ [ dup 0 = ] [ drop 0 ] }
{ [ dup 1 = ] [ drop 40 ] }
{ [ dup 2 = ] [ drop 100 ] }
{ [ dup 3 = ] [ drop 300 ] }
{ [ dup 4 = ] [ drop 1200 ] }
{ [ t ] [ "how did you clear that many rows?" throw ] }
} cond swap 1+ * ;
rows-score can be a little bit simpler with the new case word:
: rows-score ( level n -- score )
{ { 0 [ 0 ] }
{ 1 [ 40 ] }
{ 2 [ 100 ] }
{ 3 [ 300 ] }
{ 4 [ 1200 ] }
} case swap 1+ * ;
Ed
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk