home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / AuldLangSyn.dxr / 00004.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  696 b   |  35 lines

  1. on addfoundation obj
  2.   global foundation
  3.   foundation()
  4. end
  5.  
  6. on addreserve
  7.   global reserve
  8. end
  9.  
  10. on dealcards
  11.   global stock
  12. end
  13.  
  14. on shuffle
  15.   templist1 = []
  16.   templist2 = []
  17.   repeat with rank in ["two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "jack", "queen", "king"]
  18.     repeat with suit in ["hearts", "clubs", "spades", "diamonds"]
  19.       templist1.add([#rank: rank, #suit: suit])
  20.     end repeat
  21.   end repeat
  22.   repeat while templist1.count > 0
  23.     tempholder = templist1[random(templist1.count)]
  24.     templist2.add(tempholder)
  25.     templist1.deleteOne(tempholder)
  26.   end repeat
  27.   return templist2
  28. end
  29.  
  30. on gotoit
  31.   global pootimer
  32.   pootimer.forget()
  33.   go("gameover")
  34. end
  35.