piclist 2001\03\03\004217a >
Thread: Pic and games
picon face BY : Mike email (remove spam text)

part 1 1523 bytes content-type:text/plain; charset=us-ascii (decoded quoted-printable)

Bob Ammerman wrote:
> Mike,
> > Don't use a random number generator for a dice project. Instead just run a
> counter as fast as you can and stop it when the user hits the button.
> > Be sure that each state of the count takes the same number of cycles.

Now there's an idea.  Probably a lot easier, too.

<thinking_out_loud> Guess I'd just set the top point for the counter - i.e. where the counter
would wrap back to 1 - at whatever the max possible for that particular die
is.  If doing a 20 sided die at the moment, have the counter wrap from 20 to
1 (or from 19 to 0 then add 1 before displaying).  Or just let it wrap 255
to 0 and do some sort of scaling based on the die type?  Like perhaps a
lookup table of some sort?  I'll have to do some fiddling to see what works
best for me.  And then there's doing multiple dice simultaneously ...

Thanks for the hint - I'm too used to dealing with PC type programming. I've been lurking on this list for some time now, but am only just now
starting to actually write code for PICs.  At a first glance this is the
kind of project that I think might be a good first "serious" - i.e. not
school assigned - project for me.
-- Mike Werner  KA8YSD   | He that is slow to believe anything and
                     | everything is of great understanding,
'91 GS500E            | for belief in one false principle is the
Morgantown WV         | beginning of all unwisdom.

part 2 233 bytes content-type:application/pgp-signature (decode)

part 3 154 bytes
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


In reply to: <004d01c0a396$3cfe6220$aae8c540@sciencekit.com>; from RAMMERMAN@PRODIGY.NET on Fri, Mar 02, 2001 at 10:58:38PM -0500
See also: www.piclist.com/techref/microchip/devices.htm?key=pic
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Pic and games

month overview.

new search...