GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: Add Line Numbers


physics for banshee by DELTRON
#include <iostream>
using namespace std;

void main (void)
{
    // ** VARIABLES **
    int     time = 0;
    int     position = 0;
    int     velocity = 0;
    const int acceleration = 1;

    // ** In this example we go from time = 0 to time = 10
    for (time=0; time<10; time++)
    {
        cout << "at time " << time << "  position = " << position << ", ";
        cout << " velocity = " << velocity << ", acceleration(constant) = " << acceleration;
        cout << endl;

        // ** CALCULATIONS **
        position = position + velocity;
        velocity = velocity + acceleration;
    }
}

// - Delt