|
Re: Spaghetti code: msg#00084lang.smalltalk.squeak.beginners
Hey, Ron, Thanks for the feedback. It is a fun question. Welcome to the list. Heh. I've been on this list since it started and on the general list for years, but I guess I don't make much of an impression. ...it may be better to let your son solve the problem on his own and then go back and build something else using some new techniques that you can show him. Sorry if I hadn't made that clear: That's precisely what I am doing. Second there are a lot of possible designs for this problem. The Right. I meant to draw contrast to a traditional state machine where things are fixed, and went to a specific detail. That aside this is a fun question. (Although I really don't like the actual flow chart, killing and kids don't mix well in my mind. I know there are Not to get sidetracked on the issue, but I introduced my son to computers and gaming at the age of...oh...15 months by having him sit on my lap and fire the weapons in Doom 2. I can't really explain in brief the extent of the positive changes this wrought. He's had an abiding love of games--including "violent" games--ever since. (I put "violent" in quotes for a lot of reasons that are also not on topic.<s>) Completely coincidentally, he's by far the most compassionate persion I've ever met. I've never met anyone so completely devoid of cruelty and so quick to help others in distress. (Of course, results not typical, your mileage may vary. I filter out plenty of other things I think are bad for him; it's just that his list is different from other kids'.) By the way, in case it's not obvious, this is a flow chart for the pen-and-paper RPG "Dungeons and Dragons", and is meant as a jokey simplification of that game. System: Enter Property Name: Ah. Yes. This is "Animals", in essence. That's an excellent segue to a larger project! http://www.animalgame.com/play/faq.php Notice there is no branching code any more. To follow a flow you start from the root tree. Yes, that's what I was going for. Your design is deeper than mine, though. Thanks. Ok so why did we build thingys? Well because things can now answer I'm not sure what that--doesn't the game go away at that point?<s> (Like KILL! Ugh). lol All things that live, kill. Or, minimally, all organisms compete for resources that other organisms could use to survive. So to summarize my suggestion: you use a tree construct to represent Good. That's the ball-park I was in. (It is not really a linked list) You build objects that represent properties that have questions and Yeah, I hesitated to use the term "linked list" but it's (non-technically) a list of linked items. I suppose, technically, it's an n-tree. Thanks again! ===Blake===
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Spaghetti code, Ron Teitelbaum |
|---|---|
| Next by Date: | Re: Spaghetti code, Herbert König |
| Previous by Thread: | RE: Spaghetti code, Ron Teitelbaum |
| Next by Thread: | RE: Spaghetti code, Ron Teitelbaum |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |