Greetinmgs, I am a programming greenhorn and I would like to make a programm which will generate a number in the way that first the user will say how many digits the number should have (i.e. 10 000) and will also specify the rules for creating the number- i.e. every 0 will change to 001 and every 1 will change to 011.
(this programm will later be good for mathematical purposes to recognize some characteristics in these so-called infinite words).

I am interested in which language do you think it will be easiest to programm,

thanks a lot

Recommended Answers

All 6 Replies

THere is no one size fits all answer. Depends on your overall requirements not just the part you posted. Can perl do what you asked about? I am sure it can. Would it be easy? Not if you don't know any perl.

Okey, I understand, the thing is I know just very little c++ and no perl, but somebody advised me that it will be easier for me to start with perl with no knowledge than in c++ with little knowledge, so that is why I asked.

Okey, I understand, the thing is I know just very little c++ and no perl, but somebody advised me that it will be easier for me to start with perl with no knowledge than in c++ with little knowledge, so that is why I asked.

I think that is true for most people. Perl should be easier to learn even if you already know just a little C++. I suggest you purchase a copy of "Perl BookShelf Reference" on CD. If you're a fast learner give yourself a couple of weeks to a month to grasp the basics:

data types
operators
perls built-in functions

from there you can jump around to accomplish what you need to do.

(this programm will later be good for mathematical purposes to recognize some characteristics in these so-called infinite words).

You cant do maths on strings. You need to convert it to a numerical data type. For example: 1 + 1 = 2 whereas "1" + "1" = an error or maybe even "11".

Also there are space restrictions. Most signed 32 bit ints can only go up to something like 2 billion or so. Also most strings can only hold something like 255 characters.

There is no limit on the number of characters perl can store in a string. Maybe you meant something else.

There is also no numerical data type in perl. There are only scalars and lists of scalars. Scalars can be numbers or strings.

There are also a number of Math modules that come with perl that might be helpful:

http://perldoc.perl.org/index-modules-M.html

regarding the mathematics- it is not going to use arithemtical or any other numerical operations. It will search for example how many times a specific substring is repeated in the sring or look for palindromes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.