Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 random letters
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
beedub




PostPosted: Sat May 31, 2003 10:20 pm   Post subject: random letters

if i were to create something that just made random letters how would i do that. I can do it with ints just not letters.
Sponsor
Sponsor
Sponsor
sponsor
Martin




PostPosted: Sat May 31, 2003 10:27 pm   Post subject: (No subject)

Well, first of all each letter has its own character code, accessed by the ord command. Here's how you'd make random letters appear


code:
loop
  if Rand.Int(0,1) = 1 then
    put chr(Rand.Int(ord('a'), ord ('z')))
  else
    put chr(Rand.Int(ord('A'), ord('Z')))
  end if
end loop
beedub




PostPosted: Sat May 31, 2003 10:34 pm   Post subject: (No subject)

then how would i incorporate ints or other chars into that?
beedub




PostPosted: Sat May 31, 2003 11:23 pm   Post subject: (No subject)

also after it is done every possible pattern of lettering... i want it to stop... how do i do that?
Tony




PostPosted: Sat May 31, 2003 11:48 pm   Post subject: (No subject)

you generate a random integer, take it as ASCII value and print character based on that
code:

put chr(integer)


what Darkness did here is he use ord to calculate ASCII values between a and z

I don't understand what you mean with letter patterns
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Blade




PostPosted: Sun Jun 01, 2003 12:21 am   Post subject: (No subject)

if you mean just get 26 letters... which would be every letter in the alphabet... just run a for loop for 26 instead of a conditional loop... but elaborate more on the question
beedub




PostPosted: Sun Jun 01, 2003 8:57 am   Post subject: (No subject)

i meant that... when there is every possible pattern of letters and numbers done it just stops. heres an example lets say you want to find a combo for a lock. you start off with 1-1-1. then you go with maybe 1-2-1, then maybe 1-3-1 and so on until you get every possible one of those. But then you dont find the combo. then ur screwed and in this case the program stops.
Blade




PostPosted: Sun Jun 01, 2003 12:08 pm   Post subject: (No subject)

well you still havent really answered the question... you want every possible combonation... with how many letters&numbers? you say a lock. well in this case theres only 3 numbers to a combonation... how many do you want for htis one?
Dan




PostPosted: Sun Jun 01, 2003 1:31 pm   Post subject: (No subject)

i am the only one that sees somting going on here?

1st he asks if there is a way to link a progme to the net and then he ask about making a progame out put every comabo for a set of chars and nums.

he is trying to make a hacking progamer Twisted Evil , lol

not that i care if any one helps you make it or not i just thougth that it was funny that no one cahogt on to that yet. Laughing
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
beedub




PostPosted: Sun Jun 01, 2003 2:45 pm   Post subject: (No subject)

yes i am... lol
beedub




PostPosted: Sun Jun 01, 2003 3:17 pm   Post subject: (No subject)

i need it to go past 6 letters... i assume that no1 ever goes past like maybe 12 letters
beedub




PostPosted: Sun Jun 01, 2003 3:19 pm   Post subject: (No subject)

it also just needs to be used symbols like numbers quotations and letters (doesnt mater whether it is caps)...
Andy




PostPosted: Sun Jun 01, 2003 3:38 pm   Post subject: (No subject)

umm, you do realize that there are exactly 227,390,317,427,037,786,292,224 possible combinations of passwords for hotmail:7-15 characters
36^7+36^8+36^9+36^10+36^11+36^12+36^13+36^14+36^15

o and for your question, you could have a string with all the characters in it and just randomly select one out of there

code:

characters:="abcdefghijklmnopqrstuvwxyz10234567890"
put characters(Rand.Int(1,36))
PaddyLong




PostPosted: Sun Jun 01, 2003 7:36 pm   Post subject: (No subject)

hehe I actually wrote a program that was to create a dictionary file of all the combinations of the characters in a set string and of set lengths... I tried running it once for I think like alphanumeric characters and combinations 1-5 characters long... lol o my did that file get large quick and the program take for ever to run Razz
Prince




PostPosted: Mon Jun 02, 2003 10:04 am   Post subject: (No subject)

holy shit thats alotta combinations Shocked
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 15 Posts ]
Jump to:   


Style:  
Search: