generating 'infinite' strings

Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2008
Posts: 15
Reputation: rastaberry is an unknown quantity at this point 
Solved Threads: 0
rastaberry rastaberry is offline Offline
Newbie Poster

generating 'infinite' strings

 
0
  #1
Nov 22nd, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 898
Reputation: KevinADC has a spectacular aura about KevinADC has a spectacular aura about 
Solved Threads: 67
KevinADC's Avatar
KevinADC KevinADC is offline Offline
Practically a Posting Shark

Re: generating 'infinite' strings

 
0
  #2
Nov 22nd, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 15
Reputation: rastaberry is an unknown quantity at this point 
Solved Threads: 0
rastaberry rastaberry is offline Offline
Newbie Poster

Re: generating 'infinite' strings

 
0
  #3
Nov 23rd, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 898
Reputation: KevinADC has a spectacular aura about KevinADC has a spectacular aura about 
Solved Threads: 67
KevinADC's Avatar
KevinADC KevinADC is offline Offline
Practically a Posting Shark

Re: generating 'infinite' strings

 
0
  #4
Nov 23rd, 2008
Originally Posted by rastaberry View Post
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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 16,259
Reputation: jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all 
Solved Threads: 540
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: generating 'infinite' strings

 
0
  #5
Nov 23rd, 2008
(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.
Last edited by jbennet; Nov 23rd, 2008 at 2:42 pm.
If i am helpful, please give me reputation points.
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 898
Reputation: KevinADC has a spectacular aura about KevinADC has a spectacular aura about 
Solved Threads: 67
KevinADC's Avatar
KevinADC KevinADC is offline Offline
Practically a Posting Shark

Re: generating 'infinite' strings

 
0
  #6
Nov 23rd, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 15
Reputation: rastaberry is an unknown quantity at this point 
Solved Threads: 0
rastaberry rastaberry is offline Offline
Newbie Poster

Re: generating 'infinite' strings

 
0
  #7
Nov 23rd, 2008
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Perl Forum
Thread Tools Search this Thread



Tag cloud for Perl
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC