We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Challenge 5 - Count words and lines
#4
Yep, not so simple - remember I said no extensions, but with extensions I would use Regex and this is a great thing to know about.

I would decide first if we are going to:

a) define word characters and everything else is a word deliminator, or
b) define word deliminators and everthing else is a word character

I would go with the first, maybe:

lower and upper case letters (a-zA-Z) and numbers (0-9) and perhaps hypen and underscore.

To do this I would have a subroutine that sets a flag as word or not for any character, and I would probably use ascii character codes for this.

Just a thought - to handle other languages I might go with option b.
[-] The following 1 user Likes litdev's post:
  • AbsoluteBeginner
Reply


Messages In This Thread
Challenge 5 - Count words and lines - by litdev - 09-06-2024, 08:49 AM
RE: Challenge 5 - Count words and lines - by z-s - 09-06-2024, 12:19 PM
RE: Challenge 5 - Count words and lines - by litdev - 09-12-2024, 10:34 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)