Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Card Shuffle code — Gideros Forum

Card Shuffle code

NuuNahNuuNah Member
edited July 2013 in Code snippets
Hi everyone, here is a free card shuffle script, you simply insert how many decks of cards you want, and edit the matrix for the amount of players you want the cards split over, and run. enjoy,.. please leave feedback :)
+1 -1 (+4 / -0 )Share on Facebook

Comments

  • Thanks for sharing. This is why i love this commnity :)>-

    Likes: NuuNah

    +1 -1 (+1 / -0 )Share on Facebook
  • edited July 2013
    Here is another simple shuffle function that i found on the internet, just want to share with you :P
    -- input: table to shuffle 
    local function shuffle(t)
            math.randomseed(os.time())
            assert(t, "table.shuffle() expected a table, got nil")
            local iterations = #t
            local j
            for i = iterations, 2, -1 do
                    j = math.random(i)
                    t[i], t[j] = t[j], t[i]
            end
    end

    Likes: talis, NuuNah

    Coming soon
    +1 -1 (+2 / -0 )Share on Facebook
Sign In or Register to comment.