• Machine Problems •

Seven Segment Display

__________
|        |
|        |
__________
|        |
|        |
__________

Three horizontal segments labelled A, G & D.

Four vertical segments called F, B, E & C

That is, the segments are labelled in a clockwise fashion with the center segment getting the final label. Like CSS margins, the 12 o’clock position is the ‘zero’ position of the labeling scheme.

_A_
F_B
_G_
E_C
_D_

def tuptoseg(x):
  if x.find("A")>-1:
    print ("--------")
  else:
    print ("")
  if x.find("F")>-1:
    print ("|      ",end="")
  else:
    print ("       ",end="")
  if x.find("B")>-1:
    print ("|")
  else:
    print ("")
  if x.find("G")>-1:
    print ("--------")
  else:
    print ("")
  if x.find("E")>-1:
    print ("|      ",end="")
  else:
    print ("       ",end="")
  if x.find("C")>-1:
    print ("|")
  else:
    print ("")
  if x.find("D")>-1:
    print ("--------")
  else:
    print ("")
  return ""
positionDef = ("ABCDEF", "BC", "ABGED", "ABGCD", "FBGC", "AFGCD","FGECD","ABC","ABCDEFG","ABCFG")
for x in positionDef:
    print (tuptoseg(x))