Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
random letters
Author Message
beedub

Posted: 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.

Martin

Posted: 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

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

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

Posted: 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

Posted: 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
Tony's programming blog. DWITE - a programming contest.

Posted: 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

Posted: 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.

Posted: 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

Posted: 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 , 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.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
beedub

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

yes i am... lol
beedub

Posted: 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

Posted: 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

Posted: 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))

Posted: 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
Prince

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

holy shit thats alotta combinations
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 15 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: