fork download
  1. type
  2. Direction = enum
  3. north, east, south, west
  4. BlinkLights = enum
  5. off, on, slowBlink, mediumBlink, fastBlink
  6. LevelSetting = array[north..west, BlinkLights]
  7. var
  8. level: LevelSetting
  9. level[north] = on
  10. level[south] = slowBlink
  11. level[east] = fastBlink
  12. echo repr(level) # --> [on, fastBlink, slowBlink, off]
  13. echo low(level) # --> north
  14. echo len(level) # --> 4
  15. echo high(level) # --> west
  16.  
Success #stdin #stdout 0s 4356KB
stdin
Standard input is empty
stdout
[132097 (invalid data!), 288230376151712260 (invalid data!), 1125899906842626 (invalid data!), 4398046511104 (invalid data!)]

north
4
west