October 2010
- Me: So, here's what I have, I have a linked list. How do I change this logic to an array of blahblahblah
- Teacher: Well it's easy, blahblahblahblahblah
- Me: Wait, I don't understand, can you explain what is stored here?
- Teacher: It's a pointer and blahblahblahblah
- Me: WUT
- Teacher: itz okay to be confused
- Me: Oh, no, I get it now, thank you very much
- Teacher: Feel free to ask anytime, man
- *I walk away*
- Me: Yeah, I understand now: I ain't fuckin doin this program.
#include <iostream>
#include <fstream>
#include <bitset>
using namespace std;
void getCharacters(char charSuccess[27])
{
ifstream fin;
fin.open(“Success.txt”);
char fileChar;
int fileCharacterCount = 0;
while (fin.get(fileChar))
{
charSuccess[fileCharacterCount] = fileChar;
fileCharacterCount++;
}
fin.close();
}
void getASCII(char charSuccess[27], int asciiSuccess[27])
{
for (int i=0; i < 28; i++)
{
asciiSuccess[i] = int(charSuccess[i]);
}
}
void getBinary(char charSuccess[27], char binarySuccess[8][100])
{
int check;
for(int j = 0; j < 28; j++)
{
for(int i = 7;i>=0;i—)
{
check = 1 « i;
if ((charSuccess[j] & check)==0)
{
binarySuccess[i][j] = ‘0’;
}
else
{
binarySuccess[i][j] = ‘1’;
}
}
}
}
void getMessage (int asciiSuccess[27], char Print[27])
{
for (int i=0; i < 28; i++)
{
Print[i] = static_cast<int>(asciiSuccess[i]);
}
}
void getMemory (char binarySuccess[8][100], bool Memory[8][100])
{
for (int j = 0; j < 28; j++)
{
for (int i = 7; i >= 0; i—)
{
if (binarySuccess[i][j] == ‘0’) Memory[i][j] = false;
if (binarySuccess[i][j] == ‘1’) Memory[i][j] = true;
}
}
}
void printOutMessage (char Print[27])
{
for (int i = 0; i < 28; i++)
{
cout « Print[i];
}
}
void printOutMemory (bool Memory[8][100])
{
for(int j = 0; j < 28; j++)
{
for(int i = 7;i>=0;i—)
{
if (Memory[i][j] == false) cout « ‘0’;
if (Memory[i][j] == true) cout « ‘1’;
}
cout « endl;
}
}
int main ()
{
cout « endl;
char charSuccess[27];
int asciiSuccess[27];
char binarySuccess[8][100];
bool Memory[8][100];
char Print[27];
// Reads each character from the file “Success.txt”; stores to the charSuccess array
getCharacters(charSuccess);
// Stores the ASCII value of each character from charSuccess array to the asciiSuccess array
getASCII(charSuccess,asciiSuccess);
// Verifies stored characters; converts asciiSuccess array back to characters in the character Print array
getMessage(asciiSuccess,Print);
// Converts each stored character in charSuccess to its binary value, stored in binarySuccess[8][100]
getBinary(Print,binarySuccess);
// Converts each 0 and 1, from binarySuccess, to a boolean value, stored in Memory[8][100]
getMemory(binarySuccess, Memory);
// Prints out the Memory
printOutMemory(Memory);
cout « endl;
// Prints out the stored message from memory
printOutMessage(Print);
cout « endl;
return 0;
}
- Diagas: well itz
- Diagas: my fuqqin
- Diagas: birthday
- Diagas: in 5 hours
- Diagas: wtf
- Majora65: OMGGGG
- Diagas: i ned to
- Diagas: spend my
- Diagas: last hours
- Diagas: as a teenager
- Diagas: dying to
- Diagas: 12 year olds
- Diagas: my fellow
- Diagas: teens
- Majora65: K!
- Majora65: LOL!
bool whoIsIt (string person)
{
bool results = false;
if (person == “youknowhoyouare”) results = true;
return results;
}
int main ()
{
string person = “youknowhoyouare”;
if ((whoIsIt(person))) cout « “FUCK YOUUUUUUUUUU”;
return 0;
}