Skip to content

Instantly share code, notes, and snippets.

@patrick-gleeson
Last active January 13, 2020 11:50
Show Gist options
  • Save patrick-gleeson/9d4cec15ad0020e2aff0def68920be4c to your computer and use it in GitHub Desktop.
Save patrick-gleeson/9d4cec15ad0020e2aff0def68920be4c to your computer and use it in GitHub Desktop.
A quick coding challenge

Please write a Ruby function that accepts an integer, formats it and prints it to the console so that each digit is surrounded by the following characters:

 ---
|   |
 ===

The digits should be printed in a horizontal line and joined by a *. E.g. if the argument provided to the function is 236, it should print out:

 ---   ---   --- 
| 2 |*| 3 |*| 6 |
 ===   ===   ===
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment