Oldschool style. Even I can do this -- although it's rather embarrassing to note that working out all the (very boneheaded) bugs made the whole thing take about an hour and fifteen minutes to crank out.

Good thing I'm not paid to do this!

This was implemented (tested and working, finally!) in M$ QuickBASIC PDS 7.1. You can still download it! (I tested it using an XP box.)

Strictly speaking, there's a little fluff -- lines 10, 20, 30, 140, and 150 could all technically be eliminated w/o problem. But I think the added weight is worth it and yes, I know, LINE NUMBERS FOR PETE'S SAKE.

I suspect part of the point was to think about the interaction of functions.
ie, multiple of 15=found in both the "fizz" and the "buzz" cases.
If you think it through, you can just make the two cases handle that, but if you don't, you must use a third case.

I'm not so good with object oriented stuff. Tried to learn C++ three times. Twice in college, once from a Dummies book (which was actually before college). Didn't learn a thing. I can sort of read the stuff, but that's about it.

College professor both times could only explain the difference between Java and whatever he was trying to teach. Never took Java. Don't care to -- doesn't interest me.

So, Prof, I guess you weren't too helpful to me. Oh well.

Dummies book didn't work so well, either -- typed up a program with the included software, compiler wouldn't budge. Checked the code against the book... exact match. Decided both book and software were junk. I still have the book somewhere... dunno why...

Back to BASIC. Simple, procedural code. Does what it needs to. No, I never knew that much. Yes, I'm rusty with what I do know. But I know it better than any of that newfangled object oriented stuff for sure.

It's good enough for me.

I even wrote a game in BASIC. Search this section of the forum -- IIRC I did post it at some point (if not, or if the link's dead, tell me and I'll put it [back] up). It's called QUICKGEM. You'll need DOSbox if you don't have real DOS... I didn't say BASIC was a new language, did I?

Someday I'll mess around with QB64, which is crossplatform, and rewrite QUICKGEM for it. Or not. QUICKGEM was a real mess. No parser, just discrete IF...THEN statements. Yeah, I know -- very very bad. If someone can show me a simple-to-type REAL parser for BASIC, I'll rewrite the game for it. Haven't had that happen yet, though.

Before someone brings up Visual BASIC... I've used it. VB5 or 6, courtesy of MS, in college. Not bad... but... memorable for a big minus: the editor suggested commands and such because there were too many commands for one programmer to remember. Too fancy all around, particularly for me.

"...the more they overtech the plumbing, the easier it is to stop up the drain." Montgomery Scott, Star Trek III: The Search For Spock_________________

and then strip and upx the binary, you will get an executable (with GTK gui) of some 18-25k. With QB64, you get ridiculous binaries in the 1 MB range, which I find generally unacceptable, in spite of the cross-platform feature. BaCon compiles on any *nix (including OSX), and people have also succeded in getting it running in Windows using Cygwin.

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum