Chat on IRC |
Suicidal Name Calling
Posted by eternaldisciple [send private reply] at September 07, 2001, 08:23:02 PM
Anyone wanna help me on the logic or whatever of a program that forms every letter combination in a 5 letter name? And then maybe a 6 letter name with the first letter being from A to E? If not, I understand. It makes me sick to try. But ya. Thanx in advance.
Posted by CHollman82 [send private reply] at October 01, 2001, 10:21:02 PM
Posted by Psion [send private reply] at September 08, 2001, 02:29:43 PM
You can also do it generally with a recursive function!
Posted by CHollman82 [send private reply] at October 01, 2001, 10:21:11 PM
Posted by eternaldisciple [send private reply] at September 08, 2001, 07:21:17 PM
Thanx, it was faster, for me at least, to do in java because I wanted to output to file. The whole first name file was 464 megs. I run out of far memory trying to open the damn thing. But thanx for your help.
Posted by gian [send private reply] at September 08, 2001, 07:37:04 PM
Heeehehehe.... has annyone else read that Isaac Asimov (or it could be arthur c. clarke... I don't remember) story, the 9 billion names of god? All these monks are like using a computer to print out every possible name with up to 7 letters, and pasting them into their holy books. Then they get every comination, and the universe ends... it's pretty cool. Just reminded me of this.
Posted by eternaldisciple [send private reply] at September 08, 2001, 07:47:56 PM
Ya, well you know, the universe is tied directly to my motherboard, I hardwired it right there in place of the cmos battery.
Posted by gian [send private reply] at September 08, 2001, 08:04:39 PM
Really, well I managed to fit a blackhole into one of my PCI Slots, but unfortunately, there's a 33mhz bottleneck on the throughtput :-(
Posted by Cobbs [send private reply] at September 08, 2001, 10:28:27 PM
eternaldisciple: for the letter printing you could use the ascii number equivalents of the letters for an easier approach, kinda like... (this is probably faster, less comparing is required)
psuedo-logic code: start the loop at the ascii equivalent of a and have it go up to the equivalent of z, they are consecutive (no way...) so lets say you have a char hold the number 100 (pretend that's the ascii equivalent of b), then you go... printf("%c", the_char_that_holds_the_number); and then you... ++the_char_that_holds_the_number; It works because as far as i know, you can increment a char. ...and I don't actually use those kinda names for variables... :p
Posted by eternaldisciple [send private reply] at September 08, 2001, 10:42:58 PM
ya, well, I liked java's easy type-conversion. I just used the for loops and the ascii value, then converted it to char.
for(letter1=65; letter1<66; letter1++) { for(letter2=65; letter2<91; letter2++) { for(letter3=65; letter3<91; letter3++) { for(letter4=65; letter4<91; letter4++) { for(letter5=65; letter5<91; letter5++) { for(letter6=65; letter6<91; letter6++) { out.write( (char)letter1 ); out.write( (char)letter2 ); out.write( (char)letter3 ); out.write( (char)letter4 ); out.write( (char)letter5 ); out.write( (char)letter6 ); out.write( ' ' ); namecount++; } } } } } } out.write( "Count", 0, 5); out.newLine(); out.write( namecount ); But that's me.
Posted by CHollman82 [send private reply] at October 01, 2001, 10:21:21 PM
Posted by taubz [send private reply] at September 09, 2001, 10:12:34 AM
And is anyone surprised that you wasted your time and our bandwidth?
Posted by Psion [send private reply] at September 09, 2001, 05:18:46 PM
eternal, that is a silly way to do it. You should have done for (char letter1 = 'A'; letter1 <= 'D'; ++letter1) /* more stuff lala */ out.write(letter1) /* hoho */, and saved some typing.
Posted by have_dinner [send private reply] at September 12, 2001, 09:12:02 AM
i think they're playing a competition to see who can fit the most pointless amount of code into 1 post
Register as a new user | ||||||||||||||||