extra: use [-] instead of "- 0 max".
parent
53992695e4
commit
cf4d639345
|
@ -58,7 +58,7 @@ total-births total-deaths ;
|
||||||
} cleave 100 /i 1 + ;
|
} cleave 100 /i 1 + ;
|
||||||
|
|
||||||
: #starved ( game -- n )
|
: #starved ( game -- n )
|
||||||
[ population>> ] [ feed>> 20 /i ] bi - 0 max ;
|
[ population>> ] [ feed>> 20 /i ] bi [-] ;
|
||||||
|
|
||||||
: leave-fink ( -- )
|
: leave-fink ( -- )
|
||||||
"DUE TO THIS EXTREME MISMANAGEMENT YOU HAVE NOT ONLY" print
|
"DUE TO THIS EXTREME MISMANAGEMENT YOU HAVE NOT ONLY" print
|
||||||
|
|
|
@ -106,10 +106,10 @@ foreground background page-color inset line-height metrics ;
|
||||||
[ 0 >>x ] dip [ dup line-break ] times drop ;
|
[ 0 >>x ] dip [ dup line-break ] times drop ;
|
||||||
|
|
||||||
: avail-width ( canvas -- n )
|
: avail-width ( canvas -- n )
|
||||||
[ width ] [ x>> ] bi - 0 max ;
|
[ width ] [ x>> ] bi [-] ;
|
||||||
|
|
||||||
: avail-height ( canvas -- n )
|
: avail-height ( canvas -- n )
|
||||||
[ height ] [ y>> ] bi - 0 max ;
|
[ height ] [ y>> ] bi [-] ;
|
||||||
|
|
||||||
: avail-lines ( canvas -- n )
|
: avail-lines ( canvas -- n )
|
||||||
[ avail-height ] [ line-height>> ] bi /i ; ! FIXME: 1 +
|
[ avail-height ] [ line-height>> ] bi /i ; ! FIXME: 1 +
|
||||||
|
|
|
@ -256,7 +256,7 @@ M: table-row pdf-render
|
||||||
] each widths >alist sort-keys values
|
] each widths >alist sort-keys values
|
||||||
|
|
||||||
! make last cell larger
|
! make last cell larger
|
||||||
dup sum 400 swap - 0 max [ + ] curry dupd change-last
|
dup sum 400 swap [-] [ + ] curry dupd change-last
|
||||||
|
|
||||||
! size down each column
|
! size down each column
|
||||||
dup sum dup 400 > [ 400 swap / [ * ] curry map ] [ drop ] if ;
|
dup sum dup 400 > [ 400 swap / [ * ] curry map ] [ drop ] if ;
|
||||||
|
|
|
@ -177,7 +177,7 @@ IN: sequences.extras
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
: ((each-from)) ( i seq -- n quot )
|
: ((each-from)) ( i seq -- n quot )
|
||||||
[ length over - 0 max swap ] keep '[ _ + _ nth-unsafe ] ; inline
|
[ length over [-] swap ] keep '[ _ + _ nth-unsafe ] ; inline
|
||||||
|
|
||||||
: (each-from) ( i seq quot -- n quot' ) [ ((each-from)) ] dip compose ;
|
: (each-from) ( i seq quot -- n quot' ) [ ((each-from)) ] dip compose ;
|
||||||
inline
|
inline
|
||||||
|
|
|
@ -18,7 +18,7 @@ CONSTANT: unit-suffix-hash H{
|
||||||
:: find-unit-suffix ( suffixes n multiplier base -- i/f )
|
:: find-unit-suffix ( suffixes n multiplier base -- i/f )
|
||||||
suffixes length
|
suffixes length
|
||||||
[ [ n ] dip multiplier base threshhold < ] find-integer
|
[ [ n ] dip multiplier base threshhold < ] find-integer
|
||||||
suffixes length or 1 - 0 max ;
|
suffixes length or 1 [-] ;
|
||||||
|
|
||||||
:: reduce-magnitude ( n multiplier base suffixes -- string )
|
:: reduce-magnitude ( n multiplier base suffixes -- string )
|
||||||
n 0 < [
|
n 0 < [
|
||||||
|
|
Loading…
Reference in New Issue