At My Fingertips

Documentation

Flag Semaphore

Flag semaphore is a system for visually communicating messages using a pair of flags.

Here are the 26 letters of the English alphabet in flag semaphore:

alphabet

Similarity and Differences

They all contain a stick figure with a head and a body, with a letter on their chest and two arms. Each arm holds a flag.

The letter differs, and the rotation angle of the arms differ. It seems that for each letter there is a corresponding pair of arm rotations.

Implement

Hints:

  • Use a dictionary to translate between a letter (str) and a tuple of angles (one angle per arm).
  • Compose the graphic out of three parts: the body (with head), the left arm (with flag), and the right arm (with flag).
  • Place each arm with flag in a (transparent) circle, starting from the circle's center, rotated by the desired degree.
  • Place each arm circle beside a transparent gap (the left arm circle has a gap on its right, and the right arm circle has a gap on its left).
  • To get the complete graphic, compose the two shifted circles, and overlay the body on top.
  • The size of the graphic is specified by providing the diameter of the circle that surrounds an arm with a flag.
Loading...

This activity has been created by LuCE Research Lab and is licensed under CC BY-SA 4.0.

Flag Semaphore

Logo of PyTamaro

PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI

Privacy PolicyPlatform Version c08406b (Wed, 20 Nov 2024 12:30:00 GMT)