home *** CD-ROM | disk | FTP | other *** search
Wrap
global pootimer, tableau on shuffle templist1 = [] templist2 = [] repeat with rank in ["ace", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "jack", "queen", "king"] repeat with suit in ["hearts", "clubs", "spades", "diamonds"] templist1.add([#rank: rank, #suit: suit]) end repeat end repeat repeat while templist1.count > 0 tempholder = templist1[random(templist1.count)] templist2.add(tempholder) templist1.deleteOne(tempholder) end repeat return templist2 end on gethotcard somecard global cell, foundation, tableau if (somecard >= 114) and (somecard <= 117) then resultz = cell[symbol(string(somecard))] end if if (somecard >= 118) and (somecard <= 121) then resultz = foundation[symbol(string(somecard))] end if if (somecard >= 10) and (somecard <= 113) then resultz = tableau[symbol(string(sprite(somecard).startFrame))] end if return resultz end on gethotcardtwo somecard global cell, foundation, tableau if (somecard >= 114) and (somecard <= 117) then resultz = cell[symbol(string(somecard))].cards[cell[symbol(string(somecard))].cards.count] end if if (somecard >= 118) and (somecard <= 121) then resultz = foundation[symbol(string(somecard))].cards[foundation[symbol(string(somecard))].cards.count] end if if (somecard >= 10) and (somecard <= 113) then resultz = tableau[symbol(string(sprite(somecard).startFrame))].cards[symbol(string(somecard))] end if return resultz end on subpoints somecard global cell, foundation, tableau, points if (somecard < 118) or (somecard > 121) then points = points - 20 end if end on checkwin global foundation repeat with i = 1 to 4 if foundation[i].cards.count = 0 then exit repeat end if if foundation[i].cards[foundation[i].cards.count].rank <> "king" then exit repeat end if if i = 4 then win = "yes" pootimer = timeout("fuckt").new(130, #gotoit) end if end repeat checklose() end on addpoints somecard global points if (somecard >= 118) and (somecard <= 121) then points = points + 20 end if end on hiya somecard global cell, foundation, tableau if (somecard >= 114) and (somecard <= 117) then resultz = 0 end if if (somecard >= 118) and (somecard <= 121) then resultz = 0 end if if (somecard >= 10) and (somecard <= 113) then resultz = 1 end if return resultz end on checklose repeat with it = 1 to tableau.count if tableau[it].cards.count = 0 then next repeat end if shit = tableau[it].cards[tableau[it].cards.count].spnum repeat with cakes = 114 to 117 if sprite(cakes).member.name = "grayback" then abort() end if end repeat repeat with cakes = 118 to 121 if sprite(cakes).member.name = "grayback" then if getValue(sprite(shit).member.name) = 1 then abort() end if next repeat end if if (getValue(sprite(shit).member.name) = (getValue(sprite(cakes).member.name) + 1)) and (getSuit(sprite(shit).member.name) = getSuit(sprite(cakes).member.name)) then abort() end if end repeat repeat with akes = 1 to tableau.count if tableau[akes].cards.count = 0 then if getValue(sprite(shit).member.name) = 13 then abort() end if next repeat end if cakes = tableau[akes].cards[tableau[akes].cards.count].spnum if (getValue(sprite(shit).member.name) = (getValue(sprite(cakes).member.name) - 1)) and (getSuit(sprite(shit).member.name) = getSuit(sprite(cakes).member.name)) then abort() end if end repeat if sprite(tableau[it].cards[tableau[it].cards.count].spnum).backCardEQ() then abort() end if end repeat repeat with shit = 114 to 117 if sprite(shit).member.name = "grayback" then next repeat end if repeat with cakes = 118 to 121 if sprite(cakes).member.name = "grayback" then if getValue(sprite(shit).member.name) = 1 then abort() end if next repeat end if if (getValue(sprite(shit).member.name) = (getValue(sprite(cakes).member.name) + 1)) and (getSuit(sprite(shit).member.name) = getSuit(sprite(cakes).member.name)) then abort() end if end repeat repeat with akes = 1 to tableau.count if tableau[akes].cards.count = 0 then if getValue(sprite(shit).member.name) = 13 then abort() end if next repeat end if cakes = tableau[akes].cards[tableau[akes].cards.count].spnum if (getValue(sprite(shit).member.name) = (getValue(sprite(cakes).member.name) - 1)) and (getSuit(sprite(shit).member.name) = getSuit(sprite(cakes).member.name)) then abort() end if end repeat end repeat win = "no" pootimer = timeout("poo").new(130, #gotoit) end on gotoit pootimer.forget() go("gameover") end on getValue arg if (arg contains "hearts") or (arg contains "spades") then return getOff(chars(arg, 1, arg.length - 7)) else if arg contains "diamonds" then return getOff(chars(arg, 1, arg.length - 9)) else if arg contains "clubs" then return getOff(chars(arg, 1, arg.length - 6)) end if end if end if end on getOff numba if numba = "ace" then return 1 else if numba = "two" then return 2 else if numba = "three" then return 3 else if numba = "four" then return 4 else if numba = "five" then return 5 else if numba = "six" then return 6 else if numba = "seven" then return 7 else if numba = "eight" then return 8 else if numba = "nine" then return 9 else if numba = "ten" then return 10 else if numba = "jack" then return 11 else if numba = "queen" then return 12 else if numba = "king" then return 13 end if end if end if end if end if end if end if end if end if end if end if end if end if end on getSuit arg if arg contains "hearts" then return #hearts else if arg contains "diamonds" then return #diamonds else if arg contains "clubs" then return #clubs else if arg contains "spades" then return #spades end if end if end if end if end