dice generator problems

  • Thread starter Bill Cunningham
  • Start date
B

Ben Bacarisse

Nick said:
True, thanks. As has been said many times before, catching all errors
is complicated, even with strtol to help.

Practically, I think that's the least of the problems
here: and limiting the number of dice that generated to LONG_MAX-1 isn't
going to reduce the utility of the program that much.

I agree, but that is not what is happening (yet). strtol is used only
to find two numbers to add (truly bizarre, but I don't want to try to
find out why this is done).

If, later, the program were to use strtol to find the upper limit of
the dice roll, then a bunch of other problems spring up, not least the
fact the RAND_MAX may be a lot smaller than LONG_MAX.
 
R

Richard Bos

Nick Keighley said:
only slightly. in what way does it relate to C programming? Why not
just on comp.programming and ask "what language has a syntax of X"?

'cause they'd probably not know which language it is, unless certain
people read that group.

It's Inform 6.

Richard
 
S

Seebs

It's Inform 6.

Ayup.

Didn't think the specific language was relevant, just thought it was
neat that the syntax did exist. And I'd forgotten about Icon, but I've
used that too.

-s
 
R

Richard Bos

Many languages (though not low-level ones like C) had an "in" operator.
For example, SQL:

WHERE fld in (a,b,c)

Yah. But unlike those languages, Icon does actual, backtracking,
pattern-matching.

Yes, this is beautiful.

Yes, this is horrendous.

Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top