Jump to content
  • Advertisement
Sign in to follow this  
DarkSlayer

Permutations

This topic is 5444 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am reading/coding as fast as I can....

I feel stupid ... I'm suppost to make an career out of this ..programming, here you guy's pops this stuff out of your head in .... 2sek ....

pls tell me you are over 50, and have been doing with this in more than 30years, and spendt your last 10 years teaching this stuff on school...

Share this post


Link to post
Share on other sites
Advertisement
can i paste the results of running the program on 'mississippi' here ? it's only 439 KB (450,450 bytes). please ?


rotfl. nope, im only 19 atm and ive been playing around with Python for about a year. learn it! it will change your whole outlook @ programming :>

Share this post


Link to post
Share on other sites
Quote:
Original post by DarkSlayer
I am reading/coding as fast as I can....

I feel stupid ... I'm suppost to make an career out of this ..programming, here you guy's pops this stuff out of your head in .... 2sek ....

pls tell me you are over 50, and have been doing with this in more than 30years, and spendt your last 10 years teaching this stuff on school...


Not me, but my code was buggy when I first posted it...

Edit: It's fixed now...

[Edited by - Nathaniel Hammen on September 21, 2004 9:29:49 PM]

Share this post


Link to post
Share on other sites
There, made the code work... it is in the middle of the night, listning to metallica ... of all, and in 4 hours ... back to school...

OK. Now I need some explanations .. just to clear it up..

Used h3r3tic code as base for now, I'll look into Nathaniel more closely tomorrow, since it looked like something interesting.

The word is first sorted (so that simmilar lettes are put togheter)
Then we create 2 arrays mainly, where we dump the first array into the last except the last letter .. which we keep??

no... I am silly, but the qlue is "which" letter we take out, and which we skip in this mess ...

I have to run this through the debugger tomorrow to see if I can understand it. Give me a day to present a more clean cpp code ... I had to rewrite to make it fit, but the annoying part is that I don't understand what is really going on ... and thats annoys me, because I like to have controll over things.

...but now ... sleep ... zzzzzzzz
thx for excelent help, couldn't do it without you guys
I'll be back....zzzzzzz
aslfjaslfkjslfjsalkj <- head falling on the keyboard...hehe

Share this post


Link to post
Share on other sites
Well, my code works. I cleaned it up and tested it. Although it pauses every once in a while. It has to test whether it is a valid permutation. Essentially what my code does is add, in the base of however many different letters there are.

Edit: If you copied my code before I posted this, I would re-copy it, because your copy might be from before I fixed it.

Edit: My way of doing it is also EXTREMELY slow when you have a lot of different letters. For example, if you typed in the entire alphabet... it would take a long, long time.

[Edited by - Nathaniel Hammen on September 21, 2004 9:14:54 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Nathaniel Hammen
Edit: My way of doing it is also EXTREMELY slow when you have a lot of different letters. For example, if you typed in the entire alphabet... it would take a long, long time.

Heh.
26! is somewhere about 4*1026 , so, i think , anything will take alot of time... say if it can print 108 permutations per second (it certanly can't, i would be surprised if it can print 1000 per second on windows console!)....

Even if it'll print 108 per second, it will take about 100 billions years(alot longer than existence of universe) to show all permutations, if i'm right.[grin]
(edit:had mistake with orders-of-magnitude, fixed.)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!