This piece of code crashes the game (note the function called 'deck'):
Code: Select all
init -3 python:
import pygame
SUITS={u'С':u'Сила',
u'Д':u'Деньги',
u'З':u'Знания',
u'И':u'Интриги'}
DEFAULT_HISTORY = u'Вам не известна история этой карты'
# SPENDABLE_COLOR and PERMANENT_COLOR are used by a format method, so they are without '#'
SPENDABLE_COLOR = 'AAAAAA'
PERMANENT_COLOR = 'DEC666'
COST_QOTIENT = 1.5 # Cost-to-nominal ratio for trading system
# Various utility functions
def deck(deckline):
'''
Given a deck-describing line, return a list of cards.\
Line syntax is like 0С2Д2Д, etc. etc. Number, then suit, repeat for all cards\
'0' means '10' because fuck you, that's why\
'''
if not (type(deckline) == unicode):
raise TypeError('Only unicode line accepted by deck constructor')
d = []
l=list(deckline)
while len(l)>0:
num = int(l.pop(0))
suit = l.pop(0)
d.append(Card(suit, num))
return d
Code: Select all
init -3 python:
import pygame
SUITS={u'С':u'Сила',
u'Д':u'Деньги',
u'З':u'Знания',
u'И':u'Интриги'}
DEFAULT_HISTORY = u'Вам не известна история этой карты'
# SPENDABLE_COLOR and PERMANENT_COLOR are used by a format method, so they are without '#'
SPENDABLE_COLOR = 'AAAAAA'
PERMANENT_COLOR = 'DEC666'
COST_QOTIENT = 1.5 # Cost-to-nominal ratio for trading system
# Various utility functions
def deck(deckline):
"""
Given a deck-describing line, return a list of cards.\
Line syntax is like 0С2Д2Д, etc. etc. Number, then suit, repeat for all cards\
'0' means '10' because fuck you, that's why\
"""
if not (type(deckline) == unicode):
raise TypeError('Only unicode line accepted by deck constructor')
d = []
l=list(deckline)
while len(l)>0:
num = int(l.pop(0))
suit = l.pop(0)
d.append(Card(suit, num))
return d