The Student Room Group

Scroll to see replies

Original post by Jack22031994
Im good thanks - you?



I'm good :smile: I was so hungry and craving a kebab so I just went and bought one :smile: So delicious! :smile:
Reply 61
Original post by natninja
Purely for randomness sake

#include <stdio.h>
#include <stdlib.h>
#include <time.h>


double random_number ()
{




double random;
random=rand()/(double)RAND_MAX;


return (random);
}


int XOR (int a, int b)
{
int c;


if (a==b)
c=0;
else
c=1;


return (c);
}




int main()
{


time_t* l;


srand(time(l));


int mssg_length;
printf ("input the number of characters then hit return:\n");
scanf ("%d", &mssg_length);


printf("now type your message:\n");


char mssg[mssg_length];
int b;
for (b=0; b<=mssg_length; b++)
{
scanf("%c", &mssg);
}


char a;
int c,d,e;
int n=0;
int binary_mssg[(mssg_length-1)*8];


for(b=1; b<=mssg_length; b++)
{
a=mssg;
for (c = 7; c >= 0; c--)
{
d = a >> c;


if (d & 1)
e=1;
else
e=0;
binary_mssg[(8*n)+(8-c)]=e;
}
n++;
}


int key[(mssg_length-1)*8];
int f,g;


printf("here is the key");
for (f=0; f<=(mssg_length-1)*8; f++)
{
g=random_number()*10;
if (g%2==0)
key[f]=0;
else
key[f]=1;
printf("%d",key[f]);
}


printf("\nhere is the encrypted message");
int encrypted[(mssg_length-1)*8];


for(f=0; f<=(mssg_length-1)*8; f++)
{
encrypted[f]=XOR(binary_mssg[f],key[f]);
printf ("%d", encrypted[f]);
}


FILE *fout;


if ((fout = fopen("my little pony.txt", "w")) == NULL) /*just because it's mildly amusing*/
{
printf("Cannot open %s\n", "my little pony.txt");
exit(EXIT_FAILURE);
}
int h;


for(h=1; h<=(mssg_length-1)*8; h++)
{
fprintf(fout,"%d%d", encrypted[h], key[h]);
}
fclose(fout);


exit(EXIT_SUCCESS);
}


... - --- .--. / .--. --- ... - .. -. --. / .-- . .. .-. -.. / -.-. --- -.. . / ... - ..- ..-. ..-. .-.-.- / .. / .-- .. .-.. .-.. / -- .- -.- . / -- -.-- / --- .-- -. / -.-. --- -.. . / ..- .--. / .-- .... .. -.-. .... / -.-- --- ..- / .-- .. .-.. .-.. / -. --- - / -... . / .- -... .-.. . / - --- / .-- --- .-. -.- / --- ..- - / .- -. -.. / - .... . -. / .. / .-- .. .-.. .-.. / -.-. --- -. ..-. ..- ... . / -.-- --- ..- / .- -. -.. / .. / .-- .. .-.. .-.. / -- .- -.- . / .- -. / . ...- .. .-.. / .-.. .- ..- --. .... / .- -. -.. / -.-- --- ..- / .-- .. .-.. .-.. / -... . / .- -... .-.. . / - --- / .... . .- .-. / .. - / .- .-.. .-.. / - .... . / .-- .- -.-- / ..-. .-. --- -- / .-- .... . .-. . / -.-- --- ..- / .-.. .. ...- . .-.-.- / .- -. -.. / -.-- --- ..- / .-- .. .-.. .-.. / -.- -. --- .-- / .. / .... .- ...- . / .-- --- -. .-.-.-
Original post by sneha.vag
How did you know the lips were my own? :holmes:
Actually, all the comments were nice and by nice I mean they were hilarious! :h:

Posted from TSR Mobile


I saw you post it once. :tongue: I didn't post much but I always read each post, haha.

Original post by Stevo F
Awww thanks babes :hugs:

Spoiler



You're welcome. :hugs:

Spoiler

Original post by ViolinGirl
I'm good :smile: I was so hungry and craving a kebab so I just went and bought one :smile: So delicious! :smile:


Thats good and im jealous
Im hungry but cant do that - may just have some toast
Reply 64
Original post by ViolinGirl
I'm good :smile: I was so hungry and craving a kebab so I just went and bought one :smile: So delicious! :smile:


Kebabs are nice, too bad they completely ruin my digestive system for a few days after eating one though :frown:
Original post by ViolinGirl
I had a bit of a break for a while. Mainly stuck in the religion forum. But I'm back now the thread is all new and shiny! Oooooh so shiny! :smile: how is everyone?


Posted from TSR Mobile


Somehow the idea of a new and shiny thread excites me. Just being my random self.
I'm good. How are you?


Posted from TSR Mobile
Reply 66
Original post by Tilly-Elizabeth
x


Ok Guys Time To Come Clean And Clear The Air Of All Rumors


The all situation between me and Tizzie Lizzie being the next TSRcouple is false.

However having said that i will admit that Tizzie does have a crush on me and i her, but for many reasons (mainly location and uni) we are not taking it any further.

I'm not annoyed at any of you, just thought it'd be nice to clear the air so that people can stop saying things in their heads

Again Just Clearing The Air


Why thank you. :biggrin:

Original post by Jack22031994
Hello!! :smile: Youare - the new version has just been made :smile:

Welcome and how are you?


Woo, I saw, thought I'd jump in early :ninja: merci, I'm alright thanks how are you doing?

Original post by Spontogical
Welcome :h:


Thank you! :redface:
Original post by ViolinGirl
Haha. The no lifers bit is hilarious!


Oh thanks. :fan: :tongue:
Also this was a very good OP holbz, best in the fred's history I think. You're still no queen, but you're definitely 'decent' now :ahee:
Reply 70
Original post by sneha.vag
Somehow the idea of a new and shiny thread excites me. Just being my random self.
I'm good. How are you?


Posted from TSR Mobile


It does me too :smile:
Reply 71
Original post by Tilly-Elizabeth
... - --- .--. / .--. --- ... - .. -. --. / .-- . .. .-. -.. / -.-. --- -.. . / ... - ..- ..-. ..-. .-.-.- / .. / .-- .. .-.. .-.. / -- .- -.- . / -- -.-- / --- .-- -. / -.-. --- -.. . / ..- .--. / .-- .... .. -.-. .... / -.-- --- ..- / .-- .. .-.. .-.. / -. --- - / -... . / .- -... .-.. . / - --- / .-- --- .-. -.- / --- ..- - / .- -. -.. / - .... . -. / .. / .-- .. .-.. .-.. / -.-. --- -. ..-. ..- ... . / -.-- --- ..- / .- -. -.. / .. / .-- .. .-.. .-.. / -- .- -.- . / .- -. / . ...- .. .-.. / .-.. .- ..- --. .... / .- -. -.. / -.-- --- ..- / .-- .. .-.. .-.. / -... . / .- -... .-.. . / - --- / .... . .- .-. / .. - / .- .-.. .-.. / - .... . / .-- .- -.-- / ..-. .-. --- -- / .-- .... . .-. . / -.-- --- ..- / .-.. .. ...- . .-.-.- / .- -. -.. / -.-- --- ..- / .-- .. .-.. .-.. / -.- -. --- .-- / .. / .... .- ...- . / .-- --- -. .-.-.-


'STOP POSTING WEIRD CODE STUFF. I WILL MAKE MY OWN CODE UP WHICH YOU WILL NOT BE ABLE TO WORK OUT AND THEN I WILL CONFUSE YOU AND I WILL MAKE AN EVIL LAUGH AND YOU WILL BE ABLE TO HEAR IT ALL THE WAY FROM WHERE YOU LIVE. AND YOU WILL KNOW I HAVE WON.'

I am fluent in webdings.
Original post by hollieeilloh



Woo, I saw, thought I'd jump in early :ninja: merci, I'm alright thanks how are you doing?




Im doing good thanks - Hungry though
Reply 73
Original post by Spontogical
Also this was a very good OP holbz, best in the fred's history I think. You're still no queen, but you're definitely 'decent' now :ahee:



Ooh prepare for the negging to begin
Original post by Jack22031994
I'm hungry - suggestions?


Congratulations! :smile:
A slice of cheese? They are yummy and quite filling.


Posted from TSR Mobile
Reply 75
So all you lonely hearts heres a little number the chef cooked up for you *puts on Barry White-its ecstasy when you lay next to me*
Reply 76
Original post by natninja
'STOP POSTING WEIRD CODE STUFF. I WILL MAKE MY OWN CODE UP WHICH YOU WILL NOT BE ABLE TO WORK OUT AND THEN I WILL CONFUSE YOU AND I WILL MAKE AN EVIL LAUGH AND YOU WILL BE ABLE TO HEAR IT ALL THE WAY FROM WHERE YOU LIVE. AND YOU WILL KNOW I HAVE WON.'

I am fluent in webdings.


It will be a proper code. I'm making it now!
Reply 77
Original post by Spontogical
Also this was a very good OP holbz, best in the fred's history I think. You're still no queen, but you're definitely 'decent' now :ahee:


welcome to getting negged :tongue:
Original post by Tcrumpen


Ok Guys Time To Come Clean And Clear The Air Of All Rumors


The all situation between me and Tizzie Lizzie being the next TSRcouple is false.

However having said that i will admit that Tizzie does have a crush on me and i her, but for many reasons (mainly location and uni) we are not taking it any further.

I'm not annoyed at any of you, just thought it'd be nice to clear the air so that people can stop saying things in their heads

Again Just Clearing The Air


OK - Ill stop
Reply 79
Original post by hollieeilloh
Why thank you. :biggrin:



Woo, I saw, thought I'd jump in early :ninja: merci, I'm alright thanks how are you doing?



Thank you! :redface:


Oh, hello :smile: how are you?

Spoiler

Latest