Sounds like a children’s tv show. The Add module was the next requested NeatTools feature, and here it is, more or less. I still need to pretty it up. For instance, if you type too much in a box it extends beyond the boundaries of the box. Also Flash’s text boxes take strings, not numbers, so in my code, number are being turned back and forth from strings, something I think that’s causing the strange behavior if your number get’s too big. But that aside, it’s working. The two integer modules on the left feed into the add module and the output is displayed in the third integer module. The output is dynamically updated when the numbers in the first two boxes change.
This update also marks my first use of actual NeatTools source code. The formula used to draw the plus sign on the add module was taken directly from JAddObj.cpp.
Note: I’ve just disovered a small bug. If you click before the number and hit delete, it will erase the text style, and revert to black, so you won’t see it on a black background. Instead, click after the number and use backspace to change it.
Back when dinosaurs still roamed the earth, I had a high school science class that nowadays might be called “Chemistry for Morons”. Properly, it
was called ISCS (intermediate science curriculum study). Anyhow, it was a self-paced, year-long course. The workbook featured a cartoon helper called Iggy, who offered helpful hints.
Your opening comment made me flash on that. Besides, I’m still pissed that when I finished the whole course in March, they refused to let me build my own laser (death ray).
If you ever write a comprehensive, workbook-style curriculum based on NeatTools, perhaps “Iman Says!” could provide interesting insights in sidebars.
More seriously…
Eventually I would expect to see +,-,*, and / operational modules. Now, + and * should be able to accept n-inputs and produce a result. However, – and / should only accept (and require) two inputs. Then there’s the divide by zero issue…
What would be nice down the road is a generic arithmetic module that could be configured for at least the four functions mentioned. However, that might cause an input crisis.
Multiplication module shouldn’t be tough, like you said. Subtraction and Division won’t be tough either, but I first need to figure out top and bottom inputs and outputs respectively, which will require a lot of work with drawing the connections themselves. Before I do that, I want to reconcile the mess that is the drawConnection and the reDrawConnection methods as i mentioned in a previous post.