Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Trade Market Game

# Matthew Morgan - Trade Market Game
# List Long texts

startText = "You decided to take a trip to the local trading festival, an event"

Trabajo Práctico Python - Análisis Numérico

# Numero de registro: 876167
# Nombre y Apellido: Pamela Porjolovsky

# Primero habilito el paquete, importandolo

import cmath

# Este programa me va a permitir calcular las raices de cualquier polinomio cuadrado, sean reales o complejas

# Luego establezco los coeficientes del polinomio

a=2
b=-8
c=16

print "Coeficientes del polinomio:","a=",a,"b=",b,"c=",c
    
discRoot = cmath.sqrt(b * b - 4 * a * c) #Calculo la raiz cuadrada de la formula resolvente. Le asigno una denominacion, para facilitar el calculo de las raices

#Prosigo con el calculo de las raices del polinomio

root1 = (-b + discRoot) / (2 * a) 
root2 = (-b - discRoot) / (2 * a) 

#Imprimo la solucion

print"Sus raices son:", root1, root2

#Ejemplos

print "Ejemplo 1:"

a1=1
b1=0
c1=4

print "Coeficientes del polinomio:","a1=",a1,"b1=",b1,"c1=",c1
    
discRoot = cmath.sqrt(b1 * b1 - 4 * a1 * c1)
root1 = (-b1 + discRoot) / (2 * a1)
root2 = (-b1 - discRoot) / (2 * a1)

print"Sus raices son:", root1, root2

print "Ejemplo 2:"

a2=1
b2=0
c2=-4

print "Coeficientes del polinomio:","a2=",a2,"b2=",b2,"c2=",c2
    
discRoot = cmath.sqrt(b2 * b2 - 4 * a2 * c2)
root1 = (-b2 + discRoot) / (2 * a2)
root2 = (-b2 - discRoot) / (2 * a2)

print"Sus raices son:", root1, root2

print "Ejemplo 3:"

a3=1
b3=6
c3=9

print "Coeficientes del polinomio:","a3=",a3,"b3=",b3,"c3=",c3

discRoot = cmath.sqrt(b3 * b3 - 4 * a3 * c3)
root1 = (-b3 + discRoot) / (2 * a3)
root2 = (-b3 - discRoot) / (2 * a3)


print"Sus raices son:", root1, root2

Execute Python Online

print ("HellO!");
nom_1 = float ("Enter first num:")
nom_2 = float ("Enter second num:")
re = float (nom_1) + (nom_2)
print ("resultat", re);

Execute Python Online

# Hello World program in Python
d1={'name':'shru'}
d2={'city':'hyd'}
d3={'name':'shri'}
print(d1)

Execute Python Online

import io
from pdfminer.converter import TextConverter
from pdfminer.pdfinterp import PDFPageInterpreter
from pdfminer.pdfinterp import PDFResourceManager
from pdfminer.pdfpage import PDFPage
def extract_text_from_pdf(pdf_path):
    resource_manager = PDFResourceManager()
    fake_file_handle = io.StringIO()
    converter = TextConverter(resource_manager, fake_file_handle)
    page_interpreter = PDFPageInterpreter(resource_manager, converter)
    with open('C:\Users\Janet\1.pdf', 'rb') as fh:
        for page in PDFPage.get_pages(fh, 
                                      caching=True,
                                      check_extractable=True):
            page_interpreter.process_page(page)
        text = fake_file_handle.getvalue()
    # close open handles
    converter.close()
    fake_file_handle.close()
    if text:
        return text
if __name__ == '__main__':
    print(extract_text_from_pdf('1.pdf'))

Execute Python Online

a = input("Enter Your Name:")
b = input("Enter Your Date Of Birth:")
c = input("Gender:")
d = float(input("Monthly Salary:"))
print("Employee Details")\n
print("Employee Name:",a)
print("Employee DOB:",b)
print("Gender:",c)
print("Monthly Salaty:",d)


    

Execute Python Online

import numpy as np

def brusselator (A, B) :
    def f(z) :
        return np.array([A+(z[0]**2)*z[1]-(B+1)*z[0], B*z[0]-(z[0]**2)*z[1]])
    return f



def StepEuler (f, zt, h) :
    return zt+h*f(zt)
    
def approximation (z0, P, T) :
    list = [z0]
    for i in range(P) :
        list.append(StepEuler(f, list[i], T/P))
    return list

print("Hello")

#z0_ch = input()
#z0 = int(z0_ch)
#T_ch = input()
#T = int(T_ch)
#P_ch = input()
#P = int(P_ch)
#A_ch = 
#list = [z0]
#for i in range(P) :
#    list.append(StepEuler(f, list[i], h))
    

Execute Python Online

# Hello World program in Python
import unittest

def versionChecker(version1, version2):
    error = "An error occurred:"
    returnValue = 0
    try:
        parts1 = version1.split(".")
        parts2 = version2.split(".")
       
    except:
        print(error + " unable to compare " + version1 + " and " + version2)
    #******************Part added by me********************
    lenPart1 = len(parts1)
    lenPart2 = len(parts2)
    if(lenPart1!=lenPart2):
        if(lenPart1>lenPart2):
            for i in range(lenPart1 - lenPart2):
                parts2.append("0")
        else:
            for i in range(lenPart2 - lenPart1):
                parts1.append("0")
    #*******************************************************        
    for i in range(len(parts1)):
     
        if int(parts1[i]) < int(parts2[i]):
            returnValue = -1
            break
        elif int(parts1[i]) > int(parts2[i]):
            returnValue = 1
            break

    return returnValue
class TestVersionChecker(unittest.TestCase):

    def test_single_number(self):
        self.assertEqual(versionChecker("5", "5.0"), 0)

    def test_less_than(self):
        self.assertEqual(versionChecker("4.0", "5.0"), -1)

    def test_greater_than(self):
        self.assertEqual(versionChecker("2.0", "1.0"), 1)
        
    def test_greater_than(self):
        self.assertEqual(versionChecker("4.0.0.0", "4"), 0)
        
    def test_greater_than(self):
        self.assertEqual(versionChecker("2.0.1", "2.0"), 1)
        
    def test_greater_than(self):
        self.assertEqual(versionChecker("5.0", "5.0.1"), -1)
    
    def test_greater_than(self):
        self.assertEqual(versionChecker("5.0", "5.1"), -1)
        
    def test_greater_than(self):
        self.assertEqual(versionChecker("5.1", "5.0"), 1)

if __name__ == '__main__':
    unittest.main()

Execute Python Online

#BMICalculator
def BMICalculator(i, p):
    m = i * .0254
    kg = p * .454
    BMI = kg / (m ** 2)
    if BMI < 18:
        print ('severely underweight')
    elif 18 < BMI < 20:
        print ('underweight')
    elif 20 < BMI < 25:
        print ('healthy')
    elif 25 < BMI < 30:
        print ('overweight')
    else:
        print ('obese')
    print (BMI)
    
BMICalculator(70, 240)

def SlopeCalculator(m, x, b):
    y = m * x + b
    print (x, y)
    
SlopeCalculator(2, 3, -7)

def PythagoreanCalculator(a, b):
    c = sqrt((a ** 2) + (b ** 2))
    print (c)
    
PythagoreanCalculator(3, 4)

Execute Python Online

from random import randint
def d6():
    return randint(1,6)
def d22():
    return randint (1,2)
def d3():
    return randint (1,3)
def d66():
    return randint (1,36)
    
def plagen():
    print "UWP: ",
    star = d6() + d6()
    if star <= 2:
        print "X",
    if star >= 3 and star <= 4:
        print "E",
    if star >= 5 and star <= 6:
        print "D",
    if star >= 7 and star <= 8:
        print "C",
    if star >= 9 and star <= 10:
        print "B",
    if star >= 11:
        print "A",
    size = d6() + d6() -2
    if size <= 9:
        print size,
    if size == 10:
        print "A",
    atmos = d6() + d6() -7 + size
    if atmos <= 0:
        print "0",
    if atmos >= 1 and atmos <= 9:
        print atmos,
    if atmos == 10:
        print "A",
    if atmos == 11:
        print "B",
    if atmos == 12:
        print "C",
    if atmos == 13:
        print "D",
    if atmos == 14:
        print "E",
    if atmos == 15:
        print "F",
    global temp1
    temp1 = 0
    if atmos >= 2 and atmos <= 3:
        temp1 = -2
    if atmos == 4 or atmos == 5 or atmos == 14:
        temp1 = -1
    if atmos >= 8 and atmos <= 9:
        temp1 = 1
    if atmos == 10 or atmos == 13 or atmos == 15:
        temp1 = 2
    if atmos >= 11 and atmos <= 12:
        temp1 = 6
    temp =  d6() + d6() + temp1
    global hydro1
    hydro1 = 0
    if atmos == 0 or atmos == 1 or atmos == 10 or atmos == 11 or atmos == 12:
        hydro1 = -4
    if atmos > 13 or atmos < 13:
        if temp <= 10 and temp <= 11:
            hydro1 = hydro1 - 2
        if temp >= 12:
            hydro1 = hydro1 - 6
    hydro = d6() + d6() -7 + size + hydro1
    if hydro <= 0:
        print "0",
    if hydro >= 1 and hydro <= 9:
        print hydro,
    if hydro == 10:
        print "A",
    pop = d6() + d6() - 2
    if pop <= 9:
        print pop,
    if pop == 10:
        print "A",
    gov = d6() + d6() -7 + pop
    if pop <= 0:
        gov = 0
    if gov <= 0:
        print 0,
    if gov >=1 and gov <= 9:
        print gov,
    if gov == 10:
        print "A",
    if gov == 11:
        print "B",
    if gov == 12:
        print "C",
    if gov >= 13:
        print "D",
    law = d6() + d6() -7 + gov
    if pop <= 0:
        law = 0
    if law <= 0:
        print "0",
    if law >=1 and law <= 9:
        print law,
    if law >= 10:
        print "9",
    print "-",
    global tech1
    tech1 = 0
    if star >= 2:
        tech1 = -4
    if star >= 7 and star <= 8:
        tech1 = 2
    if star >= 9 and star <= 10:
        tech1 = 4
    if star >= 11:
        tech1 = 6
    if size <= 1:
        tech1 = tech1 + 2
    if size >= 2 and size <= 4:
        tech1 = tech1 + 1
    if atmos <= 3 or atmos >= 10:
        tech1 = tech1 + 1
    if hydro == 1 or hydro == 9:
        tech1 = tech1 + 1
    if hydro == 10:
        tech1 = tech1 + 2
    if pop >= 1 and pop <= 5:
        tech1 = tech1 + 1
    if pop == 9:
        tech1 = tech1 + 1
    if pop == 10:
        tech1 == tech1 + 2
    if gov == 1 or gov == 5:
        tech1 = tech1 + 1
    if gov == 7:
        tech1 == tech1 + 2
    if gov == 13 or gov == 14:
        tech1 = tech1 - 2
    tech = d6() + tech1
    if pop == 0:
        tech = 0
    if tech <= 0:
        print "0",
    if tech >= 1 and tech <= 9:
        print tech,
    if tech == 10:
        print "A",
    if tech == 11:
        print "B",
    if tech == 12:
        print "C",
    if tech == 13:
        print "D",
    if tech == 14:
        print "E",
    if tech == 15:
        print "F",
    if tech == 16:
        print "G",
    if tech == 17:
        print "H",
    if tech == 18:
        print "I",
    if tech == 19:
        print "J",
    if tech == 20:
        print "K",
    if tech == 21:
        print "L",
    print "",
    print "",
    basen = d6() + d6()
    bases = d6() + d6()
    baser = d6() + d6()
    baset = d6() + d6()
    basei = d6() + d6()
    basep = d6() + d6()
    if star >= 3 and star <= 4:
        if basep >= 12:
            print "P",
        else:
            print "-",
    if star >= 5 and star <= 6:
        if bases >= 7:
            print "S",
        if basep >= 12:
            print "P",
        else:
            print "-",
    if star >= 7 and star <= 8:
        if bases >= 8:
            print "S",
        if baser >= 10:
            print "R",
        if baset >= 10:
            print "T",
        if basei >= 10:
            print "I",
        if basep >= 10:
            print "P",
        else:
            print "-",
    if star >= 9 and star <= 10:
        if basen >= 8:
            print "N",
        if bases >= 8:
            print "S",
        if baser >= 10:
            print "R",
        if baset >= 6:
            print "T",
        if basei >= 8:
            print "I",
        if basep >= 12:
            print "P",
        else:
            print "-",
    if star >= 11:
        if basen >= 8:
            print "N",
        if bases >= 10:
            print "S",
        if baser >= 8:
            print "R",
        if baset >= 4:
            print "T",
        if basei >= 6:
            print "I",
        else:
            print "-",
    print "",
    print "",
    if atmos >= 4 and atmos <= 9:
        if hydro >= 4 and hydro <= 8:
            if pop >= 5 and pop <= 7:
                print "Ag",
    if size <=0 and atmos <= 0 and hydro <= 0:
        print "As",
    if pop <= 0 and gov <=0 and law <= 0:
        print "Ba",
    if atmos >= 2 and hydro <= 0:
        print "De",
    if atmos >= 10 and hydro >= 1:
        print "Fl",
    if size >= 5:
        if atmos >= 5 and atmos <=9:
            if hydro >= 4 and hydro <= 8:
                print "Ga",
    if pop >= 9:
        print "Hi",
    if tech >= 12:
        print "Ht",
    if atmos <= 1 and hydro >= 1:
         print "Ic",
    if atmos >= 2 or atmos == 4 or atmos == 7 or atmos == 9:
        if pop >= 9:
            print "In",
    if pop >= 1 and pop <= 3:
        print "Lo",
    if tech < 5:
        print "Lt",
    if atmos  <= 3 and hydro <= 3 and pop >= 6:
        print "Na",
    if pop >= 4 and pop <= 6:
        print "Ni",
    if atmos >= 2 and atmos <= 5:
        if hydro <= 3:
            print "Po",
    if atmos == 6 or atmos == 8:
        if pop >= 6 and pop <= 8:
            print "Ri",
    if atmos <= 0:
        print "Va",
    if hydro >= 10:
        print "Wa",
    print "",
    print "",
    if atmos >= 10 or gov == 0 or gov == 7 or gov == 10 or law == 0 or gov >= 9:
        print "A"
    else:
        print "G"
    print ""
    print "Starport:",
    if star <= 2:
        print "No Starport",
        print "(",
        print "Berting Cost:",
        print "0,",
        print "Fuel:",
        print "None",
        print ")"
    if star >= 3 and star <= 4:
        print "Frontier",
        print "(",
        print "Berting Cost:",
        print "0,",
        print "Fuel:",
        print "None",
        print ")"
    if star >= 5 and star <= 6:
        print "Poor",
        print "(",
        print "Berting Cost:",
        print str(d6()*10) + ",",
        print "Fuel:",
        print "Unrefined",
        print ")"
    if star >= 7 and star <= 8:
        print "Routine",
        print "(",
        print "Berting Cost:",
        print str(d6()*100) + ",",
        print "Fuel:",
        print "Unrefined",
        print ")"
    if star >= 9 and star <= 10:
        print "Good",
        print "(",
        print "Berting Cost:",
        print str(d6()*500) + ",",
        print "Fuel:",
        print "Refined",
        print ")"
    if star >= 11:
        print "Excellent",
        print "(",
        print "Berting Cost:",
        print str(d6()*1000) + ",",
        print "Fuel:",
        print "Refined",
        print ")"
    
    print "Size:",
    if size == 0:
        print "800 km",
        print "(",
        print "Surface Gravity (gs):",
        print "Negligible - Low",
        print ")"
    if size == 1:
        print "1,600 km",
        print "(",
        print "Surface Gravity (gs):",
        print "0.05 - Low",
        print ")"
    if size == 2:
        print "3,200 km",
        print "(",
        print "Surface Gravity (gs):",
        print "0.15 - Low",
        print ")"
    if size == 3:
        print "4,800 km",
        print "(",
        print "Surface Gravity (gs):",
        print "0.25 - Low",
        print ")"
    if size == 4:
        print "6,400 km",
        print "(",
        print "Surface Gravity (gs):",
        print "0.35 - Low",
        print ")"
    if size == 5:
        print "8,000 km",
        print "(",
        print "Surface Gravity (gs):",
        print "0.45 - Low",
        print ")"
    if size == 6:
        print "9,600 km",
        print "(",
        print "Surface Gravity (gs):",
        print "0.7 - Low",
        print ")"
    if size == 7:
        print "11,200 km",
        print "(",
        print "Surface Gravity (gs):",
        print "0.9",
        print ")"
    if size == 8:
        print "12,800 km",
        print "(",
        print "Surface Gravity (gs):",
        print "1.0",
        print ")"
    if size == 9:
        print "14,400 km",
        print "(",
        print "Surface Gravity (gs):",
        print "1.25 - High",
        print ")"
    if size == 10:
        print "16,000 km",
        print "(",
        print "Surface Gravity (gs):",
        print "1.4 - High",
        print ")"

    print "Atmosphere:",
    if atmos == 0:
        print "None",
        print "(",
        print "Pressure:",
        print "0.00,",
        print "Survival Gear Required:",
        print "Vacc Suit",
        print ")"
    if atmos == 1:
        print "Trace",
        print "(",
        print "Pressure:",
        print "0.001 to 0.009,",
        print "Survival Gear Required:",
        print "Vacc Suit",
        print ")"
    if atmos == 2:
        print "Very Thin, Tainted",
        print "(",
        print "Pressure:",
        print "0.1 to 0.42,",
        print "Survival Gear Required:",
        print "Respirator, Filter",
        print ")"
    if atmos == 3:
        print "Very Thin",
        print "(",
        print "Pressure:",
        print "0.1 to 0.42,",
        print "Survival Gear Required:",
        print "Respirator",
        print ")"
    if atmos == 4:
        print "Thin, Tainted",
        print "(",
        print "Pressure:",
        print "0.43 to 0.7,",
        print "Survival Gear Required:",
        print "Filter",
        print ")"
    if atmos == 5:
        print "Thin",
        print "(",
        print "Pressure:",
        print "0.43 to 0.7,",
        print "Survival Gear Required:",
        print "-",
        print ")"
    if atmos == 6:
        print "Standard",
        print "(",
        print "Pressure:",
        print "0.71 - 1.49,",
        print "Survival Gear Required:",
        print "-",
        print ")"
    if atmos == 7:
        print "Standard, Tainted",
        print "(",
        print "Pressure:",
        print "0.71 - 1.49,",
        print "Survival Gear Required:",
        print "Filter",
        print ")"
    if atmos == 8:
        print "Dense",
        print "(",
        print "Pressure:",
        print "1.5 to 2.49,",
        print "Survival Gear Required:",
        print "-",
        print ")"
    if atmos == 9:
        print "Dense, Tainted",
        print "(",
        print "Pressure:",
        print "1.5 to 2.49,",
        print "Survival Gear Required:",
        print "Filter",
        print ")"
    if atmos == 10:
        print "Exotic",
        print "(",
        print "Pressure:",
        print "Varies,",
        print "Survival Gear Required:",
        print "Air Supply",
        print ")"
    if atmos == 11:
        print "Corrosive",
        print "(",
        print "Pressure:",
        print "Varies,",
        print "Survival Gear Required:",
        print "Vacc Suit",
        print ")"
    if atmos == 12:
        print "Insidious",
        print "(",
        print "Pressure:",
        print "Varies,",
        print "Survival Gear Required:",
        print "Vacc Suit",
        print ")"
    if atmos == 13:
        print "Dense, High",
        print "(",
        print "Pressure:",
        print "2.5+,",
        print "Survival Gear Required:",
        print "Varies",
        print ")"
    if atmos == 14:
        print "Thin, Low",
        print "(",
        print "Pressure:",
        print "0.5 or less,",
        print "Survival Gear Required:",
        print "Varies",
        print ")"
    if atmos == 15:
        print "Unusual",
        print "(",
        print "Pressure:",
        print "Varies,",
        print "Survival Gear Required:",
        print "Varies",
        print ")"
        
    print "Temperature:",
    if temp <= 2:
        print "Frozen",
        print "(",
        print "Average Temperature:",
        print "-51 Celcius or less",
        print ")"
    if temp>= 3 and temp <= 4:
        print "Cold",
        print "(",
        print "Average Temperature:",
        print "-51 Celcius to 0 Celcius",
        print ")"
    if temp>= 5 and temp <= 9:
        print "Temperate",
        print "(",
        print "Average Temperature:",
        print "0 Celcius to 30 Celcius",
        print ")"
    if temp>= 10 and temp <= 11:
        print "Hot",
        print "(",
        print "Average Temperature:",
        print "31 Celcius to 80 Celcius",
        print ")"
    if temp>= 12:
        print "Roasting",
        print "(",
        print "Average Temperature:",
        print "81+ Celcius",
        print ")"
    
    print "Hydrographic Percentage:",
    if hydro <= 0:
        print "0%-to 5%"
    if hydro == 1:
        print "6% to 15%"
    if hydro == 2:
        print "16% to 25%"
    if hydro == 3:
        print "26% to 35%"
    if hydro == 4:
        print "36% to 45%"
    if hydro == 5:
        print "46% to 55%"
    if hydro == 6:
        print "56% to 65%"
    if hydro == 7:
        print "66% to 75%"
    if hydro == 8:
        print "76% to 85%"
    if hydro == 9:
        print " 86% to 95%"
    if hydro >= 10:
        print "96% to 100%"
    print ""
    print "Population Range:",
    if pop <= 0:
        print "None",
        print "(",
        print "Range:",
        print "0",
        print ")"
    if pop == 1:
        print "Few",
        print "(",
        print "Range:",
        print "1+",
        print ")"
    if pop == 2:
        print "Hundreds",
        print "(",
        print "Range:",
        print "100+",
        print ")"
    if pop == 3:
        print "Thousands",
        print "(",
        print "Range:",
        print "1,000+",
        print ")"
    if pop == 4:
        print "Tens of Thousands",
        print "(",
        print "Range:",
        print "10,000+",
        print ")"
    if pop == 5:
        print "Hundreds of Thousands",
        print "(",
        print "Range:",
        print "100,000+",
        print ")"
    if pop == 6:
        print "Millions",
        print "(",
        print "Range:",
        print "1,000,000+",
        print ")"
    if pop == 7:
        print "Tens of Millions",
        print "(",
        print "Range:",
        print "10,000,000+",
        print ")"
    if pop == 8:
        print "Hundreds of Millions",
        print "(",
        print "Range:",
        print "100,000,000+",
        print ")"
    if pop == 9:
        print "Billions",
        print "(",
        print "Range:",
        print "1,000,000,000+",
        print ")"
    if pop >= 10:
        print "Tens of Billions",
        print "(",
        print "Range:",
        print "10,000,000,000+",
        print ")"
    print "Culture:",
    d1 = d66()
    global d2
    d2 = d66()
    if d1 == d2:
        d2= d66()
    if d1 == 1 or d2 == 1:
        print "Sexist - one gender is considered subservient or inferior to the other.",
    if d1 == 2 or d2 == 2:
        print "Religious - culture is heavily influenced by a religion or belief system, possibly one unique to this world.",
    if d1 == 3 or d2 == 3:
        print "Artistic - art and culture are highly prized. Aesthetic design is important in all artefacts produced onworld.",
    if d1 == 4 or d2 == 4:
        print "Ritualised - social interaction and trade is highly formalised. Politeness and adherence to traditional forms is considered very important.",
    if d1 == 5 or d2 == 5:
        print "Conservative - the culture resists change and outside influences.",
    if d1 == 6 or d2 == 6:
        print "Xenophobic - the culture distrusts outsiders and alien influences. Offworlders will face considerable prejudice.",
    if d1 == 7 or d2 == 7:
        print "Taboo - a particular topic is forbidden and cannot be discussed. Characters who unwittingly mention this topic will be ostracised.",
    if d1 == 8 or d2 == 8:
        print "Deceptive - trickery and equivocation are considered acceptable. Honesty is a sign of weakness.",
    if d1 == 9 or d2 == 9:
        print "Liberal - the culture welcomes change and offworld influence. Characters who bring new and strange ideas will be welcomed.",
    if d1 == 10 or d2 == 10:
        print "Honourable - ones word is ones bond in the culture. Lying is both rare and despised.",
    if d1 == 11 or d2 == 11:
        print "Influenced - the culture is heavily influenced by another, neighbouring world. If you have the details for the neighbouring world, choose a cultural quirk that this world has adopted. If not, roll for one",
    if d1 == 12 or d2 == 12:
        print "Fusion - the culture is a merger of two distinct cultures. Roll again twice to determine the quirks inherited from these cultures. If the quirks are incompatible then the culture is likely divided.",
    if d1 == 13 or d2 == 13:
        print "Barbaric - physical strength and combat prowess are highly valued in the culture. Characters may be challenged to a fight, or dismissed if they seem incapable of defending themselves. Sports tend towards the bloody and violent. ",
    if d1 == 14 or d2 == 14:
        print "Remnant - the culture is a surviving remnant of a once great and vibrant civilisation, clinging to its former glory. The worldis filled with crumbling ruins, and every story revolves around the good old days.",
    if d1 == 15 or d2 == 15:
        print "Degenerate - the culture is falling apart and is on the brink of war or economic collapse. Violent protests are common and the social order is decaying. ",
    if d1 == 16 or d2 == 16:
        print "Progressive - the culture is expanding and vibrant. Fortunes are being made in trade; science is forging bravely ahead.",
    if d1 == 17 or d2 == 17:
        print "Recovering - a recent trauma, such as a plague, war, disaster or despotic regime has left scars on the culture.",
    if d1 == 18 or d2 == 18:
        print "Nexus - members of many different cultures and species visit here.",
    if d1 == 19 or d2 == 19:
        print "Tourist Attraction - some aspect of the culture or the planet draws visitors from all over charted space. ",
    if d1 == 20 or d2 == 20:
        print "Violent - physical conflict is common, taking the form of duels, brawls or other contests. Trial by combat is a part of their judicial system.",
    if d1 == 21 or d2 == 21:
        print "Peaceful - physical conflict is almost unheard of. The culture produces few soldiers and diplomacy reigns supreme. Forceful characters will be ostracised. ",
    if d1 == 22 or d2 == 22:
        print "Obsessed - everyone is obsessed with or addicted to a substance, personality, act or item. This monomania pervades every aspect of the culture. ",
    if d1 == 23 or d2 == 23:
        print "Fashion - fine clothing and decoration are considered vitally important in the culture. Underdressed characters have no standing here.",
    if d1 == 24 or d2 == 24:
        print "At war - the culture is at war, either with another planet or polity, or is troubled by terrorists or rebels.",
    if d1 == 25 or d2 == 25:
        print "Unusual Custom: Offworlders - space travellers hold a unique position in the cultures mythology or beliefs, and travellers will be expected to live up to these myths.",
    if d1 == 26 or d2 == 26:
        print "Unusual Custom: Starport - the planets starport is more than a commercial centre; it might be a religious temple, or be seen as highly controversial and surrounded by protestors. ",
    if d1 == 27 or d2 == 27:
        print "Unusual Custom: Media - news agencies and telecommunications channels are especially strange here. Getting accurate information may be difficult.",
    if d1 == 28 or d2 == 28:
        print "Unusual Customs: Technology - the culture interacts with technology in an unusual way. Telecommunications might be banned, robots might have civil rights, cyborgs might be property.",
    if d1 == 29 or d2 == 29:
        print "Unusual Customs: Lifecycle - there might be a mandatory age of termination, o anagathics might be widely used. Family units might be different, with children being raised by the state or banned in favour of cloning.",
    if d1 == 30 or d2 == 30:
        print "Unusual Customs: Social Standings - the culture has a distinct caste system. Characters of a low social standing who do not behave appropriately will face punishment.",
    if d1 == 31 or d2 == 31:
        print "Unusual Customs: Trade - the culture has an odd attitude towards some aspect of commerce, which may interfere with trade at the spaceport. For example, merchants might expect a gift as part of a deal, or some goods may only be handled by certain families.",
    if d1 == 32 or d2 == 32:
        print "Unusual Customs: Nobility - those of high social standing have a strange custom associated with them; perhaps nobles are blinded, or must live in gilded cages, or only serve for asingle year before being exiled. ",
    if d1 == 33 or d2 == 33:
        print "Unusual Customs: Sex - the culture has an unusual attitude towards intercourse and reproduction. Perhaps cloning is used instead, or sex is used to seal commercial deals.",
    if d1 == 34 or d2 == 34:
        print "Unusual Customs: Eating - food and drink occupie an unusual place in the culture. Perhaps eating is a private affair, or banquets and formal dinners are seen as the highest form of politeness. ",
    if d1 == 35 or d2 == 35:
        print "Unusual Customs: Travel - travellers may be distrusted or feted, or perhaps the culture frowns on those who leave their homes. ",
    if d1 == 36 or d2 == 36:
        print "Unusual Custom: Conspiracy - something strange is going on. The government is being subverted by another group or agency. ",
    print ""
    
    print "Government:",
    if gov <= 0:
        print "None",
        print "(",
        print "Description:",
        print "No government structure. In many cases, family bonds predominate,",
        print "Common Contraband:",
        print "None",
        print ")"
    if gov == 1:
        print "Company/Corporation",
        print "(",
        print "Description:",
        print "Ruling functions are assumed by a company managerial elite, and most citizenry are company employees or dependants,",
        print "Common Contraband:",
        print "Weapons, Drugs, Travellers",
        print ")"
    if gov == 2:
        print "Participating Democracy",
        print "(",
        print "Description:",
        print "Ruling functions are reached by the advice andconsent of the citizenry directly,",
        print "Common Contraband:",
        print "Drugs",
        print ")"
    if gov == 3:
        print "Self-Perpetuating Oligarchy",
        print "(",
        print "Description:",
        print "Ruling functions are performed by a restricted minority, with little or no input from the mass of citizenry,",
        print "Common Contraband:",
        print "Technology, Weapons, Travellers",
        print ")"
    if gov == 4:
        print "Representative Democracy",
        print "(",
        print "Description:",
        print "Ruling functions are performed by elected representatives,",
        print "Common Contraband:",
        print "Drugs, Weapons, Psionics",
        print ")"
    if gov == 5:
        print "Feudal Technocracy",
        print "(",
        print "Description:",
        print "Ruling functions are performed by specific individuals for persons who agree to be ruled by them. Relationships are based on the performance of technical activities which are mutually beneficial,",
        print "Common Contraband:",
        print "Technology, Weapons, Computers",
        print ")"
    if gov == 6:
        print "Captive Government",
        print "(",
        print "Description:",
        print "Ruling functions are performed by an imposedl eadership answerable to an outside group,",
        print "Common Contraband:",
        print "Weapons, Technology, Travellers",
        print ")"
    if gov == 7:
        print "Balkanisation",
        print "(",
        print "Description:",
        print "No central authority exists; rival governments complete for control. Law level refers to the government nearest the starport,",
        print "Common Contraband:",
        print "Varies",
        print ")"
    if gov == 8:
        print "Civil Service Bureaucracy",
        print "(",
        print "Description:",
        print "Ruling functions are performed by government agencies employing individuals selected for their expertise,",
        print "Common Contraband:",
        print "Drugs, Weapons",
        print ")"
    if gov == 9:
        print "Impersonal Bureaucracy",
        print "(",
        print "Description:",
        print "Ruling functions are performed by agencies which have become insulated from the governed citizens,",
        print "Common Contraband:",
        print "Technology, Weapons, Drugs, Travellers, Psionics",
        print ")"
    if gov == 10:
        print "Charismatic Dictator",
        print "(",
        print "Description:",
        print "Ruling functions are performed by agencies directed by a single leader who enjoys the overwhelming confidence of the citizens,",
        print "Common Contraband:",
        print "None",
        print ")"
    if gov == 11:
        print "Non-Charismatic Leader",
        print "(",
        print "Description:",
        print "A previous charismatic dictator has been replaced by a leader through normal channels,",
        print "Common Contraband:",
        print "Weapons, Technology, Computers",
        print ")"
    if gov == 12:
        print "Charismatic Oligarchy",
        print "(",
        print "Description:",
        print "Ruling functions are performed by a select group of members of an organisation or class which enjoys the overwhelming confidence of the citizenry,",
        print "Common Contraband:",
        print "Weapons",
        print ")"
    if gov >= 13:
        print "Religious dictatorship",
        print "(",
        print "Description:",
        print "Ruling functions are performed by a religious organisation without regard to the specific individual needs of the citizenry,",
        print "Common Contraband:",
        print "Varies",
        print ")"
    print "Banned/Illegal Possessions:"
    def wep():
        print "Weapons:",
        if law <= 0 and law < 1:
            print "None"
        if law > 0 and  law >= 1:
            print "Poison gas, explosives, undetectable weapons, WMD,",
        if law > 0 and  law >= 2:
            print "Portable energy weapons (except ship-mounted weapons),",
        if law > 0 and  law >= 3:
            print "Heavy weapons",
        if law > 0 and  law >= 4:
            print "Light assault weapons and submachine guns,",
        if law > 0 and  law >= 5:
            print "Personal concealable weapons,",
        if law > 0 and  law >= 6:
            print "All firearms except shotguns and stunners;carrying weapons discouraged,",
        if law > 0 and  law >= 7:
            print "Shotguns,",
        if law > 0 and  law >= 8:
            print "All bladed weapons, stunners,",
        if law > 0 and  law >= 9:
            print "Any weapons,",
        print "|",
        print ""
    def drug():
        print "Drugs:",
        if law <= 0 and law < 1:
            print "None",
        if law > 0 and law >= 1:
            print "Highly addictive and dangerous narcotics,",
        if law > 0 and  law >= 2:
            print "Highly addictive narcotics,",
        if law > 0 and  law >= 3:
            print "Combat drugs,",
        if law > 0 and  law >= 4:
            print "Addictive narcotics,",
        if law > 0 and  law >= 5:
            print "Anagathics,",
        if law > 0 and  law >= 6:
            print "Fast and Slow drugs,",
        if law > 0 and  law >= 7:
            print "All narcotics,",
        if law > 0 and  law >= 8:
            print "Medicinal drugs,",
        if law >= 9:
            print "All drugs,",
        print "|",
        print ""
    def info():
        print "Information:",
        if law <= 0 and law < 1:
            print "None",
        if law > 0 and  law >= 1:
            print "Intellect programs,",
        if law > 0 and  law >= 2:
            print "Agent programs,",
        if law > 0 and  law >= 3:
            print "Intrusion programs,",
        if law > 0 and  law >= 4:
            print "Security programs,",
        if law > 0 and  law >= 5:
            print "Expert programs,",
        if law > 0 and  law >= 6:
            print "Recent news from offworld,",
        if law > 0 and  law >= 7:
            print "Library programs, unfiltered data about otherworlds. Free speech curtailed,",
        if law > 0 and  law >= 8:
            print "Information technology, any non-critical data from offworld, personal media,",
        if law > 0 and  law >= 9:
            print "Any data from offworld. No free press,",
        print "|",
        print ""
    def tek():
        print "Technology:",
        if law <= 0 and law < 1:
            print "None",
        if law > 0 and  law >= 1:
            print "Dangerous technologies such as nanotechnology,",
        if law > 0 and  law >= 2:
            print "Alien technology,",
        if law > 0 and  law >= 3:
            print "TL 15 items,",
        if law > 0 and  law >= 4:
            print "TL 13 items,",
        if law > 0 and  law >= 5:
            print "TL 11 items,",
        if law > 0 and  law >= 6:
            print "TL 9 items,",
        if law > 0 and  law >= 7:
            print "TL 7 items,",
        if law > 0 and  law >= 8:
            print "TL 5 items,",
        if law >= 9:
            print "TL 3 items,",
        print "|",
        print ""
    def trav():
        print "Travellers:",
        if law <= 0 and law < 1:
            print "None",
        if law > 0 and  law >= 1:
            print "Visitors must contact planetary authorities by radio, landing is permitted anywhere,",
        if law > 0 and  law >= 2:
            print "Visitors must report passenger manifest, landing is permitted anywhere,",
        if law > 0 and  law >= 3:
            print "Landing only at starport or other authorised sites,",
        if law > 0 and  law >= 4:
            print "Landing only at starport,",
        if law > 0 and  law >= 5:
            print "Citizens must register offworld travel, visitors must register all business,",
        if law > 0 and  law >= 6:
            print "Visits discouraged; excessive contact with citizens forbidden,",
        if law > 0 and  law >= 7:
            print "Citizens may not leave planet; visitors may not leave starport,",
        if law > 0 and  law >= 8:
            print "Landing permitted only to imperial agents,",
        if law > 0 and  law >= 9:
            print "No offworlders permitted,",
        print "|",
        print ""
    def psi():
        print "Psionics:",
        if law <= 0 and law < 1:
            print "None",
        if law > 0 and  law >= 1:
            print "Dangerous talents must be registered,",
        if law > 0 and  law >= 2:
            print "All psionic powers must be registered; use of dangerous powers forbidden,",
        if law > 0 and  law >= 3:
            print "Use of telepathy restricted to government-approved telepaths,",
        if law > 0 and  law >= 4:
            print "Use of teleportation and clairvoyance restricted,",
        if law > 0 and  law >= 5:
            print "Use of all psionic powers restricted to government psionicists,",
        if law > 0 and  law >= 6:
            print "Possession of psionic drugs banned,",
        if law > 0 and  law >= 7:
            print "Use of psionics forbidden,",
        if law > 0 and  law >= 8:
            print "Psionic-related technology banned,",
        if law > 0 and  law >= 9:
            print "All psionics",
        print "|",
        print ""
    if gov <= 0:
        print "None"
    if gov == 1:
        wep()
        drug()
        trav()
    if gov == 2:
        drug()
    if gov == 3:
        tek()
        wep()
        trav()
    if gov == 4:
        drug()
        wep()
        psi()
    if gov == 5:
        tek()
        wep()
        info()
    if gov == 6:
        wep()
        tek()
        trav()
    if gov == 7:    
        if d22() == 1:
            wep()
        if d22() == 1:
            drug()
        if d22() == 1:
            info()
        if d22() == 1:
            tek()
        if  d22() == 1:
            trav()
        if d22() == 1:
            psi()
    if gov == 8:
        drug()
        wep()
    if gov == 9:
        tek()
        wep()
        drug()
        trav()
        psi()
    if gov == 10:
        print "None"
    if gov == 11:
        wep()
        tek()
        info()
    if gov == 12:
        wep()
    if gov >= 13:
        if d22() == 1:
            wep()
        if d22() == 1:
            drug()
        if d22() == 1:
            info()
        if d22() == 1:
            tek()
        if d22() == 1:
            trav()
        if d22() == 1:
            psi()
    print ""
    print ""
    print "Factions:"
    global f1
    f1 = 0
    if gov == 0 or gov == 7:
        f1 = 1
    if gov >= 10:
        f1 = -1
    f = d3() + f1 + 1
    x = 0
    for i in range(1,f):
        gov = d6() + d6() -7 + pop
        print "Faction" + str(x+i),
        print "|",
        print "Faction Strength:",
        facstr = d6() + d6 ()
        if facstr <= 3:
            print "Obscure group - few have heard of them, no popular support",
        if facstr >= 4 and facstr <= 5 :
            print "Fringe group - few supporters",
        if facstr >= 6 and facstr <= 7 :
            print "Minor group - some supporters",
        if facstr >= 8 and facstr <= 9 :
            print "Notable group - significant support, well known",
        if facstr >= x and facstr <= x :
            print "Significant - nearly as powerful as the government",
        if facstr >= 12:
            print "Overwhelming popular support - more powerful than the government",
        print "|",
        print " Faction Governemnt:",
        if gov <= 0:
            print "None",
            print "(",
            print "Description:",
            print "No government structure. In many cases, family bonds predominate,",
            print "Common Contraband:",
            print "None",
            print ")"
        if gov == 1:
            print "Company/Corporation",
            print "(",
            print "Description:",
            print "Ruling functions are assumed by a company managerial elite, and most citizenry are company employees or dependants,",
            print "Common Contraband:",
            print "Weapons, Drugs, Travellers",
            print ")"
        if gov == 2:
            print "Participating Democracy",
            print "(",
            print "Description:",
            print "Ruling functions are reached by the advice andconsent of the citizenry directly,",
            print "Common Contraband:",
            print "Drugs",
            print ")"
        if gov == 3:
            print "Self-Perpetuating Oligarchy",
            print "(",
            print "Description:",
            print "Ruling functions are performed by a restricted minority, with little or no input from the mass of citizenry,",
            print "Common Contraband:",
            print "Technology, Weapons, Travellers",
            print ")"
        if gov == 4:
            print "Representative Democracy",
            print "(",
            print "Description:",
            print "Ruling functions are performed by elected representatives,",
            print "Common Contraband:",
            print "Drugs, Weapons, Psionics",
            print ")"
        if gov == 5:
            print "Feudal Technocracy",
            print "(",
            print "Description:",
            print "Ruling functions are performed by specific individuals for persons who agree to be ruled by them. Relationships are based on the performance of technical activities which are mutually beneficial,",
            print "Common Contraband:",
            print "Technology, Weapons, Computers",
            print ")"
        if gov == 6:
            print "Captive Government",
            print "(",
            print "Description:",
            print "Ruling functions are performed by an imposedl eadership answerable to an outside group,",
            print "Common Contraband:",
            print "Weapons, Technology, Travellers",
            print ")"
        if gov == 7:
            print "Balkanisation",
            print "(",
            print "Description:",
            print "No central authority exists; rival governments complete for control. Law level refers to the government nearest the starport,",
            print "Common Contraband:",
            print "Varies",
            print ")"
        if gov == 8:
            print "Civil Service Bureaucracy",
            print "(",
            print "Description:",
            print "Ruling functions are performed by government agencies employing individuals selected for their expertise,",
            print "Common Contraband:",
            print "Drugs, Weapons",
            print ")"
        if gov == 9:
            print "Impersonal Bureaucracy",
            print "(",
            print "Description:",
            print "Ruling functions are performed by agencies which have become insulated from the governed citizens,",
            print "Common Contraband:",
            print "Technology, Weapons, Drugs, Travellers, Psionics",
            print ")"
        if gov == 10:
            print "Charismatic Dictator",
            print "(",
            print "Description:",
            print "Ruling functions are performed by agencies directed by a single leader who enjoys the overwhelming confidence of the citizens,",
            print "Common Contraband:",
            print "None",
            print ")"
        if gov == 11:
            print "Non-Charismatic Leader",
            print "(",
            print "Description:",
            print "A previous charismatic dictator has been replaced by a leader through normal channels,",
            print "Common Contraband:",
            print "Weapons, Technology, Computers",
            print ")"
        if gov == 12:
            print "Charismatic Oligarchy",
            print "(",
            print "Description:",
            print "Ruling functions are performed by a select group of members of an organisation or class which enjoys the overwhelming confidence of the citizenry,",
            print "Common Contraband:",
            print "Weapons",
            print ")"
        if gov >= 13:
            print "Religious dictatorship",
            print "(",
            print "Description:",
            print "Ruling functions are performed by a religious organisation without regard to the specific individual needs of the citizenry,",
            print "Common Contraband:",
            print "Varies",
            print ")"
    
        
        
        
        
        
        
        
        
        
        
        
        
        
plagen()

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.