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

  1. on exitFrame me
  2.   global scount, tcount, stock, firstSprite, first_counter, second_counter, tableau, objcounter, card, fcount, foundation, equal_value, garbage, points
  3.   first_counter = 1
  4.   second_counter = 7
  5.   stock = new(script("stock"), shuffle())
  6.   tableau = [:]
  7.   objcounter = 0
  8.   card = [:]
  9.   firstSprite = []
  10.   fcount = 1
  11.   foundation = [:]
  12.   equal_value = 0
  13.   garbage = []
  14.   points = 0
  15.   scount = 1
  16.   tcount = 1
  17. end
  18.  
  19. on shuffle
  20.   templist1 = []
  21.   templist2 = []
  22.   repeat with rank in ["ace", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "jack", "queen", "king"]
  23.     repeat with suit in ["hearts", "clubs", "spades", "diamonds"]
  24.       templist1.add([#rank: rank, #suit: suit])
  25.     end repeat
  26.   end repeat
  27.   repeat while templist1.count > 0
  28.     tempholder = templist1[random(templist1.count)]
  29.     templist2.add(tempholder)
  30.     templist1.deleteOne(tempholder)
  31.   end repeat
  32.   return templist2
  33. end
  34.