C ProgrammingDiscussion
Simple as beefsteak


Sponsor
didknotMay 26, 2007 10:19am
hello, sorry i couldnt find a subject title,
but i will be brief. im studying with unix so on a windows computer i dont know where the c compilator is,But this isnt the problem really if someone could juste tel me if the program i made works in a good way i would be very helped !thanks

This is the code im talking about

PS: the #include nananinana didn t work and i wondr why.^_^

ThePornAmbitionMay 26, 2007 1:19pm
nananinana... is this some sort of joke? **EDIT** Ok, I think I understand the nananinana now. You don't know why the include statement did not appear on your blog?

Use Tag Blaster to address your code blogging needs! Simply highlight your code and then click on the 'Tag Blaster' bookmarklet and then submit your blog post! It's as simple as beefsteak.


**EDIT**

I put the code into Dev-C++, formatted it to make it easier for me to read. Dev-C++ tells me that the char phZ[] & char cdm[] arrays need sizes. I am new to programming. The reason I am working with this is for the practice. I can't guarantee an answer but I am sure that there is someone around that can!

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


int main(){

int x = getchar(), y = 0, z, u = 0, v, w;
char iflttr( char tab[] );
char ifmrs();
char thenletter();
char thenmorse( char tab[] );
char phZ[];
char cdm[];

printf("Please type the all text, then only type enter\nThis is where you start\n=>");

if (( x!='\0' ) && ( x!='\n' )){
while( x != '\n' ){
x = getchar();
u++;
}

char phZ[ u ];

for( v = 0; v <= u; v++ ){
x = getchar(); phZ[ v ] = x;
}

char iflttr( phZ[ u ] ){
for( v = 0; v <= u; v++ ){
switch( phZ[ v ] ){
case a||A : phZ[ v ] = 2 ; break;
case b||B : phZ[ v ] = 4 ; break;
case c||C : phZ[ v ] = 4 ; break;
case d||D : phZ[ v ] = 3 ; break;
case e||E : phZ[ v ] = 1 ; break;
case f||F : phZ[ v ] = 4 ; break;
case g||G : phZ[ v ] = 3 ; break;
case h||H : phZ[ v ] = 4 ; break;
case i||I : phZ[ v ] = 2 ; break;
case j||J : phZ[ v ] = 4 ; break;
case k||K : phZ[ v ] = 3 ; break;
case l||L : phZ[ v ] = 4 ; break;
case m||M : phZ[ v ] = 2 ; break;
case n||N : phZ[ v ] = 2 ; break;
case o||O : phZ[ v ] = 3 ; break;
case p||P : phZ[ v ] = 4 ; break;
case q||Q : phZ[ v ] = 4 ; break;
case r||R : phZ[ v ] = 3 ; break;
case s||S : phZ[ v ] = 3 ; break;
case t||T : phZ[ v ] = 1 ; break;
case u||U : phZ[ v ] = 3 ; break;
case v||V : phZ[ v ] = 4 ; break;
case w||W : phZ[ v ] = 3 ; break;
case x||X : phZ[ v ] = 4 ; break;
case y||Y : phZ[ v ] = 4 ; break;
case z||Z : phZ[ v ] = 4 ; break;
default: phZ[ v ] = 6 ; break;
}
}
}

for( v = 0; v <= u; v++ ){
if( phZ[ v ] != 6 ){
y = y + phZ[ v ];
}

else{ y = y+1; }
}
}

char cdm[ y ];
char thenmorse( cdm[] ){
w = 0;
for( v = 0; v <= u; v++ ){
switch( phZ[ v ] ){
case a||A : cdm[ w ] = '.'; cdm[w+1] = '-' ; w = w+2; break;
case b||B : cdm[ w ] = '-'; cdm[w+1] = '.' ; cdm[ w+2 ] = '.' ; cdm[ w+3 ] = '.' ; w = w+4; break;
case c||C : cdm[ w ] = '-'; cdm[w+1] = '.' ; cdm[ w+2 ] = '-' ; cdm[ w+3 ] = '.' ; w = w+4; break;
case d||D : cdm[ w ] = '-'; cdm[w+1] = '.' ; cdm[ w+2 ] = '.' ; w = w+3; break;
case e||E : cdm[ w ] = '.'; break;
case f||F : cdm[ w ] = '.'; cdm[w+1] = '.' ; cdm[ w+2 ] = '-' ; cdm[ w+3 ] = '.' ; w = w+4; break;
case g||G : cdm[ w ] = '-'; cdm[w+1] = '-' ; cdm[ w+2 ] = '.' ; break;
case h||H : cdm[ w ] = '.'; cdm[w+1] = '.' ; cdm[ w+2 ] = '.' ; cdm[ w+3 ] = '.' ; w = w+4; break;
case i||I : cdm[ w ] = '.'; cdm[w+1] = '.' ; w = w+2; break;
case j||J : cdm[ w ] = '.'; cdm[w+1] = '-' ; cdm[ w+2 ] = '-' ; cdm[ w+3 ] = '-' ; w = w+4; break;
case k||K : cdm[ w ] = '-'; cdm[w+1] = '.' ; cdm[ w+2 ] = '-' ; w = w+3; w = w+4; break;
case l||L : cdm[ w ] = '.'; cdm[w+1] = '-' ; cdm[ w+2 ] = '.' ; cdm[ w+3 ] = '.' ; w = w+4; break;
case m||M : cdm[ w ] = '-'; cdm[w+1] = '-' ; w = w+2; break;
case n||N : cdm[ w ] = '-'; cdm[w+1] = '.' ; w = w+2; break;
case o||O : cdm[ w ] = '-'; cdm[w+1] = '-' ; cdm[ w+2 ] = '-' ; w = w+3; break;
case p||P : cdm[ w ] = '.'; cdm[w+1] = '-' ; cdm[ w+2 ] = '-' ; cdm[ w+3 ] = '.' ; w = w+4; break;
case q||Q : cdm[ w ] = '-'; cdm[w+1] = '-' ; cdm[ w+2 ] = '.' ; cdm[ w+3 ] = '-' ; w = w+4; break;
case r||R : cdm[ w ] = '.'; cdm[w+1] = '-' ; cdm[ w+2 ] = '.' ; w = w+3; break;
case s||S : cdm[ w ] = '.'; cdm[w+1] = '.' ; cdm[ w+2 ] = '.' ; w = w+3; break;
case t||T : cdm[ w ] = '-'; break;
case u||U : cdm[ w ] = '.'; cdm[w+1] = '.' ; cdm[ w+2 ] = '-' ; w = w+3; break;
case v||V : cdm[ w ] = '.'; cdm[w+1] = '.' ; cdm[ w+2 ] = '.' ; cdm[ w+3 ] = '-' ; w = w+4; break;
case w||W : cdm[ w ] = '.'; cdm[w+1] = '-' ; cdm[ w+2 ] = '-' ; w = w+3; break;
case x||X : cdm[ w ] = '-'; cdm[w+1] = '.' ; cdm[ w+2 ] = '.' ; cdm[ w+3 ] = '-' ; w = w+4; break;
case y||Y : cdm[ w ] = '-'; cdm[w+1] = '.' ; cdm[ w+2 ] = '-' ; cdm[ w+3 ] = '-' ; w = w+4; break;
case z||Z : cdm[ w ] = '-'; cdm[w+1] = '-' ; cdm[ w+2 ] = '.' ; cdm[ w+3 ] = '.' ; w = w+4 = '.' ; break;
default: cdm[ w ] = 0; w = w+1; break;
}
}
}

for( z = 0; z <= y; z++ ){
printf( "%c, cdm[z]" );
}

system( "PAUSE" );
return 0;
}


Sponsor
didknotMay 28, 2007 2:01pm
hi pronambition,
i would gladly follow the thread we started but a poor talker ^_^.
also 1 on 1 doesn t scare me editing on forum was a big new thing for me.
my programme was made so to work with . and thanks a lot i wasn t shure i they wouldn t have been no c compiler on windows... my point was that computer looses a lot of its marvellous attractin/mystery when you cut down so drastically what you able to input.
i thinks they should be a lot more of programming on such a wilde spread thing as windows


Simple as beefsteak

You need to Sign-up for StumbleUpon to post to this forum