home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d9xx / d958 / fed-case.lha / Fed-CASE / sources / roulette.c < prev    next >
C/C++ Source or Header  |  1993-12-04  |  4KB  |  80 lines

  1. /************************************************************************/
  2. /*                                                                      */
  3. /*         Code generated by FED-CASE V1.0  Code Generator              */
  4. /*                  © Joosen Software Development                       */
  5. /*                    All rights reserved 1993                          */
  6. /*                                                                      */
  7. /************************************************************************/
  8.  
  9. /************************************************************************/
  10. /*                                                                      */
  11. /*                          Start of Includes                           */
  12. /*                                                                      */
  13. /************************************************************************/
  14.  
  15. #include <exec/types.h>
  16. #include <data/const_roulette.h>
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19.  
  20. /************************************************************************/
  21. /*                                                                      */
  22. /*                           End of Includes                            */
  23. /*                                                                      */
  24. /************************************************************************/
  25.  
  26. /************************************************************************/
  27. /*                                                                      */
  28. /*                    Start of source prototype file                    */
  29. /*                                                                      */
  30. /************************************************************************/
  31.  
  32. #include <proto/proto_roulette.h>
  33.  
  34. /************************************************************************/
  35. /*                                                                      */
  36. /*                     End of source prototype file                     */
  37. /*                                                                      */
  38. /************************************************************************/
  39.  
  40.  
  41. /************************************************************************/
  42. /* Procedure  : void main()                                             */
  43. /* Function   :                                                         */
  44. /* Designer   : C.Joosen & R.Heijmans                                   */
  45. /* Date       : Sat Nov 27 13:54:45 1993                                */
  46. /*                                                                      */
  47. /* Modificat  :                                                         */
  48. /* Handler    :                                                         */
  49. /* Modific.   :                                                         */
  50. /*                                                                      */
  51. /************************************************************************/
  52.  
  53. void main()
  54. {
  55. int LI_inzet;
  56. int LI_dag;
  57. int LI_result;
  58. int LI_gamble;
  59. int LI_profit;
  60. int LI_in;
  61.  
  62.     LI_in= 50 ;
  63.     LI_profit= 0;
  64.     do
  65.     {
  66.         LI_in*= 2;
  67.         LI_gamble= 36 * rand() + 1;            /* rand:  */
  68.         LI_result= 37 * rand();
  69.         if (LI_gamble- LI_result== 0  )
  70.         {
  71.             LI_profit+= 36 * LI_in;
  72.         }
  73.         else                        /* if(LI_gamble-LI_result == 0) */
  74.         {
  75.             LI_profit-= LI_in;
  76.         }                        /* end of else 'if(LI_gamble-LI_result == 0)' */
  77.     } while( LI_profit< 0);
  78.     printf( "maximum in today %d : %4d\n" , LI_dag , LI_inzet );    /* printf: Standard output function */
  79. }                                /* end of V_main */
  80.