Thread: Who can check my code?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Feb 2019
    Posts
    1,078
    john.c and stahta01 have a point (sorry didn't resist the pun).

    You are dealing with triangle SIDES, not vertices. And choosing 3 random values between -10 and 10:

    Code:
     rand()/(float)RAND_MAX -> Will be a value between 0 and 1.
    (rand() / (float)RAND_MAX) * 20 -> Will be a value between 0 and 20.
    (rand() / (float)RAND_MAX) * 20 - 10 -> Will be a value between -10 and 10
    Not all choosen values are valid as "lengths"...
    Last edited by flp1969; 06-25-2021 at 07:33 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. check my code
    By senkuu in forum C Programming
    Replies: 1
    Last Post: 09-14-2016, 09:02 AM
  2. Help! Check my code over.
    By omGeeK in forum C Programming
    Replies: 6
    Last Post: 11-04-2010, 11:34 PM
  3. check my c code.
    By rfm in forum C Programming
    Replies: 4
    Last Post: 09-24-2009, 05:47 AM
  4. Check out my code
    By joshdick in forum C++ Programming
    Replies: 9
    Last Post: 09-17-2003, 07:41 PM
  5. check the code
    By pasha in forum Windows Programming
    Replies: 2
    Last Post: 01-06-2003, 02:01 PM

Tags for this Thread