All pastes #399816 Raw Edit

Frog's Challenge

public text v1 · immutable
·published 2007-03-18 08:28 UTC
rendered paste body
Frog's Challenge script

Alias maths { 
  echo %sum $2- 
  if ($1 == X, SET %sum X) | $iif($1 == Y, set %sum Y) 
  if (*+* iswm $1-) { echo %sum is $calc($7 - $5 - $3) } 
  if (*-* iswm $1-) { echo %sum is $calc($7 + $5 + $3) } 
  if (*/* iswm $1-) { echo %sum is $calc($7 * $5 * $3) } 
  if (*^* iswm $1-) { echo %sum is $calc($7 / $5 / $3) } 
}