Loading ...
Sorry, an error occurred while loading the content.
 

Re: [pcgen] Re: [DOCS] JEP formulas

Expand Messages
  • Eric Beaudoin
    ... If we need a if-then-else operator, I think we shoul use the very commun ? : Your example would
    Message 1 of 35 , Jul 1, 2004
      At 10:11 2004.07.01, Frugal wrote:
      ><quote who="Eddy Anthony">
      >> Hallelujah! I see the light, I'm now a JEP convert!
      >
      >;O)
      >
      >>((CL+2)/2)+((((CL-3)/2).TRUNC)MIN2)-((((CL-2)/2).TRUNC)MIN3)-((CL/14).TRUNC)
      >>
      >> This progression ends at 16 at 20th level so all this math is just to get
      >> -4
      >> in at the right levels. With JEP it can be expressed this way:
      >>
      >> CL-(CL>=4)-(CL>=8)-(CL>=13)-(CL>=18)
      >>
      >> Very simple and easy to read, and it works, just tested it.
      >> The four Boolean expressions read "Class Level is equal to or greater than
      >> x
      >> level, if its true it returns a 1 if false it returns a zero. Very useful.
      >
      >It would be fairly trivial to add if-then-else constructs to JEP. As far
      >as I can tell almost anything that can be done in an Excel formula could
      >be done in JEP with an appropriate function:
      >
      >if() would be a 3 argument function:
      > if( boolean-expression, then-expression, else-expression )
      >
      >example:
      > if( CL>=4, CL-1, CL)
      >
      >Not very useful for this particular case, but I am sure that there are
      >cases where being able to say 'this or that' would be useful. It is this
      >kind of extensability that I really like about JEP.

      If we need a if-then-else operator, I think we shoul use the very commun <logical-expression>?<expression-if-true>:<expression-if-false>

      Your example would be:

      CL<=4?CL-1:CL

      Other examples:

      max(x,y) = x>y?x:y

      # result is assiged the value of parameter if parameter is
      # not equal to -1, otherwise, result is assign the 0 value.
      result = parameter <> -1 ? parameter : 0

      >--
      >regards,
      >Frugal
      >-OS Chimp

      -----------------------------------------------------------
      √Čric "Space Monkey" Beaudoin (hiding in the trench)
      >> In space, no one can hear you sleep.
      >> Camels to can climb trees (and sometime eat them).
      <mailto:beaudoer@...>
    • Guillermo Llosa
      ... If I remember correctly (no guarantee) but a--e.com was exactly right.
      Message 35 of 35 , Jul 7, 2004
        Mark Coletti wrote:

        > On Fri, 02 Jul 2004 08:45:25 -0700, Kevin Brown
        > <kevin_brown@...> wrote:
        > > >>http://gmgen.sourceforge.net/wiki/
        > > >>
        > > >>I just hit that website, and the links are full of hard-core porn
        > > >>sites... someone might wanna check into that.
        > > >
        > > >
        > > > Deleted!
        > > > That is so not cool.
        > >
        > > The changes should be able to be rolled back thanks to it being a
        > wiki page, heheh.
        >
        > QuantumGIS had the same problem recently. In fact, I wonder if it was
        > the same asshat. Was the offender posting links hosted by a--e.com,
        > which is Russian?
        >
        > QuantumGIS locked down its WIki. It's a PITA, but was necessary.
        > Apparently this had occured regularly.
        >
        >
        > MAC
        > --
        > I'm taking reality in small doses to build immunity.
        >
        >
        > PCGen's release site: http://pcgen.sourceforge.net
        > PCGen's alpha build: http://rpg.plambert.net/pcgen
        > PCGen's FAQ:
        > http://rpg.plambert.net/pcgen/current/_docs/
        >
        >
        > *Yahoo! Groups Sponsor*
        > ADVERTISEMENT
        > click here
        > <http://us.ard.yahoo.com/SIG=129aj5q7s/M=295196.4901138.6071305.3001176/D=groups/S=1705016061:HM/EXP=1089240609/A=2128215/R=0/SIG=10se96mf6/*http://companion.yahoo.com>
        >
        >
        >
        > ------------------------------------------------------------------------
        > *Yahoo! Groups Links*
        >
        > * To visit your group on the web, go to:
        > http://groups.yahoo.com/group/pcgen/
        >
        > * To unsubscribe from this group, send an email to:
        > pcgen-unsubscribe@yahoogroups.com
        > <mailto:pcgen-unsubscribe@yahoogroups.com?subject=Unsubscribe>
        >
        > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
        > Service <http://docs.yahoo.com/info/terms/>.
        >
        >
        If I remember correctly (no guarantee) but a--e.com was exactly right.
      Your message has been successfully submitted and would be delivered to recipients shortly.