Initial Revision
[ohcount] / test / expected_dir / lsp1.lsp / lisp / comment
1 ;;; CrapsSim.lsp
2 ;;; The main purpose of this program was to implement a Craps game, using a language that we have just
3 ;;; learned.  Also, it was written in a functional style with almost no reliance on the assignment
4 ;;; operation.  Only one local variable called THROW was used.
5 ;;; ====================================================================================================== ;;;
6 ;;; ======================================= CRAPS SIMULATION ============================================= ;;;
7 ;;; ====================================================================================================== ;;;
8 ;;; ** This function takes no parameters as input and returns a random number between 1 and 6. **
9 ;;; ====================================================================================================== ;;;
10 ;;; ** This function takes no parameters as input and returns a LIST with two numbers between 1 and 6. **
11 ;;; ====================================================================================================== ;;;
12 ;;; ** This function takes two numbers as parameters for input and returns T or Nil.  T is returned if both
13 ;;;    numbers are equal to 6.  Nil is returned otherwise. **
14 ;;; ====================================================================================================== ;;;
15 ;;; ** This function takes two numbers as parameters for input and returns T or Nil.  T is returned if both
16 ;;;    numbers are equal to 1.  Nil is returned otherwise. **
17 ;;; ====================================================================================================== ;;;
18 ;;; ** This function takes two numbers as parameters for input and returns T or Nil.  T is returned if the 
19 ;;;    sum of both numbers is equal to a 7 or 11.  Nil is returned otherwise. **
20 ;;; ====================================================================================================== ;;;
21 ;;; ** This function takes two numbers as parameters for input and returns T or Nil.  T is returned if the 
22 ;;;    sum of both numbers is equal to a 2, 3 or 12.  Nil is returned otherwise. **
23 ;;; ====================================================================================================== ;;;
24 ;;; ** This function takes two numbers as parameters for input and returns a string.  If function BOXCARS_P
25 ;;;    returns T, then the returned string equals BOXCARS.  If function SNAKE_EYES_P returns T, then the 
26 ;;;    returned string equals SNAKE_EYES.  The string contains Nil otherwise. **
27 ;;; ====================================================================================================== ;;;
28 ;;; ** This is the main function used to simulate the game of craps.  Variable THROW contains a LIST of two
29 ;;;    numbers between 1 and 6.  The numbers located in THROW, are used as parameters for the other functions.
30 ;;;    The several pieces used for output are listed together and then the LIST is returned from this 
31 ;;;    function.
32 ;;; if roll is a win, then LIST the appropriate output
33 ;;; if roll is a loss, then check for BOXCARS or SNAKE-EYES
34 ;;; else include the BOXCARS or SNAKE-EYES string in the output
35 ;;; if roll is not instant win or loss then output sum of dice
36 ;;; ======================================== END OF PROGRAM CRAPS ======================================== ;;;