Newbie Python (Game) Programming Question

Tina bad_addy at
Tue Mar 16 21:38:13 CET 2004


I was wondering if there is a way to insert dynamic program code as data.
For some reason I'm thinking Python does this. But I may be confused with
another language or the article itself. I do think I could do this calling
Python thru C, but that seems a bit clunky.

I'm including some of my code to learn stuff as well in case there's a
better way to do things then how I currently am.

The program is a simple RPG character creator. (In this case from the
Stormbringer 4th Ed RPG) In this, each character has a nation they hail
from with attribute modifiers. These mods are listed under each nation as:

d100 to determine nation, nation name, 
[att # to mod, # of dice, die type, final static bonus]

The problem is there's a bunch of "what if's" that are comming up. Not only
for the nation list, but especially the character background list which is
different for most nations and based on different attributes mixed with
rolls. My initial thought is to include this list as a sub-list within the
main nation list.

One "what if" is for Myrrhyn women to have +1d6 CHA. Now I could put this in
the main code but I'm trying to make the basic generator as generic as
possible for re-use.

Any help is appreciated!


stats = ["STR","CON","SIZ","INT","POW","DEX","CHA"]

nation = [
  [5,"Pan Tang",3,1,8,0,4,1,8,0,2,0,0,1],
  [56,"Weeping Waste",0,1,6,0,1,1,6,0,2,0,0,-1,5,1,4,0,6,1,-4,0],
  [67,"Island of Purple Towns",0,1,4,0,1,1,6,0],

More information about the Python-list mailing list