[plt-scheme] How to rotate a card ninety degrees?
I'm playing with the games/cards collection, and want to do something
that (I don't think) it can do as it stands: I want to draw a card
rotated, that is, with the long side running left-right, instead of
up-down as it currently works.
The ideal would be if I could do this using just the methods and
fields that cards.ss provides, but I suspect that's not possible.
Next best would be if I could do it by subclassing something or other.
I don't really know if that's possible. (Note that my grasps of both
object-oriented programming and graphics programming are ... shall we
say ... tenuous.)
The worst alternative would be to hack the exisiting classes to
provide that feature. This would be acceptable if I submitted the
hack as a patch, and the PLT folks accepted it. But if they didn't,
then every time I update my version of DrScheme, in order to draw
cards the way I want, I'd have to patch that source. Yuck!
Anyway, I think I can precisely describe what I want: a new "table"
method like this:
> horizontal :: (send t horizontal) - returns #t if card is horizontal.
> horizontal :: (send t horizontal horizontal?) - turns card
horizontally if horizontally? is true, vertical
otherwise.
Can anyone point me in the right direction? Thanks.
--
But users will not now with glad cries glom on to a language that
gives them no more than what Scheme or Pascal gave them.
-- Guy Steele,
http://www.sun.com/research/jtech/pubs/98-oopsla-growing.ps