enumerations_1.sf 234 B

123456789101112131415161718
  1. #!/usr/bin/ruby
  2. #
  3. ## https://rosettacode.org/wiki/Enumerations
  4. #
  5. enum {
  6. Apple=3,
  7. Banana, # gets the value 4
  8. Cherry="a",
  9. Orange, # gets the value "b"
  10. };
  11. say Apple;
  12. say Banana;
  13. say Cherry;
  14. say Orange;