
WinDice v1.0 // top half of docuement
and
DosDice v1.0 // bottom half of docuement
June 3, 2001

|--------------------------------------------------------------------
|--------------------------------------------------------------------
WinDice v1.0

Table of Contents:

1) Introduction / what this is.
2) Usage
3) Source Code notes
4) Copy right notice and terms of use agreement.

|--------------------------------------------------------------------


1) INTRODUCTION / WHAT THIS IS.
This is a dice engine.  It is graphical version of DosDice.
It is very flexible.  It supports dice of up to 25,000 sides,
and will generate up 3000 numbers per execution.

It will also report the totals and averages in a nice reasonably
pretty graphical environment.

It has one distinct advantage over almost all other dice engines,
it has a nearly perfectly random number generator.

Due to the advantages of using MFC to create the graphics,
the utility was also ported from C to C++.

If you are a C programmer and intersted in C++, comparing the two
source codes might be interesting.

If you are a beginning programmer, I suggest you learn C first.
The code is smaller, faster and easier to read.

|--------------------------------------------------------------------


2) USAGE

Fairly straight forward.

There are three columns.

1.The first is labeled "What sided dice"
Pick the number which you wish to be your maximum in the range to be
generated.

2.The second column is labeled "What number of dice"
Pick how many numbers you wish generated.

3.The third column has two edit boxes.
The first of which is labeled "Dice Size / Multiplier"
This number is multiplied by the first column to allow you to generate
numbers in any range from 2 to 25000. (box range = 1 to 250)
The second edit box is labeled "Number Size / Multipiler"
This is multiplied by the number from the second column to allow you to
generate up to 3000 numbers in a single pass. (box range = 1 to 250)

The third box in the third column has a constant running formula to
display what would be genenerated if you pressed the "roll'em" button.
Thi way you'll know for sure what to expect, even if you fiddle with
the contents of the edit box.

The last box as the results of your most recent dice rolls, including
totals and averages.


|--------------------------------------------------------------------

3) SOURCE CODE NOTES:

I'm including the source code to this program so that if some simple
tweak to it would amuse you, you can do so.

However I reserve the right to be the sole person to release new
versions of this program.  If there is a significant change to the
program that you think would help either the users of the program, 
or those using it to learn to program a bit better, drop me a line
and I will consider your suggestion(s).

For those trying to learn how to program in C++, this might be 
interesting.  It's a very simple program.  Most of the
functions can be plucked out and reused in other code.  Please
read the terms of agreement and copy right notice to see how you
may or may not use this code and program.  Also if you already 
know C, and are trying to learn C++, I also included the C code.

If you are new to programming in general, I highly suggest you
learn C first.  For small simple programs, the development time
in C is less.  C code is easier to read.  For small programs it's
typically a single file and so the logic is much easier to track.
C skills transfer to almost every programming language in the world.

The random number generator is quite good.  The seed generator being
the reason why.

Most of the code is quite basic.  I've been programming 21 years and
in C for over 14 years, but this was my first C++ program.  But it
seems that it's clean and decent code.

I've tested this with Visual Studio on Windows 98, 98SE, ME, 
Windows NT, Windows 2000 and Windows XP.  With Microsoft Visual 
Studio (C/C++) from version 6.0 to 6.0 + sp5.  All without any
errors.  I can't find my Borland C/C++, or I'd have tested that as 
well.  In my limited testing (approx 100,000 iterations), the program
performed error free in all modes of operation.


|--------------------------------------------------------------------

4) Copy right notice:

This program is copy righted both in whole and in part. 
 
Terms of Agreement:   
 
   If you use this code (in whole or in part) you agree to be bound by the following terms.
 
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format freely and with no charge
 Provide that:
  a) the program this code (in whole or in part) is used within is not of a commerical nature.
  b) no fee is charged for the distribution nor access to this code, nor programs which contain any part of this code.
2) Permission is granted to redistribute this code (for example on a web site) provided that it remains intact and unmodified..   
3) No warrenty, functionality, or suitability to any task is expressed, implied nor guarenteed by the author.
4) You agree to hold the author harmless, and assume all liability for any use of this code weither it is used in whole or in part.
5) This code is free.  But, any program you use it in, must contain this copy right notice and must also be equally free.
 
Failure to abide by these terms and conditions is a violation of copyright laws.
 
I am releasing this source code only to help others.  
Please see to it that this spirit is relected in any works that contain any part of this code.
 
Bjorn A. Lovoll
bjorn@lovoll.net
 
If you found it useful, drop me a line.  I would especially enjoy seeing any improvements you made to it.

|--------------------------------------------------------------------
|--------------------------------------------------------------------



|--------------------------------------------------------------------
|--------------------------------------------------------------------
DosDice v1.0

Table of Contents:

1) Introduction / what this is.
2) Usage
3) Source Code notes
4) Copy right notice and terms of use agreement.


|--------------------------------------------------------------------


1) INTRODUCTION / WHAT THIS IS.
This is a dice engine.  It is shell version of WinDice.
It is very flexible.  It supports dice of up to 10,000 sides,
and will generate up 10,000 numbers per execution.

It will also report the totals and averages, as well as the raw
numbers both sorted and unsorted.

It has one distinct advantage over almost all other dice engines,
it has a nearly perfectly random number generator.

If you are a C programmer and intersted in C++, comparing the two
source codes might be interesting.

If you are a beginning programmer, I suggest you learn C first.
The code is smaller, faster and easier to read.
|--------------------------------------------------------------------


2) USAGE

May also be obtained by entering dosdice /? from the command line.

This program has 2 command line switches.
They are:
Dice Roller v1.0 copyright 2001 by Bjorn A. Lovoll

Usage: DOSDICE [/D:#] [/N:#]

/D: (or /d:) = dice size
 for a 6 sided dice, enter /D:6. Any number from 2 to 10000 may be used

/N: (or /N:) = dice number
 To get 6 numbers enter in /N:6. Any number from 1 to 10000 may be used

Any combination of switches in any order may be invoked.
Any switch not invoked defaults to: d=6, n=1
You must specify at least 1 valid switch [/D, or /N].

Examples:

Dice  /D:6 /N:4 = roll a 6 sided dice 4 times
Dice  /D:4 /N:6 = roll a 4 sided dice 6 times
Dice  /N:4 = roll a 6 sided dice 4 times
Dice  /D:4 = roll a 4 sided dice 1 time


|--------------------------------------------------------------------

3) SOURCE CODE NOTES:

I'm including the source code to this program so that if some simple
tweak to it would amuse you, you can do so.

However I reserve the right to be the sole person to release new
versions of this program.  If there is a significant change to the
program that you think would help either the users of the program, 
or those using it to learn to program a bit better, drop me a line
and I will consider your suggestion(s).

For those trying to learn how to program in C++, this might be 
interesting.  It's a very simple program.  Most of the
functions can be plucked out and reused in other code.  Please
read the terms of agreement and copy right notice to see how you
may or may not use this code and program.  Also if you already 
know C, and are trying to learn C++, I also included the C code.

If you are new to programming in general, I highly suggest you
learn C first.  For small simple programs, the development time
in C is less.  C code is easier to read.  For small programs it's
typically a single file and so the logic is much easier to track.
C skills transfer to almost every programming language in the world.

The random number generator is quite good.  The seed generator being
the reason why.

Since the C code is smaller & faster, I decided to also include
a simple, but very fast shellsort routine as well.
The C code is also more highly commented then the C++ code.
Since I estimate that novice programmers would like more details
then veteran ones.

I've tested this with Visual Studio on Windows 98, 98SE, ME, 
Windows NT, Windows 2000 and Windows XP.  With Microsoft Visual 
Studio (C/C++) from version 6.0 to 6.0 + sp5.  All without any
errors.  I can't find my Borland C/C++, or I'd have tested that as 
well.  In my limited testing (approx 100,000 iterations), the program
performed error free in all modes of operation.


|--------------------------------------------------------------------

4) Copy right notice:

This program is copy righted both in whole and in part. 
 
Terms of Agreement:   
 
   If you use this code (in whole or in part) you agree to be bound by the following terms.
 
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format freely and with no charge
 Provide that:
  a) the program this code (in whole or in part) is used within is not of a commerical nature.
  b) no fee is charged for the distribution nor access to this code, nor programs which contain any part of this code.
2) Permission is granted to redistribute this code (for example on a web site) provided that it remains intact and unmodified..   
3) No warrenty, functionality, or suitability to any task is expressed, implied nor guarenteed by the author.
4) You agree to hold the author harmless, and assume all liability for any use of this code weither it is used in whole or in part.
5) This code is free.  But, any program you use it in, must contain this copy right notice and must also be equally free.
 
Failure to abide by these terms and conditions is a violation of copyright laws.
 
I am releasing this source code only to help others.  
Please see to it that this spirit is relected in any works that contain any part of this code.
 
Bjorn A. Lovoll
bjorn@lovoll.net
 
If you found it useful, drop me a line.  I would especially enjoy seeing any improvements you made to it.

|--------------------------------------------------------------------
|--------------------------------------------------------------------

END OF FILE
