TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: BOB SEWELL
date: 1996-07-17 08:21:00
subject: Random Numbers

    A phenomena has been reported to me regarding my door
 Greedy, and I'm having trouble coming up with ways to
 program around the problem.  In case you aren't familiar
 with the game, let me summarize how it's played so y'all
 can better understand the programming problem which this
 message is really about.
    Greedy is an unusual game played with dice, but not a
 Vegas-type dice game.  Anyway, players roll nine dice to
 score points.  If they get points on the first roll, they
 set aside the dice that contain the points and, if they
 dare, roll the remaining dice to try and score additional
 points.  If no points are rolled on any throw, all points
 from that round are forfeit and the dice are passed to the
 next player.  Dice that make up points are 1's (worth 100
 points), 5's (worth 50) and, if rolled all in the same
 throw, three of any die value are worth 100 X the value,
 i.e., three 4's is worth 400, three 2's are worth 200, and
 the exception is three 1's which are worth 1,000 points.
    In any real game played with real dice and without a
 computer, there are infrequent occasions when, on the
 first throw of a player's turn when she/he throws all nine
 dice, it will happen that no points come up; no 1's, no
 5's, no triplets.  However, it was pointed out by a rabid
 fan of my door that, in the 3 or 4 years he has played
 Greedy, he has never seen a time when points were not
 thrown on the first roll.  I thought this was impossible,
 since I seed the randomizer with the TIMER before each roll
 of the dice.
    Then I wrote the following program, which takes the
 first 9 samples of every seed value from 1 to 86400 (all
 the possible TIMER values in a day) and searched for
 occurrences when there was neither a 1, a 5 nor a triplet,
 and if it finds one, print it to a file for inspection
 after the program terminates.  The file was never written
 to.  There are no such occurrences.
    I post this here for two reasons:  To have y'all check
 my program to ensure it is valid in its approach to
 checking for no points on the first roll of nine dice, and
 to see if any of you get different results.  It only takes
 20-30 seconds on my AMD Am5x86-133 (somewhat like a
 Pentium 75, so they say.  It's actually slower than a
 Pentium 66, from my benchmarking...), so it shouldn't take
 long on other processors.  Thanks!
 -------------------  RANDOM.BAS  --------------------
 $compile memory
 defint a-z
 dim rolls(1:9)
 cls
 open "random.out" for output as #1
 for seed& = 1 to 86400
    randomize seed&
	for die = 1 to 9
		rolls(die) = int(rnd * 6) + 1
	next die
	array sort rolls()
	test = 0
	io$ = ""
	for die = 1 to 9
		io$ = io$ + str$(rolls(die))
	next die
    if instr(io$, any "15") > 0 then test = 1
    if instr(io$, "2 2 2") > 0 then test = 2
    if instr(io$, "3 3 3") > 0 then test = 3
    if instr(io$, "4 4 4") > 0 then test = 4
    if instr(io$, "6 6 6") > 0 then test = 6
    if test = 0 then
       print #1, str$(seed&), " NO points ", io$
       print str$(seed&), " NO points ", io$
    else
       locate 1, 1
       print seed&
    end if
    if instat then
       k$ = inkey$
       if k$ = chr$(27) then
          exit for
       else
          print "Seed: "; seed&
       end if
    end if
 next seed&
 close #1
 print
 print "Done!"
 end
... Seven Wells On-Line - Makers of Greedy!
--- PPoint 1.96
---------------
* Origin: Seven Wells On-Line * Nashville, TN (1:116/3000.12)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.