Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

I have no idea why it won't run

Name: Anonymous 2012-07-16 3:41

For some reason i get a syntax error at the input near the end whenever trying to run this:
http://pastebin.com/2VR4Jdf2
 
It worked 5 minutes ago but now it won't even start running.
Which makes no sense by the way because the supposed "error" is at the bottom of the file and python is interpreted!

Name: Anonymous 2012-07-16 7:35

Let's paste the whole code so we could laugh at >>1-kun long after the pastebin is gone and some idiot or spambot bumps this thread on 2015 or so.

airwar.py

from deck import *
import random
from collections import deque

while True:
#init
    gamenotover=True
    deck=deque()
    edeck=deque()
    hand=deque()
    ehand=deque()
    filldeck(deck)
    filldeck(edeck)
    random.shuffle(deck)
    random.shuffle(edeck)
    cardsleft=52
    ecardsleft=52

#game start
    while gamenotover:
        print '\n%r'%(cardsleft)
        print '\n%r'%(ecardsleft)
        if cardsleft<5:
            print '\nYou lose.'
            gamenotover=False
        elif ecardsleft<5:
            print '\nYou win!'
            gamenotover=False

#deal
        else:
            pcardsleft=dealto(deck, hand, 5)
            ecardsleft=dealto(edeck, ehand, 5)
           
            print '\nYour opponent\'s hand is:'
            for card in hand:
                print display(card)
            print "\nYour hand is:"
            for card in ehand:
                print display(card)
#choose order
                #pass
#battle
            dlist=deque()
            edlist=deque()
            for i in range(5):
                print '\ncard:%r ecard:%r'\
                      %(display(hand[i]), display(ehand[i]))
                if ehand[i][1]>hand[i][1]:
                    dlist.append(hand[i])
                    print 'deleted card:%r'%(display(hand[i]))
                elif hand[i][1]>ehand[i][1]:
                    edlist.append(ehand[i])
                    print 'deleted ecard:%r'%(display(ehand[i]))
                elif hand[i][1]==ehand[i][1]:
                    pass
            if dlist:
                for card in dlist:
                    print '\ncard:%r'%(display(card))
                    hand.remove(card)
            if edlist:
                for ecard in edlist:
                    print '\necard: %r'%(display(ecard))
                    ehand.remove(ecard)
#ready for next turn
            if hand:
                dealto(hand, deck, len(hand))
            if ehand:
                dealto(ehand, edeck, len(ehand)
                      
    choice=input('Play again?\n')
    if choice[0]=='y' or choice[0]=='Y':
        pass
    else:
        break


deck.py

from collections import deque


def filldeck(deck):
    for i in range(52):
        deck.append(((i/13)+1, (i%13)+1))
    return deck

def display(card):
    if card:
        suits=['hearts', 'clubs', 'diamonds', 'spades']
        names=['Ace', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight',\
        'Nine', 'Ten', 'Jack', 'Queen', 'King']
       
        return '%r of %r'%(names[card[1]-1], suits[card[0]-1])

def dealto(deck1, deck2, number):
    if number>len(deck1):
        number=len(deck1)
    for i in range(number):
        deck2.append(deck1.popleft())
    return len(deck1)

##deck=deque()
##filldeck(deck)
##for card in deck:
##    display(card)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List