http://www.mediafire.com/file/18ffycra1lclsos/Greentext_Mad_Lib.exe
Can I post short programs here in technology?
Share short programs thread?
Preferably if C++, i'm learning that.
The program i'm posting is based on that trendy Mad Libs type of story that sells hot-fire to kids and adults. (Yes, they had 50 shades of grey for fucking adults)
>>59942728
Post source or gtfo. I ain't clickin' dat shit.
>>59943301
Here's some code, to tell you it's legit. You gonna post any C++ or just be a cry-baby who can't use an anti-virus to scan exe?
>>59943634
> posts screenshot to prove legitness
>>59942728
Sounds legit thanks for the .exe ;)
>>59943671
http://www.mediafire.com/file/xsemk44fe5catdx/GreenTextSilliness.cpp
Here ya go pussy cats.
>>59943820
To be fair, you should be sharing source only, rather than distributing binaries. No one has any reason to trust a random .exe.
>>59943820
Use something like hastebin.com or gist.github.com lad
>>59942728
>uses c++
>uses c style strings
>>59943820
Mirrored: https://hastebin.com/wanopagoho.cpp
>>59943925
>Overlooks the fact i'm learning C++, not
yet have developed all the functionalities, i' m still learning.
I know that's used to simulate string with arrays in C, but i'm still learning.
Why did I create this goddamn thread? I know it would end up derailling.
This serves me as experience.
>>59944109
desu you repeat yourself a lot in the code. many of the phrases are repeated. you could try using something like a text string with the contents and replacing the values on the string with the input, also try loading the story from a txt file.
your indentation is kinda messy too.
>>59944109
You should be grateful for criticism. If you can't stand being told that your work is shit, you shouldn't be programming, and you shouldn't be posting on 4chan for that matter. Eventually you will reach the zen moment where you realize that everything is shit, and you will not be so bothered by these sorts of comments.
>>59944303
I appreciate critcism, but no one posted any programs, and that was the point of creating this thread.
>>59944244
Er, mind posting source file or screenshot to enlighten me?
You mean putting the string files in a structure?
>>59942728
>Share short programs thread?
Here is a very short program: https://my.mixtape.moe/jppvaj.bat
do you really need to use cout for every single sentence? java does not have this problem.
>>59944957
You don't, but otherwise it will end up being messy.
You can add a "\" at the end instead of the "
to extend towards the next line, I only used it in this case so the story can be read neatly in the command window.
>>59944848
What's your problem? I downloaded the batch file, but it did nothing visibly helpful, infact when I tried to close it, it would freeze. Not to mention windows entered some sort of compatability black version on the desktop.
Maybe it did have other function, but the batch ran horribly on my PC for unknown reasons but I doubt it.
>>59944617
all the code inside your if blocks should be a level of indentation higher. select it and press tab
eg.if (cond) {
code;
}
about the strings, i mean like, write a few text files like this
"Hi, I'm |NAME| and I'm |AGE| years old"
load its contents with c++ (IIRC it's on std::iostream) and replace |NAME| with the name, |AGE| with the age, etc
i wouldn't be surprised if c++ doesn't have a string replacement function though. if it doesn't, disregard this.
also, >>59944957. you don't need to cout everywhere. you know, if you do it like this:cout << "text\n"
"next line text\n"; // this works
cout << "text\n"
<< "next line text\n"; // this works too, if you like it more
cout<<">"<<idol<<" is love, "<<idol<<" is life\n";}
>;}
really nigger
>>59945122
>I downloaded the batch file, but it did nothing visibly helpful, infact when I tried to close it, it would freeze.
Wow. You are either very young or RPing pretty convincingly. I'll explain.
FYI, what I posted was a famous fork bomb for Windows. https://stackoverflow.com/questions/13436408/what-is-00-and-how-does-it-work. I never thought you'd run it. I still doubt you have, but just in case, take it as a very low-cost lesson in how you should not run code from 4chan unless you fully understand it. It could have been ransomware.
>>59945141
I can see now that the indent is used to make the blocks of code look cleaner, and how you taught cout doesn't have to be used multiple times, thanks Mr.Animu Anon!
However, you lost me at strings, don't you have to declare the char with the char arrays first? Don't I need to put <cstring> header too?
>>59945424
dude just read a programming book. c++ is for cucks use java instead unless ur making gaymes
>>59945229
I heard about term double attack, and buffer-overflows, but I never thought it could be used in an .exe.
I thought it would usually be done against servers through hacking or insecure programming.
>>59945457
>I never thought it could be used in an .exe.
You should seriously read some sysadmin-type book about how Windows works.
>>59945435
>Gaymes
I'm only learning it to use Unreal Engine later on, you caught me.
>>59945480
Do I really?
If anything I learned today in /g/, it is to never post .exe files and only post sources, vice-versa.
I'm not gonna dedicate to learn all that jargon.
>>59945218
>Before I leave this thread to learn some C++
Yes.
>>59945424
first, stop using char arrays. read up on std::string.
the idea is, have a few text files in the same folder as the program/code, name them something meaningful. as this program seems to differ its output based solely on the gender variable, it would be wise to name the files the possible values for gender.
some pseudocode for what i mean is:string fileContents = read(gender + ".txt");
fileContents.replaceAll("|IDOL|", idol); // here idol is the variable the user inputted, and |IDOL| is what will be replaced
// repeat this for all user input variables
cout << fileContents;
And a example file, "male.female.txt" would be: "oh, |IDOL|, i love you!". with this approach every appearance of |IDOL| in the text file would be replaced by what the user inputted, and then shown on the screen.
as i said, i wouldn't be surprised if c++ doesn't have this "replaceAll" method, if it doesn't this approach would probably be harder and (maybe) longer than the one you're currently using.
>>59945745
It doesn't have have the "replaceAll" method.
Writing up every variable with [ ] if it did work sounds much more complicated.
Thanks for the previous help, but this seems too convoluted for what's needed to finish the job.