FORCE OF GRAVITY: INTRODUCTION
by Roland Cheng



This game uses the physics principles of the unit of "Forces and Motion" (more specifically, "Acceleration and the Force of Gravity"). Written in Pascal, the questions involved include the equations for uniformly accelerated motion. To fully appreciate the construction of the program, I have provided, along with the converted executable (.exe) file (which is run to play the game), the original Pascal programme saved with the extension .p to allow the user to view what has been done with the code (read the documentation and comments found in the .p file if you are unfamiliar with Pascal) and to enter their own questions with ease. The programme looks for the given information in a text file (which can be modified for variety), and uses the appropriate formula to obtain the answer and matches it against the user.

The instructions to setup the Pascal Compiler and to run the game are located in their respective pages. This game is set in the not too distant future, where travel can only be bestowed upon those knowing of the concepts of Forces and Motion. You are an astronaut set to launch to the planet Mars for the first time in Human history, but you must travel from your home in Ottawa, Ontario to Charlottetown, Prince Edward Island where the Space Shuttle Launching Pad is. In a solar-powered hovering vehicle (therefore, friction is not applicable), you must answer questions that usually involves equations for uniformly accelerated motion (using both acceleration and gravitational field intensity). The answers must be expressed in only the numeral (units and direction are not necessary because it is already stated in which units the answer must be expressed). Scientific notation also may not be used (some answers might be quite extensive in length, but please take the time to answer in mere numerical form). Regarding the number of significant digits, you are allowed to enter as many digits as you please and you will not be penalized for incorrect use of significant digits. Your total time, distance, and bank money (in the currency of Newtons) are always expressed with two digits after the decimal.
The questions are randomized according to your location (on Earth, rising up in Earth's atmospheres, in Space, and finally following to the surface of Mars), and the distance and times are tracked - the distance involved in each question or answer will be the amount travelled (the directions of movement within the question will not apply to the direction in which the vehicle is moving; for example, on Earth, it will always be travelling East) while the time will be added to the total elapsed time used to travel from Ottawa, Ontario, to the more stable Cimmoria Terra on Mars. On the way there, Newtons, prizes, and gifts will also be awarded for your efforts. Milestone locations will be displayed for your convenience, and general knowledge questions for "Forces and Motion" will be given to the user to answer for more rewards.
You will only be able to move the amount of distance when correctly answering questions (the time taken will be added to the timer), but when you answer a question incorrectly, the amount of time involved with the question will be added on to the elapsed time and your "bank" will be depleted appropriately. The number of steps required, the amount of time elapsed and the final amount of Newtons attained will be fed into a formula that will determine your final score. ENJOY!

Parts of the programme can essentially be removed and essentially serve as a simple calculator for information fed into the text file, calculating the unknowns using certain "Forces and Motion" equations with the known data, therefore it can also be used as a tool. The following equations were used:

Equation Known Information Required Information
v = d / t
d = v * t
t = d / v
d, t
v, t
d, v
v
d
t
a = v / t
v = a * t
t = v / a
v, t
a, t
v, a
a
v
t
v = (v1 + v2) / 2
v1 = (2 * v) - v2
v2 = (2 * v) - v1
v1, v2
v, v2
v, v1
v
v1
v2
v2 = v1 + (a * t)
v1 = v2 - (a * t)
a = (v2 - v1) / t
t = (v2 - v1) / a
v1, a, t
v2, a, t
v2, v1, t
v2, v1, a
v2
v1
a
t
d = ((v1 + v2) / 2) * t
v1 = (2 * d / t) - v2
v2 = (2 * d / t) - v1
t = d / ((v1 + v2) / 2)
v1, v2, t
d, t, v2
d, t, v1
d, v1, v2
d
v1
v2
t
d = (v1 * t) + (1/2 * a * (t^2))
v1 = (d - (1/2 * a * (t^2)) / t
a = (2 * (d - (v1 * t))) / t^2
d = (v2 * t) - (1/2 * a * (t^2))
v2 = (d + (1/2 * a * (t^2)) / t
a = (2 * ((v2 * t) - d)) / t^2
v1, t, a
d, a, t
d, v1, t
v2, t, a
d, a, t
v2, t, d
d
v1
a
d
v2
a
v2^2 = v1^2 + (2 * a * d)
v1^2 = v2^2 - (2 * a * d)
a = (v2^2 - v1^2) / (2 * d)
d = (v2^2 - v1^2) / (2 * a)
v1, a, d
v2, a, d
v2, v1, d
v2, v1, a
v1
v2
a
d
Fg = (G * m1 * m2) / d^2
m1 = (Fg * d^2) / (G * m2)
m2 = (Fg * d^2) / (G * m1)
d^2 = (G * m1 * m2) / Fg
G, m1, m2, d
Fg, d, G, m2
Fg, d, G, m1
G, m1, m2, Fg
Fg
m1
m2
d
g = Fg / m
Fg = g * m
m = Fg / g
Fg, m
g, m
Fg, g
g
Fg
m
g = (v2 - v1) / t
v2 = (g * t) + v1
v1 = v2 - (g * t)
t = (v2 - v1) / g
v2, v1, t
g, t, v1
v2, g, t
v2, v1, g
g
v2
v1
t
d = (v1 * t) + (1/2 * g * (t^2))
v1 = (d - (1/2 * g * (t^2)) / t
g = (2 * (d - (v1 * t))) / t^2
d = (v2 * t) - (1/2 * g * (t^2))
v2 = (d + (1/2 * g * (t^2)) / t
g = (2 * ((v2 * t) - d)) / t^2
v1, t, g
d, g, t
d, v1, t
v2, t, g
d, g, t
v2, t, d
d
v1
g
d
v2
g
uk = Ffr / Fn
Ffr = uk * Fn
Fn = Ffr / uk
Ffr, Fn
uk, Fn
Ffr, uk 
us
Ffr
Fn
us = Ffr / Fn
Ffr = us * Fn
Fn = Ffr / us
Ffr, Fn
us, Fn
Ffr, uk 
us
Ffr
Fn
Fnet = m * a
m = Fnet / a
a = Fnet / m
m, a
Fnet, a
Fnet, m 
Fnet
m
a
Fnet = (m * (v2 - v1)) / t
m = (Fnet * t) / (v2 - v1)
v2 = ((Fnet * t) / m) + v1
v1 = v2 - ((Fnet * t) / m)
t = (m * (v2 - v1)) / Fnet
m, v2, v1, t
Fnet, t, v2, v1
Fnet, t, m , v1
v2, Fnet, t, m
m, v2, v1, Fnet
Fnet
m
v2
v1
t



The text file for the "Earth" procedure



The Pascal code for the "Earth" procedure to determine which equation to use to solve the question. You can view the other equations used for the other procedures (realms) by searching for them within the programme code.


Back to Main Page
Hosted by www.Geocities.ws

1