biathlon.frink

Download or view biathlon.frink in plain text format


/** This program draws scaled targets for the biathlon so you can see how tiny
they actually are.  It allows you to make targets that will fit inside your
room.

"The target range shooting distance is 50 metres (160 ft). There are five
circular targets to be hit in each shooting round. When shooting in the prone
position the target diameter is 45 millimetres (1.8 in), when shooting in the
standing position the target diameter is 115 millimetres (4.5 in)."

The size of the target probably won't be accurate on screen, as almost no
operating system reports screen resolution accurately.  You should print the
target for accurate results.  */


dist = "50 m"
distStr = input["Enter length of your room: ", dist]
dist = eval[distStr]

origdist = 50 m
origprone = 45 mm
origstanding = 115 mm

scale = dist/origdist
println["Scale is $scale."]

g = new graphics
g.color[0,0,0]
g.font["SansSerif", .2 in]

pronediam = origprone scale
standingdiam = origstanding scale

g.fillEllipseCenter[0 in, 0 in, pronediam, pronediam]
g.text["Prone", 0 in, 1/2 standingdiam + .5 in]

g.fillEllipseCenter[standingdiam, 0 in, standingdiam, standingdiam]
g.text["Standing", standingdiam, 1/2 standingdiam + .5 in]

g.text["Place target $distStr away.", 1/2 standingdiam, 1/2 standingdiam + 1 in]

g.show[]
g.print[]


Download or view biathlon.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 19944 days, 16 hours, 8 minutes ago.