if me.spriteNum = tableau[symbol(string(sprite(me.spriteNum).startFrame))].cards[tableau[symbol(string(sprite(me.spriteNum).startFrame))].cards.count].spnum then
sprite(me.spriteNum).moveableSprite = 1
sprite(me.spriteNum).loc = the mouseLoc
sprite(me.spriteNum).locZ = me.spriteNum + 1000
else
checkpilepos(me.spriteNum)
end if
end if
end
on mouseUp me
global equalvalue, hotcard, cell, tableau, foundation, sha
if me.spriteNum = the clickOn then
if (sprite(me.spriteNum).visible = 1) and (sprite(me.spriteNum).moveableSprite = 1) then
if spriteNum <> tableau[symbol(string(sprite(me.spriteNum).startFrame))].cards[1].spnum then
if (sprite(spriteNum - 1).member.name <> "backofcard") and (sprite(spriteNum - 1).member.name <> "empty") then
if (getValue(sprite(spriteNum).member.name) = (getValue(sprite(spriteNum - 1).member.name) - 1)) and (getSuit(sprite(spriteNum).member.name) = getSuit(sprite(spriteNum - 1).member.name)) then
repeat with shit = spriteNum - 1 to spriteNum - 1
repeat with cakes = 1 to tableau.count
if tableau[cakes].cards.count = 0 then
next repeat
end if
if (getValue(sprite(shit).member.name) = (getValue(sprite(tableau[cakes].cards[tableau[cakes].cards.count].spnum).member.name) - 1)) and (getSuit(sprite(shit).member.name) = getSuit(sprite(tableau[cakes].cards[tableau[cakes].cards.count].spnum).member.name)) then
return 1
exit
next repeat
end if
if (getValue(sprite(shit).member.name) = 13) and (getValue(sprite(tableau[cakes].cards[tableau[cakes].cards.count].spnum).member.name) = 1) and (getSuit(sprite(shit).member.name) = getSuit(sprite(tableau[cakes].cards[tableau[cakes].cards.count].spnum).member.name)) then
return 1
exit
end if
end repeat
end repeat
else
sendSprite(spriteNum - 1, #backCardEQ)
end if
end if
end if
return 0
end
on checkpilepos posi
global tableau, cell
proxymoxy = []
t = tableau[string(sprite(posi).startFrame).symbol].cards.findPos(string(posi).symbol)
if t <> tableau[string(sprite(posi).startFrame).symbol].cards.count then
i = 0
repeat while i < (tableau[string(sprite(posi).startFrame).symbol].cards.count - t)
i = i + 1
if tableau[string(sprite(posi).startFrame).symbol].cards[t + i].suit <> tableau[string(sprite(posi).startFrame).symbol].cards[t + i - 1].suit then
exit repeat
end if
if tableau[string(sprite(posi).startFrame).symbol].cards[t + i].rankvalue <> (tableau[string(sprite(posi).startFrame).symbol].cards[t].rankvalue - i) then