[Tutor] Card Tricks!

Tesla Coil tescoil@ilbbs.com
Thu, 22 Aug 2002 20:03:18 -0500


Requires:  http://gurno.com/adam/cards

Last entry in the changelog is 6.30.2000, and comment in 
the "war" demo regards an uncorrected bug -- one of those 
pre-Useless Python examples of "no one expects to find it 
scattered off on your URL anyway."
 
Whatta shame, it has so much Useless potential.

One such problem here, but each attempt I've made at it 
slams into one or another index error.  At this point,
I'd be pleased to see something that *begins* to work:

#!/usr/bin/python
# AccSov.py - Solve Accordian solitaire, or, 
# give it a good whack anyhow.
#
# All cards are dealt to a single list.
#
# Cards may be moved to delete the card one or three
# positions to the left only if the same rank or suit.
#
# Objective is to reduce the list to a single card.

import cards

def Spread():
    deck = cards.card_deck()
    deck.populate()
    deck.shuffle()
    accordian = deck.deal(1, 52)
    return accordian[0]

acc = Spread()