Re: Deck of Cards Question...

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hello Ck,

  One way to handle these kinds of problems is to
use the 'pass the buck' method: pass the variables to the
function, return the same variables, altered by the function's
routines.  This achieves encapsulation at the cost of an added
global function name to the program (usually very tolerable).

global function shuffle(sequence deck)
  --pass deck to be shuffled

  --place shuffle routine here:

  --

  return deck  --returns shuffled deck

end function


Good luck with it.

--Al

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu