Example #1
0
 def test_read_jeta1_L_cea_constants(self):
     my_species = cl.Species('Jet-A1(L)')
     cea_const = [
         -4.218262130E+05, -5.576600450E+03, 1.522120958E+02,
         -8.610197550E-01, 3.071662234E-03, -4.702789540E-06,
         2.743019833E-09, -3.238369150E+04, -6.781094910E+02
     ]
     self.assertEqual(cea_const, my_species.cea_const)
Example #2
0
 def test_read_jeta1_g_cea_constants(self):
     my_species = cl.Species('Jet-A1(g)')
     cea_const = [
         -6.068695590E+05, 8.328259590E+03, -4.312321270E+01,
         2.572390455E-01, -2.629316040E-04, 1.644988940E-07,
         -4.645335140E-11, -7.606962760E+04, 2.794305937E+02,
         1.858356102E+07, -7.677219890E+04, 1.419826133E+02,
         -7.437524530E-03, 5.856202550E-07, 1.223955647E-11,
         -3.149201922E-15, 4.221989520E+05, -8.986061040E+02
     ]
     self.assertEqual(cea_const, my_species.cea_const)
Example #3
0
 def test_read_H2O_cea_constants(self):
     my_species = cl.Species('H2O')
     cea_const = [
         -3.947960830E+04, 5.755731020E+02, 9.317826530E-01,
         7.222712860E-03, -7.342557370E-06, 4.955043490E-09,
         -1.336933246E-12, -3.303974310E+04, 1.724205775E+01,
         1.034972096E+06, -2.412698562E+03, 4.646110780E+00,
         2.291998307E-03, -6.836830480E-07, 9.426468930E-11,
         -4.822380530E-15, -1.384286509E+04, -7.978148510E+00
     ]
     self.assertEqual(cea_const, my_species.cea_const)
Example #4
0
 def test_read_CO2_cea_constants(self):
     my_species = cl.Species('CO2')
     cea_const = [
         4.943650540E+04, -6.264116010E+02, 5.301725240E+00,
         2.503813816E-03, -2.127308728E-07, -7.689988780E-10,
         2.849677801E-13, -4.528198460E+04, -7.048279440E+00,
         1.176962419E+05, -1.788791477E+03, 8.291523190E+00,
         -9.223156780E-05, 4.863676880E-09, -1.891053312E-12,
         6.330036590E-16, -3.908350590E+04, -2.652669281E+01
     ]
     self.assertEqual(cea_const, my_species.cea_const)
Example #5
0
 def test_read_N2_cea_constants(self):
     my_species = cl.Species('N2')
     cea_const = [
         2.210371497E+04, -3.818461820E+02, 6.082738360E+00,
         -8.530914410E-03, 1.384646189E-05, -9.625793620E-09,
         2.519705809E-12, 7.108460860E+02, -1.076003744E+01,
         5.877124060E+05, -2.239249073E+03, 6.066949220E+00,
         -6.139685500E-04, 1.491806679E-07, -1.923105485E-11,
         1.061954386E-15, 1.283210415E+04, -1.586640027E+01
     ]
     self.assertEqual(cea_const, my_species.cea_const)
Example #6
0
 def test_read_O2_cea_constants(self):
     my_species = cl.Species('O2')
     cea_const = [
         -3.425563420E+04, 4.847000970E+02, 1.119010961E+00,
         4.293889240E-03, -6.836300520E-07, -2.023372700E-09,
         1.039040018E-12, -3.391454870E+03, 1.849699470E+01,
         -1.037939022E+06, 2.344830282E+03, 1.819732036E+00,
         1.267847582E-03, -2.188067988E-07, 2.053719572E-11,
         -8.193467050E-16, -1.689010929E+04, 1.738716506E+01
     ]
     self.assertEqual(cea_const, my_species.cea_const)
Example #7
0
def attemptCatch(pokemon, attempts):
    rawInput = write("Would you like to try to catch this Pokémon? >> ")
    while attempts > 0:

        if 'n' in rawInput:
            time.sleep(1)
            os.system('clear')
            return (0, attempts)

        elif 'y' in rawInput:
            capture_rate = cl.Species(pokemon.id).capture_rate
            roll = random.randint(0, 255)

            if roll < int(capture_rate):
                time.sleep(0.05)
                print("Caught!")
                time.sleep(1)
                #os.system('clear')
                attempts = attempts - 1
                return (1, attempts)
            else:
                time.sleep(0.05)
                print("Missed")
                time.sleep(1)
                attempts = attempts - 1
                rawInput = write("Would you like to try to again? >> ")
    return (0, attempts)


######## Pseduo-code

### Scene outline

# Enter Room

# Observe Room

# 	if observe:
# 		interact
# 		make a note

# 	if not observe:

# Leave Room
Example #8
0
#!/usr/bin/env python3

from __future__ import absolute_import
from __future__ import print_function
import random
import uuid
import data
import classes as cl
import functions as fc

#random.seed(123)

### CLUMSY LOOP TO GENERATE A STARTER POKEMON'S SPECIES WITH THE FOLLOWING:
# NOT A BABY
# NOT AN EVOLVED FORM
# GROWTH RATE 2 (MEDIUM)

while True:
    species = cl.Species(random.randint(1, 807))
    if species.growth_rate_id == '2':
        if species.evolves_from_species_id == '':
            if species.is_baby == '0':
                break

print(species)
print(str(species.height) + " m")
print(str(species.weight) + " kg")
#print(species.base)