Python Forum
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
card 21 trick
#11
First off, you don't need to keep quoting a reply.
(Aug-18-2017, 12:27 PM)SummoningZ Wrote: Can anyone show me what this would look like?

What what would look like? Here's the deal, we will gladly help with homework, but we will not do it for you. You need to show us code that you have written, not copied from an existing program. If you want to use his program as a guide, that's fine, as long as you understand what he is doing.

My advice is the best way for you to go is to get a deck of 52 cards and perform the trick, writing down each step as you do it, until the game is done.

For example:
At the start of every new game, you must:
1) shuffle the deck
2) select the first 21 cards from the top of the deck (the remainder are set aside)
3) deal out three cards to create row one
4) repeat for rows 2 - 7
You now have 3 columns with 7 rows each (displayed, so player can see them)
5) Ask the user which column the card is in 

and so on. When done, you will have a fairly good idea of what you have to do and in what order. Again, for example, the first thing is you need to define the "deck", this can be a list of all 52 cards. Next you need to "shuffle" the deck (list) so they are "random", how would you do that, then you need to take the first 21 "cards" from the "deck" to create a "pack", how would you do that. How would you ensure that this only happens once, at the beginning of a new game. Are any of the steps repeated? If so, they are a good candidate for a function. Continue on until you can reveal the eleventh card of the pack as the correct card.

If you run into a problem, post your code (between the code tags) with a specific question. If you are getting an output, what is the output versus what you expect the output to be, if you get an error, post the error in it's entirety (between the error tags).

Again, we are happy to help, but you have to make an effort.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition


Messages In This Thread
card 21 trick - by SummoningZ - Aug-16-2017, 05:50 PM
RE: I need help with my coding - Python 3 - by sparkz_alot - Aug-18-2017, 01:48 PM
RE: card 21 trick - by metulburr - Aug-22-2017, 04:54 PM
RE: card 21 trick - by SummoningZ - Aug-22-2017, 07:56 PM
RE: card 21 trick - by SummoningZ - Aug-24-2017, 10:30 AM
RE: card 21 trick - by metulburr - Aug-24-2017, 12:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Turtle Graphics Card Values in a List Muzz 0 2,379 Apr-11-2019, 12:55 PM
Last Post: Muzz
  card dealer school project kalle1234 5 12,205 Jan-05-2019, 09:21 PM
Last Post: ichabod801
  Playing Card Sorting ness828 4 87,297 Feb-05-2018, 09:01 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020