die roller

While looking at DiceButton.java, I noticed that the tooltip configurer was totally broken. While I was at it, I added a simple feature to sort die rolls… Which was really, really, easy. And I thought it was something that should really be there.

I’ll pull it out if you want me to.

  • M.

Can you post an additional code for DiceButton.class to realize sorting?

And example of button-code into buildFile in module?
Like:

VASSAL.build.module.DiceButton hotkey="" icon="/images/die.gif" nDice="16" nSides="6" name="xd6" plus="0" prompt="true" reportFormat="** $name$ = $result$ *** <$playerName$>" reportTotal="false" text="XD6" tooltip="xd6"

Thus spake “mkiefte”:

Yeah, ok. No more new features for 3.1, though. Really, I mean it this time. :slight_smile:

BTW, I’ve been thinking about my new dice roller, and it occurred to me that
it might be useful to have the dice rolling language it uses available in
VASSAL even when you’re not online… Your sorting feature reminded me of
this because it’s something that’s trivial to do in both dice rolling
languages I devised.

Here’s the documentation for the first one, which I came to feel was rather
weird and non-obvious:

dice.nomic.net/bones.html

The second one uses a subset of Perl:

lists.ellipsis.cx/archives/spoon … 00421.html

I think the Perl one has much, much better syntax; unfortunately, VASSAL
doesn’t have a built-in Perl interpreter yet… ;)


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

I’ve added a feature that makes the odd die rolls pink and the even ones blue. It’s necessary for… some… game… I’m making up.

That reminds me that a simple calculator language could be introduced in a lot of places. Is there a Java equivalent of lex and yacc? I thought I saw a reference to something like that in some Ant documentation (it referred to something that sounded like a lexer and parser).

Actually lex and yacc are overkill for calculators, but your syntax diagram reminded me of that.

I think Brent was working on something like this. It would be relatively easy to introduce that in formatString.

And yet it could. And yet it could…

It looks very nice. But what you’re proposing is just a superset of a simple calculator language. I think that should be the main part of it.

Brent, were you doing this at one point?

  • M.

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Michael Kiefte”:

It’s just Bacus-Naur Form. (en.wikipedia.org/wiki/Backus–Naur_form)

But it’s also not a concidence that I did in fact use lex and yacc for my
lexer and parser.

Yes, he was working on some BeanShell stuff.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Yes, that’s right. BeanShell is a Java interpreter. It allows us to add Java as a scripting language within Vassal. It can be configured in different ways from a single expression parser and evaluator (i.e. Calculated Properties) to a fully fledged scripting language. It is extensible in the same way Java is - you can write your own functions and call them either in BeanShell, or in real Java.

BeanShell development seems to have ‘stabilized’, but it is fully functional, source is provided and it’s LGPL.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)