home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d9xx / d958 / fed-case.lha / Fed-CASE / sources / hanoi.c < prev    next >
C/C++ Source or Header  |  1993-12-04  |  5KB  |  92 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_hanoi.h>
  17. #include <stdio.h>
  18.  
  19. /************************************************************************/
  20. /*                                                                      */
  21. /*                           End of Includes                            */
  22. /*                                                                      */
  23. /************************************************************************/
  24.  
  25. /************************************************************************/
  26. /*                                                                      */
  27. /*                    Start of source prototype file                    */
  28. /*                                                                      */
  29. /************************************************************************/
  30.  
  31. #include <proto/proto_hanoi.h>
  32.  
  33. /************************************************************************/
  34. /*                                                                      */
  35. /*                     End of source prototype file                     */
  36. /*                                                                      */
  37. /************************************************************************/
  38.  
  39.  
  40. /************************************************************************/
  41. /* Procedure  : void V_Hanoi(FLI_num,FLI_from,FLI_to,FLI_help)          */
  42. /* Function   :                                                         */
  43. /* Designer   : Ron Heijmans                                            */
  44. /* Date       : Sat Nov 27 13:44:27 1993                                */
  45. /*                                                                      */
  46. /* Modificat  :                                                         */
  47. /* Handler    :                                                         */
  48. /* Modific.   :                                                         */
  49. /*                                                                      */
  50. /************************************************************************/
  51.  
  52. void V_Hanoi(FLI_num,FLI_from,FLI_to,FLI_help)
  53. long int FLI_num;
  54. long int FLI_from;
  55. long int FLI_to;
  56. long int FLI_help;
  57. {
  58.  
  59.     if (FLI_num== 1  )
  60.     {
  61.         printf( "move %d from %d to %n" ,  1 , FLI_from , &FLI_to ) ;    /* printf: Standard output function */
  62.     }
  63.     else                            /* if(FLI_num == 1) */
  64.     {
  65.         V_Hanoi( FLI_num - (long int) 1 , FLI_from , FLI_help , FLI_to ) ;
  66.         printf( "move %d from %d to %d\n" , FLI_num , FLI_from , FLI_to ) ;    /* printf: Standard output function */
  67.         V_Hanoi( FLI_num - (long int) 1 , FLI_help , FLI_from , FLI_to ) ;
  68.     }                            /* end of else 'if(FLI_num == 1)' */
  69. }                                /* end of V_Hanoi */
  70.  
  71. /************************************************************************/
  72. /* Procedure  : void main()                                             */
  73. /* Function   :                                                         */
  74. /* Designer   : Ron Heijmans                                            */
  75. /* Date       : Sat Nov 27 13:44:30 1993                                */
  76. /*                                                                      */
  77. /* Modificat  :                                                         */
  78. /* Handler    :                                                         */
  79. /* Modific.   :                                                         */
  80. /*                                                                      */
  81. /************************************************************************/
  82.  
  83. void main()
  84. {
  85. int LI_slice;
  86.  
  87.     LI_slice= 0 ;
  88.     printf( "How many slices ? " ) ;            /* printf: Standard output function */
  89.     scanf( "%d" , LI_slice ) ;
  90.     V_Hanoi((long int) LI_slice , (long int) 1 , (long int) 3 , (long int) 2 ) ;
  91. }                                /* end of V_main */
  92.