Operators are technically standard library functions anyways, though. Why not other math functions like absolute value or pow? (since for some stupid reason c++ doesn't have an exponent operator)
Of course there isn't a real reason to be this efficient with this code. Other than trying to think in that mindset when coding in the first place. I think she wants to separate the wheat from the chaff, though.
This assignment could have taken 20 mins. The basic algorithm was simple as long as you knew what Hamming Codes, Gray Codes, Excess-127, etc was. It the added constraints that were the difficult part.
I suppose that was the way to make this a "final project" of sorts.
Of course there isn't a real reason to be this efficient with this code. Other than trying to think in that mindset when coding in the first place. I think she wants to separate the wheat from the chaff, though.
This assignment could have taken 20 mins. The basic algorithm was simple as long as you knew what Hamming Codes, Gray Codes, Excess-127, etc was. It the added constraints that were the difficult part.
I suppose that was the way to make this a "final project" of sorts.
"There remain four irreducible objections to religious faith: that it wholly misrepresents the origins of man and the cosmos, that because of this original error it manages to combine the maximum servility with the maximum of solipsism, that it is both the result and the cause of dangerous sexual repression, and that it is ultimately grounded on wish-thinking." ~Christopher Hitchens, god is not Great
PM me your email address to join the Slack chat! I'll give you a taco(or five) if you join! --->There's an app and everything!<---
PM me your email address to join the Slack chat! I'll give you a taco(or five) if you join! --->There's an app and everything!<---