Jump to content

Photo

T.I. 'strfry()'?


4 replies to this topic

#1 ramidavis OFFLINE  

ramidavis

    Star Raider

  • 59 posts

Posted Sat Nov 11, 2017 2:03 PM

In C there is the strfry() function which randomizes strings.

"Sautee STRING briskly." - As described in string.h ;)

How would we do this on T.I.?

Given a string x$, randomly swap characters in x$ resulting  in  an anagram of x$.

String 'FFHIMMPQTY' should end up as 'MFIMTFYQHP' or similar.



#2 TheMole OFFLINE  

TheMole

    Dragonstomper

  • 760 posts
  • Location:Belgium

Posted Sat Nov 11, 2017 2:48 PM

Fisher-Yates shuffle!

Same thing I described here (but with chars instead of numbers): http://atariage.com/...tion/?p=3839656

#3 digdugnate OFFLINE  

digdugnate

    Dragonstomper

  • 650 posts
  • Location:SW Missouri

Posted Sat Nov 11, 2017 4:00 PM

i won't lie, this looked like 'TI Stirfry' at first to me and i was intrigued!



#4 TheBF OFFLINE  

TheBF

    Moonsweeper

  • 370 posts
  • Location:The Great White North

Posted Sat Nov 11, 2017 4:02 PM

i won't lie, this looked like 'TI Stirfry' at first to me and i was intrigued!

 

Me too cuz it's getting close to dinner time where I am. :-)



#5 Casey OFFLINE  

Casey

    Chopper Commander

  • 129 posts

Posted Sat Nov 11, 2017 9:00 PM

<delete>


Edited by Casey, Sat Nov 11, 2017 9:05 PM.





0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users