need some help with basic simulation

This is a discussion on need some help with basic simulation within the C Programming forums, part of the General Programming Boards category; well, i guess here's another post about my simulation. i think some of you may have replyed or glanced over ...

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    12

    need some help with basic simulation

    well, i guess here's another post about my simulation. i think some of you may have replyed or glanced over my previous posts, but if you haven't, let me fill you in. i'm creating an ecosystem simulation (called Eco-Sim, aren't i creative? lol), which is based on the simple math model -
    (a/b*c) -(d/e*c)

    So far it's a static sim, meaning there is no chance/probabliiy. Now that I'm done it, I would like someone to help me out, and tell me how to make this a dynamic sim (aka. chance oriented).

    So far, this is my code -

    Code:
    //Coded By Jack Olszewski, Version 1.00
    #include <stdio.h>
    main()
    { 
          printf("Welcome to Eco-Sim!\n");
          printf("Version 1.00\n");
          printf("By Jack Olszwski\n");
          printf("\n");
          float a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p;
          printf("Time (1 = 1 Day):");  
          scanf ("%f",&c);
          printf("\n");
          printf("Plants:\n");
          printf("\n");
          printf("First Number of Creation (N/?):");
          scanf("%f",&a);
          printf("Second Number of Creation (?/N):");
          scanf("%f",&b);
          printf("First Number of Destruciton (N/?):");
          scanf("%f",&d);
          printf("Second Number of Destruction (?/N):");
          scanf("%f",&e);
          f=(a/b*c) -(d/e*c);
          printf("\n");
          printf("Herbivores:\n");
          printf("\n");
          printf("First Number of Creation (N/?):");
          scanf("%f",&g);
          printf("Second Number of Creation (?/N):");
          scanf("%f",&h);
          printf("First Number of Destruciton (N/?):");
          scanf("%f",&i);
          printf("Second Number of Destruction (?/N):");
          scanf("%f",&j);
          k=(g/h*c)-(i/j*c);
          printf("\n");
          printf("Carnivores:\n");
          printf("\n");
          printf("First Number of Creation (N/?):");
          scanf("%f",&l);
          printf("Second Number of Creation (?/N):");
          scanf("%f",&m);
          printf("First Number of Destruciton (N/?):");
          scanf("%f",&n);
          printf("Second Number of Destruction (?/N):");
          scanf("%f",&o);
          p=(g/h*c)-(i/j*c);
          printf("\n");
          printf("Final Amounts:\n");
          printf("\n");
          printf("Plants:%f\n",f);
          printf("Herbivores:%f\n",k); 
          printf("Carnivores:%f\n",p); 
    }
    Ty in advance,

    JOlszewski

  2. #2
    cwr
    cwr is offline
    Registered Luser cwr's Avatar
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    868
    I'm not sure about your simulation, but I would strongly recommend you choose a more informative naming scheme for your variables than the letters of the alphabet in order.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help!For poker game simulation
    By tx1988 in forum C++ Programming
    Replies: 24
    Last Post: 05-25-2007, 09:59 PM
  2. [ANN] New script engine (Basic sintax)
    By MKTMK in forum C++ Programming
    Replies: 1
    Last Post: 11-01-2005, 09:28 AM
  3. what are your thoughts on visual basic?
    By orion- in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 09-22-2005, 04:28 AM
  4. visual basic vs C or C++
    By FOOTOO in forum Windows Programming
    Replies: 5
    Last Post: 02-06-2005, 07:41 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21