Announcement

Collapse
No announcement yet.

Die roll

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ian Cairns
    replied
    You are welcome Lance.
    This venue has helped me many times. I don't even have to ask the questions (and show how ignorant I really am ), because someone else always seems to find the hard parts first.
    Thanks,

    ------------------
    [email protected]

    Leave a comment:


  • Lance Edmonds
    replied
    Thanks Ian.

    Folks, if you are not using the latest version of a PowerBASIC compiler, please make that fact known when posting questions (our clairvoyant is away due to unforseen circumstances!).

    Thanks!

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Ian Cairns
    replied
    Lance's function is good for PB 3.5, but if you use an older version, you should use a function wrapper similar to this:
    Code:
    FUNCTION RndRange(BYVAL First AS LONG, BYVAL Last AS LONG) AS LONG
    ' Return a Random Long between First and Last
      FUNCTION = MIN%(last,first) + RND * ABS(Last-First)
    END FUNCTION
    
    'Call for die:
      value = RndRange(1, 6)
    regards,

    ------------------
    [email protected]

    Leave a comment:


  • Mark Milford
    Guest replied
    Thanks, but it keeps giving me the error of

    Error 414: ")" expected

    ?

    ------------------
    Life without programming is pointless.

    Leave a comment:


  • Lance Edmonds
    replied
    Code:
    x& = RND(1,6)

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Mark Milford
    Guest started a topic Die roll

    Die roll

    What would be a good random for a die roll?? I made one long ago but i forget the commands needed.
    ran(5)+1

    ?

    ------------------
    Life without programming is pointless.
Working...
X