Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

New Tutorial: Creating, Shuffling & Dealing A Deck of Cards
Started by iNSERT.CODE Jun 10 2012 06:31 PM

14 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

iNSERT.CODE

[GLOBAL: userInfoPane.html]
iNSERT.CODE
  • Starter
  • PipPipPipPipPipPip
  • 105 posts
  • Jedi

Hi all,

I've just posted a new tutorial on my blog and thought I'd post it here too for anyone who is interested in taking a look.

The tutorial is based around a simple plug and play lua function that can take a table and thoroughly shuffle the data into a completely random order. Of course, this works for any table of data - not just a deck of playing cards as in the example.

There is a project and code that you can download from the web site (link below) that demonstrates how to easily create a deck of cards in order, shuffling them, and also returning them to their original order.

The project also demonstrates dealing the cards out to predetermined locations on the screen, using coded animations to move and pseudo-flip them.

Anyway, I hope you find it useful and below is a screenshot and a link to the tutorial:


New Tutorial: Creating, Shuffling & Dealing A Deck of Cards



New Tutorial: Creating, Shuffling & Dealing A Deck of Cards
uid: 74503 topic_id: 27364 reply_id: 327364


[TOPIC: post.html]
#2

peach pellen

[GLOBAL: userInfoPane.html]
peach pellen
  • Alumni
  • PipPipPipPipPipPip
  • 8,866 posts
  • Jedi

This looks awesome, really looking forward to checking it out :)
uid: 52491 topic_id: 27364 reply_id: 111144


[TOPIC: post.html]
#3

Danny

[GLOBAL: userInfoPane.html]
Danny
  • Corona Staff
  • 2,312 posts
  • Jedi

Thanks for sharing!
uid: 84637 topic_id: 27364 reply_id: 111145


[TOPIC: post.html]
#4

robmiracle

[GLOBAL: userInfoPane.html]
robmiracle
  • Starter
  • PipPipPipPipPipPip
  • 2,971 posts
  • Jedi

Well done!
uid: 19626 topic_id: 27364 reply_id: 111170


[TOPIC: post.html]
#5

OwenYang

[GLOBAL: userInfoPane.html]
OwenYang
  • Enterprise
  • PipPipPipPipPipPip
  • 160 posts
  • Jedi

thanks :)
uid: 25057 topic_id: 27364 reply_id: 111204


[TOPIC: post.html]
#6

Naomi

[GLOBAL: userInfoPane.html]
Naomi
  • Pro
  • PipPipPipPipPipPip
  • 2,271 posts
  • Jedi

Sounds great. Can't wait to take a look. Thanks for sharing!

Naomi
uid: 67217 topic_id: 27364 reply_id: 111230


[TOPIC: post.html]
#7

martin.edmaier

[GLOBAL: userInfoPane.html]
martin.edmaier
  • Starter
  • PipPipPipPipPipPip
  • 206 posts
  • Jedi

Nice one not so advanced like mine but good to begin;)
uid: 86417 topic_id: 27364 reply_id: 111231


[TOPIC: post.html]
#8

iNSERT.CODE

[GLOBAL: userInfoPane.html]
iNSERT.CODE
  • Starter
  • PipPipPipPipPipPip
  • 105 posts
  • Jedi

Thanks for your comments everyone and I'm glad it's being useful for people.

It's not actually part of an app project that I'm doing, just an idea for a bit of a tutorial/example code for Corona SDK users to look at and play around with. I like to make little tutorials like this when I can find some (very limited) free time.

@martin.edmaier Not sure what you mean sorry. Do you have some sort of similar tutorial up on the web somewhere? I'll take a look if so...compare technique etc...
uid: 74503 topic_id: 27364 reply_id: 111233


[TOPIC: post.html]
#9

martin.edmaier

[GLOBAL: userInfoPane.html]
martin.edmaier
  • Starter
  • PipPipPipPipPipPip
  • 206 posts
  • Jedi

@Insert.Code i made a game a bit similar to Blackjack.
uid: 86417 topic_id: 27364 reply_id: 111238


[TOPIC: post.html]
#10

Cell Game Labs

[GLOBAL: userInfoPane.html]
Cell Game Labs
  • Pro
  • PipPipPipPipPipPip
  • 91 posts
  • Jedi

Looks good cheers
uid: 26289 topic_id: 27364 reply_id: 111297


[TOPIC: post.html]
#11

iNSERT.CODE

[GLOBAL: userInfoPane.html]
iNSERT.CODE
  • Starter
  • PipPipPipPipPipPip
  • 105 posts
  • Jedi

@martin.edmaier Ahh, OK. Well, this isn't supposed to be as advanced as a functional/completed game. There's no game logic and such as it's just to build on the plug and play shuffle function that the tutorial is based on. It's just a free demonstration of how such a function may be used in an app.

@CELL Thanks
uid: 74503 topic_id: 27364 reply_id: 111564


[TOPIC: post.html]
#12

Whiteball

[GLOBAL: userInfoPane.html]
Whiteball
  • Pro
  • PipPip
  • 14 posts
  • Member

Looks nice, shame I can't get a copy of the code though. I neither have (or will have) Facebook or Twitter.

I always thought the 'like us on facebook' was bad enough but now this whole 'tweet & get it' thing going round seems just as odd.
uid: 37683 topic_id: 27364 reply_id: 112017


[TOPIC: post.html]
#13

iNSERT.CODE

[GLOBAL: userInfoPane.html]
iNSERT.CODE
  • Starter
  • PipPipPipPipPipPip
  • 105 posts
  • Jedi

@Whiteball Thanks for your interest in the sample code.

I appreciate that you don't have Twitter or Facebook and that's no problem. Email me at contact_at_insertco.de (obviously replace '_at_' for @) and I'll send you a direct download link to the project file on my server. Same goes to anyone else reading this post of course.

I enjoy putting together tutorials like this, and I'm happy to give things like this away to help people who are trying to learn Corona. I have very (very, very) limited free time however - as I'm sure everyone does really. I've seen similar sites charge a few dollars (or more) for things and I'm not about that. I think that a single (free) mention for the link is not all that much to ask for readers to be able to download full project files with reusable code snippets demonstrating various techniques and ways of achieving certain things. Am I wrong in that?

Cost to the user = 0
Cost to me = Personal time, effort and bandwidth

...and I'm fine with that
uid: 74503 topic_id: 27364 reply_id: 112024


[TOPIC: post.html]
#14

Whiteball

[GLOBAL: userInfoPane.html]
Whiteball
  • Pro
  • PipPip
  • 14 posts
  • Member

Thanks for the quick response. I've sent a mail with a short note. Thanks.


uid: 37683 topic_id: 27364 reply_id: 112025


[TOPIC: post.html]
#15

Jam Paraiso

[GLOBAL: userInfoPane.html]
Jam Paraiso
  • Starter
  • PipPipPipPipPipPip
  • 95 posts
  • Jedi

hello there,

 

the link doesn't work anymore.. it says pageok nothing more..




[topic_controls]
[/topic_controls]