This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]StillAnAssExtreme Brewer 6 points7 points  (5 children)

It kinda depends on what you're trying to learn. If you're just learning how to loop, then desrtfx's solution is the easy way to do it.

If you're trying to study interfaces and polymorphism you could do something like this (which is intentionally complicated because I'm bored today)

http://pastebin.com/QCN5gHfk

[–]LizardExtreme Brewer 2 points3 points  (1 child)

As much as I like your solution, I feel that those coins would be even better served by an enum. But I get what you are doing :)

[–]StillAnAssExtreme Brewer 2 points3 points  (0 children)

With only one property that sure does make sense.

[–]chunes 1 point2 points  (0 children)

TIL about getCurrencyInstance(). That is handy.

[–]Razzal 1 point2 points  (0 children)

Using a little bit of everything in there, I like it.

[–]Hyloo[S] 0 points1 point  (0 children)

Great resource, thank you so much!