home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue2 / SDL.ARC / !gcc / examples / m / SeaApp < prev    next >
Encoding:
Text File  |  2001-01-02  |  998 b   |  46 lines

  1. /*
  2.  * You may freely copy, distribute and reuse the code in this example.
  3.  * NeXT disclaims any warranty of any kind, expressed or implied, as to its
  4.  * fitness for any particular use.
  5.  */
  6.  
  7.  
  8.  
  9. /*
  10.  * import class headers and procedural include files
  11.  */
  12.  
  13. #import "Fishie.h"
  14. #import <stdio.h>
  15. #import <stdlib.h>
  16. #import <time.h>
  17.  
  18.  
  19. void main(int argc, char *argv[])
  20. {
  21.     id myFishie;
  22.     
  23.     srand((unsigned)time(NULL));    /* init random number gen. from clock */
  24.     
  25.         printf("\n\n~~~~ Welcome to the Objective Sea. ~~~~\n");
  26.         printf("~~~~ The water's really warm today! ~~~~\n");
  27.     
  28.         printf("\n\n~~~~ Making myFishie... ~~~~\n");
  29.     myFishie = [[Fishie alloc] init];
  30.     
  31.         printf("\n\n~~~~ Swimming myFishie... ~~~~\n");
  32.     [myFishie swim];
  33.     
  34.         printf("\n\n~~~~ Where is myFishie?... ~~~~\n");
  35.     [myFishie hLoc];
  36.     [myFishie vLoc];
  37.     
  38.             printf("\n\n~~~~ Incrementing H pos of myFishie... ~~~~\n");
  39.     [myFishie hLoc];
  40.     [myFishie incHBy:10];
  41.     [myFishie hLoc];
  42.  
  43.         printf("\n\n~~~~ Come back soon! ~~~~\n");
  44.     exit(0);
  45. }
  46.