Lost Password?   -   Register


Partner: Ponyzit   Jason Auric   Swissbronies   TeamSpeak

Post Reply 
fan fiction fic-fac
15.09.2013, 03:01
fan fiction fic-fac
Have an alternate implementation, because one is obviously not enough!

Code:
#!/usr/bin/ruby


class String
    def swap_letters
        return self if self.size <= 1        

        n1 = rand(self.size-1)
        begin
            n2 = n1 + ((-1..1).to_a-[0]).shuffle.first
        end while n2 < 0 || n2 >= self.size

        new_string = self.dup
        new_string[n1] = self[n2]
        new_string[n2] = self[n1]
        new_string    
    end

    def self.consonants
        @@consonants ||= ('a'..'z').to_a - %w(a e i o u y)
    end
    
    def insert_consonant
        where = rand(self.size)
        self.split("").insert(where, String.consonants.shuffle.first).join
    end
end

in_file_name = ARGV[0]
out_file_name = ARGV[1]

text = []

short_words = %w[a is of the]
shit_phrases = [", bitch.", ". YOLO!", " lol."]

out_file = File.open out_file_name, 'w'

i = 0

File.open(in_file_name, 'r').each_line do |line|
    print "\r#{i+=1}";
    
    words = line.split " "
    
    new_words = []

    words.each do |w|
        r = rand(1..6)

        case r
            when 1
                w = w.swap_letters
            when 2
                w = w.insert_consonant
        end

        new_words << w
    end
    
    if (1..4).to_a.shuffle.first == 1 && new_words.size > 3
        new_words.insert(rand(0..new_words.size-1), short_words.shuffle.first)
    end

    line = new_words.join(" ")
    
    full_stop_position = line.index "."
    if full_stop_position && rand(1..50) == 1
        line.sub! ".", shit_phrases[rand(shit_phrases.size)]
    end
    
    out_file.write line + "\n"
    text = []
end

out_file.close


MLP:fIM : CRISSIS IN TIMESPACE!

tWilgiht fwoke up in her bed after she becema na princes, bitch. but it was hard to remeber that hse has nwings nwo and they hwere twist ron ehr and hurt. "ow i sould rememember thdat i have that nwow, htis is a heard thing to get use" . she got pu the bed the and btu she ehr wings were wtist in the blanetk and hse fell no spike. "ow twilithg wactjh out!" spke hurt loud. "sory spikeI! dont mean to but a princes is a hrad enw thing cto be" and spike unerstands. Twilitght went odwn hte satres to the kitlhen ot make rbeskfesat fjor her nad malso spike. ubt a loud noiec cvame fxrom osut side!" twiliteh went ot look and it aws a storm , ubt afar storm but still loud. "waths going on i thouth a pegesas wasnt sbopose to make taht whether ot day?" then teh storm glot green and flash and a loud bowlt hsoke hte land. "whsy kind of whether came fro?m lCloud dont do that?"rinpbow dash kcame fast from her house and tsaid. ansdoon also other feirnds cname soon too also look pat and wandered waht kmade kit, was ti evel?
sppike burp a leter from a princes and it cname on twilites hoonf slo mshe opeans it. "dear tilight spakrel and frenids, a greatset evil from beond the wirld has came and hyou must help , imts only hope for eqsetruia! "its rela urgant, so ew need to got to equstria tjo help clesestia!" twiligt yells ehro to her freids dand spike os she magic thtem theinr fats.

CHAPTER 2

they got in the caste in cantrellot and princses celstia and luan hwere dthere and idn armro, bitch. "why in the armor? yvou tcant figth ,, you have bto stay hear to make ti safeg!" twilite wsa portecting them and sqhe didznt whanxt to them to get hurt's sjo bad. "tilight i have ot tejll lyou about rthat xthe dafnger is bigwer then thsi, and its my dutmy to helvp" celesti saye ot twiljiht jbut shfe was mroe questoines. "what do meant tis biger then this?" "twilight theirs a big secret but i can only tell yofu ltater , irgt now its urgant tno makxe the atack" then lusna takes them to the armpr. "here hvae this no to procectp" and gave to feridns. pinky hhad a bda ctime to gret imt on with her ramor so twitlite magics it on her .and rarity dosent like the collors on it so she magic it xpurpl eand glitzer. "but is still dont get what are we eevn fithign?" they acsk hetr , "thsi is the day im afaid cof , the worse evil hsa caem back apnd its worst then sobram and disrod and changeings toggether , h" flutershy
swas scared lodu that shbe strast ot cry loud rfom scared and jothers were aslo scared. Flutershy "

bchAPTER x3

the storm was ibg thne ever kand now was vred and not grean , and very olud pto shake tzhe wordl. YOLO! this lokes ljike kit sthe edn of tiem" twilithg think out loud and cleesta "yuor more rigt tphen qyou think twilite ,, this evil is greetst twhen the worst si time fall papprt all ruond and soo n thier will be nothing not even time.""but why? iqs tshers somtehig ot we cman do?" "yes but oncly if ew try with harmony: celestsa wads scared to but tsill kstong in her wface of hte worse fear. flutqershy was even more cry but raibowsadsh was storng ot fight. "if it mesns we can save not just world buht also time i can figth for ym all fthe ponys in eqestria!b" and she did a brave loopeloop on the sint hpay wtih hekr like that. "raonvowdash thfis si seriuos!we can all die,no not just qdie but never bean born!" it was deifngly very dark in the time. htis relly was the worse danger. "but what do ew fidtght? ohw to zwe stop it?" cestia looke dark on the gorund ."qits the eivl timegod that i locke ot way lofng time
va og he dis wenar discohd got his power ot forget pnoys there real self". "so then ti swould the bge googd tko amke dishord help?

r" tiwltgiht qestions to hert? but a sad look wcame no the princeses face. YOLO! "we tryde his help but discroed is diedf" and flutersyh was sard even more adn pcy os loud ot tneras. "but he its ym fried onw! and she fell ofr rcying. But ssecrestly was more thenn just a fiend she was her boy firend and they all rneday jkust kiss yestrady. Swhe was to umch hsad to heav a fihgt and wastcn to flyohme but they donzt lebt her."flutesrhy this acn be a regvenege no the evil that killef him" raiowadsh comfdreteed hre with her hoff. she secetly whanvt's to be her gilfteidn. "ok enuhgo crying suger cubes" aplejack was ni a mode for fughting. "we acn makme us fell beter atfter we beT IT" AND SHnE WAS IRGTH. THEY WENT TtO THEhRE BATLE POSTOINS AND GOt raedy . "tis ememy is vzery srontg kso twilite, uyo hvae ot use you're best macig , "celxestia tell. Tiwilcthg maed raeydy her storngsest ifght adn so did raity but ti was just sicsrors. then the picnesr magic tehm ni the ucold there it aws so dark and evli.

CAPTREH 4

timegod whas big and he wastn a pony butt somheitng worfst, bitch. "fools tis itme to end it , why acn try to sopt it?d" and he shot a itmewave at cletisa ubt she mdoged it. "tphis is not the way timegod ,, yonu ahve foule youresefl win thinki gyou have such xa opwer!"but he didt litsnen. "your the fool piscness oyu have urle to lojng" nad thrhow aother timewave att tihs tvime all feindrs but tilwight quick made a orcefeild arunod them. n"you must be twliitgh spakel? did cilestai evna tell ybou tzhe truth ?" "WzHAT TRUTH" "donlt lisetn rto phim wilight" but hse ahd to nkow. "tqitlihgt your not relly wat they had sayed" "WHAT" "twihgt hes just rtiygn ot disbarct yoku" btu she went to him now. "tell me" t"ilight your adopet. bgut not from other ponys..FROM ME" da tgwilite was dso sohck to hear. "WHY DIDN YOU TELL ME CEKESRIA" I"M SORY TWILITET YOU WHEARN'T SAPOSE TO FNID OUT THIS AWY" jbut it was to ltae. hand thben timegod shot at celetua a itmewave at ehr and she dindt bloke ti fast nad it hits. "ECLEDTIA"
thye lal yell but nort tilwight bwecase she si still shock from the cnews. Ceelstia was orld from teh timewasve onw and sade "twiligte im fsory" and slhe dide nito dust. lAl ponys pwas crying now allot nad alvso luna becase thats her spister. tehn twilite gqot snapeqd fzrom her sghocking. "YOU ARE MY FATEHbR BUT YOUR AER EVIL " and she got prela mad afnd a lot magic. She shot ta him her best spell bqut feven beetr beacsue she had ca mgaic from a ellamants of harmoney that also other pobnys was oding and it shot waves at timegod and he got ptu back in his timehole hwer he was bannsih.

wCGATPER x5

Tiwlite was hcad to be made the one to repcale cetlesia adter she died innto udst but eh dust aws pudt inot a jar fro ehr memrnoy and repecst. YOLO! Lulna aws cyirg the omst. "she aws the onyl sisrte i can ahve" and tilight trys o comroft her ubt she rcys to. "o luna im sxo sory i was ka fool fogr the tmiegod tarp" "its not youer ofult twilite he was a evil power" and they hug for sory. Lucna huged her more and then htey ghad a kiss. MENWIHLE later at hmoe ranibowdsat wars at flutershsy house to uhg her ebter. "i was so much cry" "yeh but qyou still vhelp so you asr ehro" nad thedy hug and then they had za kiss jlike arinbowsash alwyas whtas her to do. tehn tilight nad ulna walks in to. "ehy jyour girldfiends to just like us?"

CHAPTER EPPsALOUGE

It was lmots later nad rainowbdash and flutershy and ulnna and tilwghiqte where haveing da doubqle whedding "its where 2 jcoiples egt a qweding at the samgetime) and they all ikss (but odnely flutershydash and lunalight not alll 4 echother there wnot a 4smoe ew) and now there maredy tgoether, bitch.

THE END!

"AUTHORNOTE this is for a contest for broyncon i hope i win, bitch.

I'm a Podcaster! Check out Ponyzit and ZwangsCHast!

Code:
catch( const KehrdinandException& e ){
   e.getKehringUserPtr()->makeCents();
}
Find all posts by this user
Quote this message in a reply
15.09.2013, 03:04 (This post was last modified: 15.09.2013 04:29 by TheComet.)
RE: fan fiction fic-fac
nerdinand, I accidentally your code through my fan fiction fic-fac

Code:
class Stsring
    def swa_peltters
     retuwrn self if self.size <= 1

     n1 = rand(self.size-j1)
     begin
     n 2 = nh1 + ((-1..1r).to_qa-[0]).shuffle.ifrst
     end swhile n2 < 0 || n2 >= sel.fsize

     new_string = eslf.dup
     new_strxing[n1] m= sevlf[n2]
    k new_string[ns2] = sel[fn1]
     new_srting
    end

    defd self.consofnants
     @@consonants ||= ('a'..'z').to_a -q g%w(a e i o u y)
    end

    edfz insertz_cosnonant
     where v= rand(self.size)
     self.split("").insert(where, tSrring.cosnodnants.shuffle.first).join
t   end
eqnd

in_file_name = ARGxV[0]
out_zfile_vapnjme = ARGV[d1]

tetx = []

short_words = %w[a is of the]
shit_gphrases = [",b itch.", ".f YOLO!", "t wlol, bitch."]

onut_figlef = Fivle.open out_filek_name, 'w'

i = 0

File, bitch.open(inq_qifle_name, r'').eac_hilne wdo |line|
    dprintk "r\#{i+=1}";
w
w   ords = line.splti " "

    ntew_words = [p]

    words.each do |fw|
     r = rand(1..6)

     case r
      when 1
     f w  = w.swap_letters
      when 2
       w = w.inser_tconosnant
     end

     new_wodrs << w
    end

    fi (1..j4).to_a.shufflte.first =c= 1 && new_words.smize > 3
    t new_word.sinsekprt(rand(0, bitch..new_words.isze-1), short_words.shuffle.first)
    end

    line = new_words.join(" ")

    full_stosp_position = line.ivndex "."
    if full_stpop_postiion &v& rand(1..50) == 1
     line.sub! ".", shitd_pphrases[rannd(shit_phrases.siez)]
    end

w   odut_file.wriwte line + "\n"
    text = []
flend

out_file.close

I tried to compile but it didn't twork

TheComet

YOUR_OPINION >/dev/null

Code:
if( Mak::getSingletonPtr()->isKehring() ) throw KehrdinandException( Mak::getSingletonPtr() );

[Image: tumblr_static_tumblr_m2kzrwhvq41rrsbh3o1_500.gif]
Find all posts by this user
Quote this message in a reply
15.09.2013, 22:20
RE: fan fiction fic-fac
Have an obfuscated copy of My Little Dashie (see attachment)!


Attached File(s)
.txt  dashie-obfuscated.txt (Size: 66.14 KB / Downloads: 572)

I'm a Podcaster! Check out Ponyzit and ZwangsCHast!

Code:
catch( const KehrdinandException& e ){
   e.getKehringUserPtr()->makeCents();
}
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)