I played wit it for a little while and came up with these obvious shortcuts:
[php]# changed playerInitialList to pL to save on typing
# changed pL1 etc. to pL[1] etc.
# What do you do if initials of the two players match?
import random
def continents(): #<--- Visual Display of the 3 continents
"""
list pL contains the inital letters of the players
the index coincides with the number of the country
"""
print " __ ____"
print " N.A. | \ / ."
print " \__| \ 2 | ____"
print " ____________ |" + pL[2] + " / __ Eu / | |"
print " / | 1 | \ \| /13\ ___/ | |"
print "/ 0 |__" + pL[1] + "__|_/ |\ ." + pL[13] + "_// 14 / |"
print "| " + pL[0] + " | 3 | 4|__|5\ / " + pL[14] + " / |"
print " \/ \|__" + pL[3] + "_|_" + pL[4] + "__|_" + pL[5] + "_\ __ |_/|_/| 19 /"
print " / | 6 | 7 / /15\ __/ | " + pL[19] + " /"
print " |__" + pL[6] + "__|_" + pL[7] + "_/ ." + pL[15] + "_/ | 16 | /"
print " \ 8 | / _" + pL[16] + " | |"
print " \ " + pL[8] + " \ /\ / \/\ |"
print " \ \ /17|18/ ||"
print " _\_ |" + pL[17] + "_/ ." + pL[18] + " \|"
print " S.A._/ 9 \__"
print " /___" + pL[9] + "____|"
print " | | /"
print " \ 10|11/"
print " |" + pL[10] + " |" + pL[11] + "/"
print " |__|/"
print " |12/"
print " |" + pL[12] + "/"
print " |/"
def countryDivider(countryNum):
while True:
if not availableCountries: # check if list is spent/empty
break
q = random.choice(availableCountries) # pick one available country
firstTurnsCountries.append(q) # add it to first list
availableCountries.remove(q) # remove it from the available list
q = random.choice(availableCountries) # repeat for second list
secondTurnsCountries.append(q)
availableCountries.remove(q)
firstTurnsCountries.sort()
secondTurnsCountries.sort()
# create playerInitialList (pL) of 20 spaces
pL = [" "] * 20
availableCountries = range(20) # <--- Used at games start, player's countries taken from here
firstTurnsCountries = [] # <--- Player one's country possesion
secondTurnsCountries = [] # <--- Player two's country possesion
player1 = raw_input("What is player 1's Name?")
player2 = raw_input("What is player 2's Name?")
countryDivider(len(availableCountries))
print "\n" + player1 + ", you have been given the following countries:",firstTurnsCountries
print player2 + ", you have been given the following countries:",secondTurnsCountries
for x in range(20):
if x in firstTurnsCountries:
pL[x] = player1[0]
elif x in secondTurnsCountries:
pL[x] = player2[0]
continents()
[/php]