PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""
In this simple game you try to score a free throw. The code shows the path of the ball as it flies through the air and bounces of the walls.
How many tries before you can score?
input: speed (in km/h)
angle (in degrees)
example input:
28 60
"""
# constants: mass(m),gravity(g)
# parameters: acceleration(a,ax,ay), velocity(v,vx,vy), position(x:horizontally,y:vertically), angle(alpha),time(t),time-step(dt)
# forces: gravitational (fz), total forces(fres,fresx,fresy)
from math import sqrt,sin,cos,pi
curve = []
score = 0
for y in range(40):
curve.append([])
for x in range(40):
curve[y].append(" ")
def ring(x,y,str=curve):
for i in range(5):
curve[39-y][x+i] = "="
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run