Shenzhen I/O Wiki

◀ Back to conceptMAIL

Transcript[]

Before Completion[]

Enzo Target practice

From: Enzo Capretti <e.capretti@avalon.avalon>
CC: S. Pham <s.c.pham@elec.avalon>

Thoughts?

-

Begin forwarded message:

From: Enzo Capretti <e.capretti@avalon.avalon>
To: Security <security@avalon.avalon>

Status on the new equipment?

-

From: Security <security@avalon.avalon>
To: Enzo Capretti <e.capretti@avalon.avalon>

The nonlethal devices work, but they don’t fire like conventional weapons. In particular the trajectories are slightly different and most of the security personnel here haven’t had a chance to become used to them. If we had a firing range where we could practice, I think we would feel a lot better about using them.

-

From: Enzo Capretti <e.capretti@avalon.avalon>
To: Security <security@avalon.avalon>

According to Lisa there is an electrical engineer in her department who could handle this. I’ll pass it along.

After Completion[]

Enzo Re: Target practice

From: Enzo Capretti <e.capretti@avalon.avalon>

Begin forwarded message:

-

From: Enzo Capretti <e.capretti@avalon.avalon>
To: Security <security@avalon.avalon>

Are the practice ranges operational now?

-

From: Security <security@avalon.avalon>
To: Enzo Capretti <e.capretti@avalon.avalon>

Yup, they’re working great and we’re already seeing improvements in accuracy. Numbers for you soon. Thanks for sorting that one out.

Description[]

  • detect is a simple input that detects when a trainee has fired their weapon.
  • target-x and target-y are simple inputs that detect where the target has been hit.
  • score-1 and score-2 are XBus outputs connected to large numeric displays.
  • Two trainees each take 4 shots and score points depending on where they hit the target. To determine the point value of a shot, find the Euclidean distance (using the Pythagorean theorem) between the hit location and the center of the target, located at (50, 50):
distance < 10 4 points 20 <= distance < 30 1 point
10 <= distance < 20 2 points distance >= 30 -2 points
  • The numeric displays should be updated with the trainee's scores as they compete, and should flash 3 times at the end before turning off to indicate that the game is over.