Okay, another question...
While making a card game (blackjack, specifically) , I've run into a
little problem. I have a few different variables: player1Hand,
player2Hand, player3Hand, and so on. In the script, I initialize all of
them to 0, just to make it easier. However, after getting which player
the dealer should deal to next, well... I put the following to find the
loc of where to deal the card:
get "player"& whichPlayerToDealTo &"Hand"
put the value of it into quickHand --quickHand just a catch-all for all
--hands used only for a short time
However, there must be a better way than this. All those "get blahblah"s
are annoying. Even worse, I can't put the value of quickLoc back into
playerXLoc, since something like the following does not work:
get "player"& whichPlayerToDealTo &"Hand"
put quickHand into it
So my question: how can I have the contents of a variable point to a
variable name? If there isn't an indirection operator in MC already
(which I don't think there is) , maybe it'd be nice to have one? (It'd
be GREAT for me to have one... and yes, I know I could be putting all the
values in some array or chunk of text like playerHandValues[2] for
player2Hand. I'd rather see if there's an indirection thing first.)
Thanks much!
--------------------------------
Karl Becker, [EMAIL PROTECTED]
http://www.btigate.com/~funkboy/
Featuring: Tiger's Eye Casino,
MacBasketball, and The Fishin' Hole!