Thread: manually sorting cards

  1. #16
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Quote Originally Posted by nvoigt View Post
    Hire 10 Indians or Ukrainians to do it for you ?
    10 indians or 15 ukrainians. The ukrainians ive dealt with are barely worth 2/3 of an indian Although at least the ukrainians speak regular english, not hindified english.
    Last edited by abachler; 05-13-2008 at 02:37 PM.

  2. #17
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    it's actually not poker cards, but those flash cards thing (memory aids) for studying for tests that our teacher gave us (with a question on one side, and answer on the back), and we have to sort them before returning them (they are numbered) =). Wonder how non-CS people would do it...

    Wow. We need lives.
    It's a Real Thing =).

    Hmm direct placement sort sounds like fun, except those cards are pretty big, so it will go over the memory contraint (the desk) to spread them out.

    Even more efficient, don't sort the cards at all, but merely imagine that they are sorted.
    haha, and I will also need to imagine that my teacher doesn't mind.

  3. #18
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Thantos View Post
    It kinda matters what type of cards these are also and how you want to sort them. For example if you were trying to sort two playing decks (104 cards) then I would just make a pile for each type of card (2s, 3s, Js, Qs, etc). If you wanted to do them by suit and rank then I'd probably just make 8 rows each with a suit and then put the card in the right spot (insertion sort) as I got to it.
    If definitely matters what is on the cards. My little joke about just imagining the cards to be sorted actually has some seriousness behind it. If all you have is a stack of 100 cards numbered 1-100, what is the point in sorting them? By sorting them, you will just discover what you already know -- that they will be in the sequence 1, 2, 3, ... 100.

    So it's just as useful to simply imagine that they are already in the correct order. If somebody asks "What's the value on the 53rd card?" you can immediately say "53" without actually sorting the cards.

    If the cards are more than just numbers, then suddenly a point to doing this materializes.

  4. #19
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    If somebody says, "give me card #53," then perhaps a sorted deck makes sense on its own.

  5. #20
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    Perhaps a radix sort then. You could sort by the digits on the ID number and be done by the third pass I think.

  6. #21
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    Nah, definitely a bubble sort. That should keep you occupied.

  7. #22
    Banned
    Join Date
    Nov 2007
    Posts
    678
    Quote Originally Posted by mike_g View Post
    Nah, definitely a bubble sort. That should keep you occupied.
    Try emulating Recursive Quick Sort!

  8. #23
    Banned
    Join Date
    Nov 2007
    Posts
    678
    Quote Originally Posted by abachler View Post
    10 indians or 15 ukrainians. The ukrainians ive dealt with are barely worth 2/3 of an indian Although at least the ukrainians speak regular english, not hindified english.
    That is very crude statement! I am working with an Ukrainian, and the English he speaks, oh, any child from India would speak better!
    His sentences are like a riddle to me

    Indian speak English better than or similar to British/USAians

    Edit: Do not judge this by the standard (or lack of it) of my English

  9. #24
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Quote Originally Posted by PING View Post
    Or maybe 100 Germans
    That depends on your definition of "efficient". If you need an overpaid comitee and a workers union pondering over how to name the special card sleeves that protect the workers from cutting themselves with a card, a 20 people strong department of specialist card-workers, trained 5 years at a university to determine any nuance of a card to find out it's real value, 50 Marketing experts to sell card sorting shirts, flags and mugs, 2 Lawyers sueing people over unauthorized copying of cards, another 4 Lawyers to somehow find a way for tax deductions of cards and three elected upholders of the card's rights to privacy while being sorted, then yes, 100 Germans could do the job just fine (in case you wonder: the rest of them would sit on their respective couches and complain about not having a job in card sorting because with over 30 years you are clearly too old to sort properly). If on the other hand "efficient" means in less time and/or for less money than you would need to do it yourself, then I'd go with the indians/ukrainians
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  10. #25
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    If the cards are numbered, why not just sort usig the number as the index into the array (placement on the desk). cards 1-10 in the top row, 91-100 in the bottom row. KISS.
    Last edited by abachler; 05-14-2008 at 08:14 AM.

  11. #26
    Registered User
    Join Date
    Nov 2004
    Location
    USA
    Posts
    516
    That depends on your definition of "efficient".
    What I had in mind with a hundred Germans was this : Give each German a card, then start calling out the card number one by one, in order, and the respective German would come ahead and deposit the card
    Code:
    >+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.

  12. #27
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Quote Originally Posted by PING View Post
    What I had in mind with a hundred Germans was this : Give each German a card, then start calling out the card number one by one, in order, and the respective German would come ahead and deposit the card
    Or we could get 100 jews and tell them you will pay them the value of the cards, then sort the jews by size, the smallest ones will have the lowest cards.

    Now stop picking on German's or I will have to keep things balanced.

  13. #28
    Registered User
    Join Date
    Nov 2004
    Location
    USA
    Posts
    516
    Now stop picking on German's or I will have to keep things balanced.
    Exactly my point, stop poking fun at nationalities beyond some point it stops being funny.
    Code:
    >+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.

  14. #29
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    As long as we can agree to drop the issue Im satisfied that the matter is settled.
    Last edited by abachler; 05-14-2008 at 04:09 PM.

  15. #30
    Registered User
    Join Date
    Nov 2004
    Location
    USA
    Posts
    516
    The problem is PING, you started out by picking at germans by elevating the required number relative to ukrainians and indians. Germans arent exactly known for being (although I'm positive they are) programmers, while both Indians and Ukrainians have that steroetype.
    My post was directed at nvoigt. Anyways, I'm staying out of this debate, back to the original topic..
    Code:
    >+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help with linked list sorting function
    By Jaggid1x in forum C Programming
    Replies: 6
    Last Post: 06-02-2009, 02:14 AM
  2. Help it won't compile!!!!!
    By esbo in forum C Programming
    Replies: 58
    Last Post: 01-04-2009, 03:22 PM
  3. Help!For poker game simulation
    By tx1988 in forum C++ Programming
    Replies: 24
    Last Post: 05-25-2007, 09:59 PM
  4. Cribbage Game
    By PJYelton in forum Game Programming
    Replies: 14
    Last Post: 04-07-2003, 10:00 AM
  5. playing ... cards??
    By GiraffeMan in forum C Programming
    Replies: 16
    Last Post: 02-06-2002, 03:51 PM