This depends on how accurate you want things to be, for example you could describe a silicon diode as having a 0.7V forward drop and a roughly exponential I/V characteristic, but what about reverse voltages? junction capacitance? Temperature effects?
Looking at the Wiki page on diode modelling gives some good info about how you would go about producing a mathematical model of a diode. The source for SPICE would probably be an excellent place to see a working example of this.
Look at the average diode model in SPICE and you will see for a seemingly simple component this can get very involved indeed.
I'm not exactly sure how SPICE works internally, but I would look at nodal and mesh analysis, matrix solvers and suchlike - I found this which seems to give some basic insight into the workings.
EDIT - From further comments it seems you are trying to produce a "learning friendly" circuit simulator (correct me if wrong here)
I think the way to go might be to take the Berkeley SPICE engine (which is based on years of hard work so almost impossible for one person to emulate) and wrap it up in the way you want to, e.g. more instructive help, graphing, etc. Note that this has almost certainly been done somewhere, though it probably won't be free. There are lots of professional tools that took the original Berkeley SPICE (e.g. PSPICE - you may want to take a look at the student evaluation of MultiSim from NI and see if that is close to the type of thing you are thinking of)
As far as the "electronic playground" goes, those type of things have been around for years, and I wouldn't underestimate their usefulness too much - after all a simple transistor circuit or a transformer can take an awful lot of understanding. I think they certainly serve a purpose to spark an interest in things.
I guess the next step up would be breadboards, dev boards and a bit more freedom component wise, then producing PCBs and SMD stuff.