Thread: rand function

  1. #1
    Registered User
    Join Date
    May 2002

    Cool rand function

    hey i am doing a battleship program and i am just wondering how would you be able to change the ships position after every game??

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    srand ( time ( NULL ) );

    Then use rand to set the position. Be sure to include time.h.

    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed