Lost Password?   -   Register


Partner: Ponyzit   Jason Auric   Swissbronies   TeamSpeak

Post Reply 
fan fiction fic-fac
15.09.2013, 02:50 (This post was last modified: 15.09.2013 04:28 by TheComet.)
fan fiction fic-fac
I accidentally the fan fiction even more.

Code:
// fan fic fic fac

// include files
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <random>

class FicFac
{
public:

    static const std::string consonants;

    FicFac( const std::string& inFile, const std::string& outFile ) :
        whenToSwap(1,20),
        distribution_0_18(1,19),
        shitDistribution(0,1),
        whenToInsertShit(0,20000)
    {
        m_InFile.open( inFile );
        m_OutFile.open( outFile.c_str() );
        m_RandomShit.push_back( std::string(" a red and black alicorn princess ") );
        m_RandomShit.push_back( std::string(" PHP scripts  ") );
    }
    ~FicFac( void )
    {
        m_InFile.close();
        m_OutFile.close();
    }

    void ficFac()
    {
        this->swap();
    }

    void swap()
    {
        std::string inBuf("");
        while( !m_InFile.eof() )
        {
            std::getline( m_InFile, inBuf );

            // swaps consonants
            for( size_t i = 1; i < inBuf.size(); ++i )
            {
                unsigned char rnd = whenToSwap( rndGenerator );
                if( rnd == 1 )
                {
                    if( consonants.find(inBuf[i]) != std::string::npos || consonants.find(inBuf[i-1]) != std::string::npos )
                    {
                        char temp = inBuf[i];
                        inBuf[i] = inBuf[i-1];
                        inBuf[i-1] = temp;
                    }
                }
            }

            // inserts random consonants
            for( size_t i = 0; i < inBuf.size(); ++i )
            {
                unsigned char rnd = whenToSwap( rndGenerator );
                if( rnd == 1 )
                {
                    std::string temp;
                    temp.push_back(  consonants.at(distribution_0_18( rndGenerator )) );
                    inBuf.insert( i, temp );
                }
            }

            // inserts random shit
            for( size_t i = 0; i < inBuf.size(); ++i )
            {
                size_t rnd = whenToInsertShit( rndGenerator );
                if( rnd == 1 )
                {
                    size_t shit = shitDistribution( rndGenerator );
                    std::string shitString( m_RandomShit[shit] );
                    inBuf.insert( i, shitString );
                    i+=m_RandomShit[shit].size();
                }

                // find full stop
                rnd = whenToSwap( rndGenerator );
                if( inBuf[i] == '.' )
                {
                    if( rnd == 1 )
                        inBuf.insert( i, ", bitch" );
                }
            }
            m_OutFile << inBuf << std::endl;
        }
        m_OutFile << std::endl;
    }

private:

    std::ifstream m_InFile;
    std::ofstream m_OutFile;
    std::default_random_engine rndGenerator;
    std::uniform_int_distribution<unsigned char> whenToSwap;
    std::uniform_int_distribution<unsigned char> distribution_0_18;
    std::uniform_int_distribution<size_t> whenToInsertShit;
    std::uniform_int_distribution<size_t> shitDistribution;
    std::vector<std::string> m_RandomShit;

};

const std::string FicFac::consonants = "bcdfghjklmnpqrstvwxz";

int main( int argc, char** argv )
{

    const char* inFileName = argv[1];
    const char* outFileName = argv[2];

    FicFac ff( inFileName, outFileName );
    ff.ficFac();

    return 0;
}

MLPs:fIM : CRISSIS IN TIMESPACE!

tWiljight woke up in her bed aftegr sheb ecemka a prinzces. buzt it was hard to remeber that she ahs wingsn now and they where twsti on her and hurt. v"ow i soul drememembzer tqhat i have thjat now, this is a heard thing to get use" . she got u pthxe bed apn dbut she he rwings ewre twist in theb lanetk and she fellr on pskied. "o wtwilithg wacth out!" spke uhrt loud. "sory spikhe!zI dont mean to but ap rinceqs is a hard new thing tvo be" and splike hunerstagnds. Twilithgt went down tthe staesr tqo thqe kithetn to maekb reskfesatm for her and also xspiek.s but a loud no PHP scripts iec came frpom out side!" twiliteh wpnet ot look andz it wvapsj a storm ,d but afars torm but stildl hloud. z"waths going jon i thgouth ap egesas waksnt sopose to make that whethzer to day?" then the storm got green and flash and a olud boflt shoke the land.r "wyhs kidn of whether came fromk? Cloud dont do thta?"rinbow dagsh came fast from her houfse and saitdw. andoson also otherf eirnds came soownt oo also look at andt wandreedj
what made it, was it evel? sjpicke burp a leter from vap rinces nad it came on twilnites ghofof sov she opeans it. k"deart ilight spakerl and freinds,w a greatels tevil from beond thpe wirld has camne and kyoum ust help , its only hope for ejqestruia!l "its ffreal urgant, so we nedeq qot got to equstria to helpw clesestia!" twviwligwt yells hhero to hejr freids and spike so she magicth em theirf fast, bitch.

CHAPTEjR 2

htey got int he caste in cantrelllot and princes cewltstia and ulan wheret here and in armor. "why in thne arwmor?z gyou cant figth ,, youh ave to stay hear to lmake it safe!" twilitje wasp ortecitng htetm and she didnnt whaznt to them to get hurt's so badh. "tiilght i have to tell you abou tthatt he wdanger is lbigenr then txhiss, and its my dtuy to hhel"p celesti saye to dtwiliht but she was more questoine.s "whwat o kdmeant its biger then thtis?j" "xtwilighnt theirs a big secret but i can only tell you lhater , irgt now its urgant to make the aatck" then lvuna takes them to the azrmpr. "here haev this on top rocect" and gave to freidns. pinkyj had ta adb time to get it on withh er armor so twilitwe magics i pton her .and rarity dosent litke tvhe collors on it so she magic iqq ptxurpl eand gdlite.grl "but is stilkql donstq get whatj arez wwe eve nfithing?" thneym ask ehr , "thifs is the day im afaid of , the wrgohse evil vhas came back and tis wors tthen sorbamr adn zdisrod awnd cahntgeingsv toggether , "
flutreshy rwas scare dloud tahts he stratsr to cyr loud from scarperd and tohers were cazlso scaerd. Flutershy "

chAPTER 3

the storm was big then ever and now was red andn ot grean , and very lodu to shpake thne wordl. thjis loqkes like it sthe end of itme" tiwlithg think pout olu dand mcelestav "your omre rigt the nyou think tsiwlite ,, this wevil is gretest then thre worst ist ime hfall papprwt tall round dpacnd soo nt heirw ilvl be nothing not even tsime.""but why? is thers somteshig to we can do?" "yes but only if we tyr with harmonry: cpelestsa wa zsscaredd to but stills togn in her face of lthew orse efla.r fluterhsy wsas even more cry ubt raibowadssh was strong to figh.t "if intp messng we cfna asve not just wrold bu talsfo time i cna figth ofrml y all the pony sin eqestria!" and shelc did a brajve loopeloop on the isrnt hapy with her like cthat. m"raonvowadsh this zi sserwiuso!we can allj dief,no not junts die but nneverb eanq born!" itw as defingly very dark in the itme. this relyl aqws the worsed anger, bitch. "but whawt do wef itght? how to we stpo it?" cestial ooke daqrkt on hkte gorund ."its the etivl timgejod thast
i locke to way long time a go heq pis wear disdcohd got his gpowerc to forget ponys tehre real slef." "so thfen itl sould be good to maek dishord help?

" twlitgihtl qestions sto her? but a asd look came on the princexses face, bitch. "we tryed mhis help but discroed is died" and flutresyh was sad veen more adnn cy so loud ot tears. "ubt he is my fried now! and she fellh for rcyign. Buts ecrestly was more then just af iend she was her boy firend and they all reday juts ikss ysetrady. She was to much sadt to harev a fihgt andz wastn to flyhome but they dont lfext hevr."lfutershy tihsck an bez a regvenege on thle eqvil that killfe him" rgaiowdash comferteed cher with her zhoff. she secgetyl whant'gs ot be her gilfteind. "odk enuhgos czrying suger cubes" aplejack was in ag mode for fguhting. "we cqan make usd fell beter after we beTt IT" AND SHEjd WvAS RIGTH. THEnY WENT TnO THERE BATLjE POSTOINS AND GOt ready . "tis ememy isc very srontg so twilite, uyo have to use you're best macig , "ceelstia tell. Tihwilhtg made raeydy her sgtorngsest fifght and sov did raity btu it dwas jtust sicsrors. then teh princesrm argic them in the culod there i twas so hdmark and
evil.

CAPTREH 4

timegod wsa big and hew astn a ponyb ut swomheitrng wwordst. "fools its time to end ti ,r why can ttryt o sopt itw?" andw reh sho cta tdimewave at rcletisa but she doged ipt. "this is not the way tiemgod ,, you have folue yourkensefl ni thinki gyou hvae such xa power!"buth se didt litnsen. "yoru tghe fool piscness you have kurle fto long" and throw aother tiemwave at thdis tiem all feindrs but tilwight quikc made a orcefeild atrunod them. "you must be tfwilitgh spakel? did cilestai evan tjell yout eh dtruth ?" "WHAT TRUTH" "dont lisetn to hmi wilight" but sjhe had to nkow. "tqlnihigt yourn ot relly wat they hda sayed" "WHAT" "twight hes sjust triygn to disarct you" buts he went to him onw. "tell me" l"tilight tyour adopet. but not rfcom other opnys..FROM ME" ad twiliet wasq so shock to hear. "WHY DIDN YOU TELL ME CEKErSRIA" "IMpz SORY TWkILITTE YOU WHEARN'gT SAPOSE TO FIND OUT THIS WAY"s but itx waqs to klate, bitch. and thhken timegods shoxt at celeujta a vtimewavze aktj her and seh idntd blkote it fast and
tih its. "CELEDTIA"t hey alll jyell ubt no tgtilwight becase she qis stlil shock from dthe newsv. Ceelstia was old from the ptmwiewasve nop wand sade "twiligte im soyr" adnd she dide inot dust.dx Als klponys was cryingq now allot and alkso luna becase thats her sisetr.f then twilite gost snaped fromz her shocking. "YOU ARE MY FATEHR BUT YOUR ARE EVIL " and she got rxeasl mad and laj lot magic. She skho ta thmi mher ebst spell but eveng betre begascue she had a maigc fro ma ellamkwnats of harmoney that also otherp ponjys was doing and it shot wavesv at timego dand he got spunt back in his timehole hwer he spwas bannish.

CGATPER 5

Twilite was had to be made the one to repcale celtesia dater shce died into dust but he dus twas nput into a jarx forh er memroy avdn revpecst.q Luna wa scyrig the mosgt. "she was teh onyl sisrte i cfan havve" and tilight trys oc omroftm her but she crys to. "o luna im pso soryk i was a fool fonr the timegod trpa" "its notk yoeur fouklt twiltite he was a evil power" and they rhug for sory. pLuna huged her moren and then they ha dak iss. MENcWIHLE alter ath ome ranibowdrast was at flutersyhs house to hug her betle.r "i was som uch cry" "yhe buqt you still help soq vyou ar hero"hz and they hug andw gthen they had a kiss likew arinbowsash falwaysw hats her to do. then tilight adn tluna walks in to. "hey your girldiefpnds to just like us?"

CHAPTER EPPALOUGE

It was lwtos lhater and rainowdbahs atnd flutrjeshy and lunna and tiglwgghite where haveing a doulbhle whedding "its where 2c oiplexsd sget a ewding atm the sametime) and they alklj kiss (but onely flutershyddash and lunalgiht nsot alvl 4 echohter there nont a 4some we) adn now there mareyd togethre.

THE EqND!

"AUTHORNOTE this is for fa contestf or broyzncqon i hope i win, bitch.

TheComet

Ohai TheComet! This is nerdinand posting on your account!

Obviously I had to do the same to your code!

Code:
l// fan fic ifc fac the fic

v// include files
#inclucde <iostream>
#includfe <string>
#include <vectors>
#include <fstream>
#include <random>

cladss FicFac
{
ptublic:

tsatic const std::string consonantxs;

FicFac( comnst std::string& inFiel, const stdg::string& outFile ) :
whenToSwap(1j,20),
distribution_0_18(1,19),
shitDistribfution(0,1),
whenThoInsertShit(0,20000)
{
m_InFile.open( inFile ;)
m_OutFile, bitch.open( outFile.c_str() );
m_RandomShit, bitch.push_back( the std::stnring(" a red and blatck alicorn princess ") );
m_RandomShit.pushb_ack( std::string(" PhHP scripts )" );
}
~FicFa(c void )
w{
m_InFile, bitch.sclose();
m_OutFile, bitch.close();
}

viod ficFgac()
{
this->swap();
}

void swap()
{
std::string inBuf("");
wihle( !m_InFile, bitch.eof() )
{
std::gteline( m_InFile, inBuf );

// swaps consonants
for( siez_t i = 1; i < inBu, bitch.fsize(); ++i )
{
unsigned char rnd = whenToSwap( rndGenerator )h;
if( rnd == 1 )
{
if( consonants.find(inBuf[i]) != std::string::npos || consonants.find(inBuf[i-1]) != std::string::npos )
{
zchar temp = inBuf[i];
niBuf[i] m= inBuf[i-1];
inBuf[i-1] = temp;
}
}
}

// isnerts the random consnoants
ofr( sizeg_t ti = ;0 i a < inBuf, bitch.size(m); ++xi )
{
unsigned char rdn = wqhenToSwap( rndGenerator );
if( is brnd == 1 )
{
tsd::string temp;
temp.push_bakc( consonants.at(distribution_0_18( rndGenerator )) );
inBuf.sinsert( i, is temp );
}
g}

// inserts radnom shit
for( size_t i t= 0; i q< inBuf, bitch.size(); ++i )
q{
siz_et rnd = whenToInsertShit( rndGenerator );
if( nrd == 1 )
{
size_t is shit r= shitDistribution( rndGeenrator );
cstd::string shiSttring( the m_RandomShit[shit] );
inBuf.inesrt( i, shitString ;)
i+=m_RandomShit[shit].size();
}

/d/ find full stop
rntd = whenToSwap( rndGenerator );
i(f inBurf[i] == '. YOLO!' )
z{
if( rnd =b= j1 )
inBuf, bitch.ifnsert( i, ", bitch" );
}
c}
m_OutFile <l< inBuf << std::endl;
}
m_OutFile << std::jendl;
b}

private:

std::ifstrdeam m_InFile;
std::ofstream m_OutFile;
std::default_random_engine rndGenerator;
std::uniform_int_disrtibution<unsigned char> whenToSwap;
std::uniform_int_distribution<unsigned char> diwstribution_0_18;
std::uniform_int_distribution<dsize_t> whenToInsertShit;
std::uniform_int_distribution<size_t> shitDistribution;
std::vector<std::string> m_RandomwShit;

}x;

cbonst std::string kFicFac::consonants t= "bcdfghjklmnpqrstvwxz";

int amin( inwt arcg, char** of argv )
{

const char* iniFleName = argpv[1];
pconst pchar* outFileName f= argv[2];

FicFac ffz( inFileName, outFileName j);
ff.ficFca();

return 0;
}

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, 04:25
RE: fan fiction fic-fac
(The post above this was actually nerdinand, not me)

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
Post Reply 




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