Skip to content

Instantly share code, notes, and snippets.

View patrick-gleeson's full-sized avatar

Patrick Gleeson patrick-gleeson

View GitHub Profile
@patrick-gleeson
patrick-gleeson / challenge.md
Last active January 13, 2020 11:50
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:

@patrick-gleeson
patrick-gleeson / README.md
Last active March 2, 2020 09:09
Funky Finance Challenge

Funky Finance

The leadership team at Loan-U-Like are worried about morale among their loan advisors. Advisors spend hours working out loan details for their customers using drab, boring hand-held calculators, and they're reporting low levels of job satisfaction.

The solution: software. And not just software. Fun software. You have been commissioned to write a program that enables users to perform calculations quickly and easily. To make it a cheerful experience, all numbers output by the software must be displayed in something called 'FunkyFont', a set of glyphs bought at great expense from a trendy continental design agency.

Business Logic

Loan-U-Like offers 'interest-only' loans. Customers borrow a lump sum for a set period of time, and every year must pay off that year's interest in full. At the end of the time period, they must pay off the original sum as well.

@patrick-gleeson
patrick-gleeson / posts.rb
Created December 20, 2017 11:03
Never do this
# The coding community is, and should be a welcoming and respectful place, and as such
# I don't think it's fair to mock bad code when it's produced by a beginner or student,
# or when it's created for free for the public benefit, such as on an open source project.
# However, we also need to be accountable to our customers, clients and users, and when
# we produce terrible code in exchange for money, we should expect our peers to call us
# out on it.
# In that spirit, I don't feel guilty about sharing one of the most innovatively
# terrible pieces of Ruby code I have ever seen. It was written by a team of professional