Greggie Posted June 27, 2013 Share Posted June 27, 2013 --- Link to comment Share on other sites More sharing options...
Wildbill Posted June 28, 2013 Share Posted June 28, 2013 ----- ---- Link to comment Share on other sites More sharing options...
sledjunk Posted June 28, 2013 Share Posted June 28, 2013 --- O Link to comment Share on other sites More sharing options...
sledjunk Posted June 28, 2013 Share Posted June 28, 2013 ----- ---- 0 __ Link to comment Share on other sites More sharing options...
Mossy Posted June 28, 2013 Share Posted June 28, 2013 O______ Link to comment Share on other sites More sharing options...
sledjunk Posted June 28, 2013 Share Posted June 28, 2013 No. WB's ----- is a zero. I don't think ---- is valid. .-- .... -.-- .- .-. . .-- . - .- .-.. -.- .. -. --. .. -. -- --- -.- ... . -.-. --- -. . ..--.. why are we talking in morse code ? Link to comment Share on other sites More sharing options...
Lep Posted June 28, 2013 Share Posted June 28, 2013 test...not this again.....test Link to comment Share on other sites More sharing options...
white dragon Posted June 29, 2013 Share Posted June 29, 2013 No. WB's ----- is a zero. I don't think ---- is valid. .-- .... -.-- .- .-. . .-- . - .- .-.. -.- .. -. --. .. -. -- --- -.- ... . -.-. --- -. . ..--.. why are we talking in morse code ? lol...you know all the tricks....so why the morse code ±@£¢¤¬¦² Link to comment Share on other sites More sharing options...
slomo Posted June 29, 2013 Share Posted June 29, 2013 Having trouble following the above posts? If your Morse Code is a bit rusty, just copy, paste and execute the following C code into a .c or .cpp compiler: //////////////////////////////////////////////////////// Handy program to translate //// text to morse code and emit the //// sound through the PC speaker. //// Copy and paste to your C compiler //////////////////////////////////////////////////////// //libraries/header files for functions//un rem next line if using microsoft compiler//#include "stdafx.h" //microsoft compiler header //the next are standard 'c' libraries#include <stdio.h>#include <conio.h>#include <windows.h>#include <string.h>#include <stdlib.h> int main(void){ void BeepP(int freq , int duration);//beep speaker function void welcome(void);//welcome function void Translate(void);//translate function int finished,invalid = 1;//loop end variables char again, name[30];//resart program? and users name variables system("TITLE Morse Code Translator"); printf("\nPlease Enter Your Name and then ENTER to continue: "); fflush(stdin); scanf("%[^\n]",name); do//do loop1 { welcome();//call welcome function do//do loop2 { printf("\n\nWould you like to Start Again?"); printf("\n Y for yes, N for no....: "); fflush(stdin); scanf("%c",&again); if((again=='Y')||(again=='y')) { system("cls"); finished = 0;//leave first loop invalid = 0;//leave second loop } else if((again=='N')||(again=='n'))///they want to leave { finished = 1;//leave first loop invalid = 0;//leave second loop } else // { printf("\nInvalid Selection"); printf("\nPress any key to continue"); system("cls"); invalid = 1; getch(); } }while(invalid!=0);//end loop 1 }while(finished!=1);//end do loop 2 printf("\n\nThank you %s, have a nice day!\n",name);//end messaage return 0;}//end main void BeepP(int freq , int duration)//beep function{ Beep(freq,duration);//beep the Freq at duration return;} void welcome(void)//welcome function{ void Translate(void);//declare function calling void surprise(void);//declare function calling int invalid;//loop variables char selection;//chaoice variable do//start loop { //welcome message and menu system("cls"); printf("\nWelcome to Morse Translator 1.0"); printf("\nPlease Select from the Following Menu - "); printf("\n\n\nEnter 1, 2, or 3 then press ENTER to continue: " ); printf("\n\n1.Translate a phrase\n2.Surprise\n3.Exit\n\n"); fflush(stdin); scanf("%c",&selection);//scan entry if(selection=='1')//valid entry { system("cls"); Translate();//call translate } else if(selection=='2')//valid entry { system("cls"); surprise();//call surprise } else if(selection=='3')//valid entry { system("cls"); invalid = 0;//leave loop } else //soemthing invalid loop around { printf("\nInvalid Selection"); printf("\nPress any key to continue"); system("cls"); invalid = 1;//stay in loop } }while(invalid!=0);//end loop return; } void Translate(void)//translate function{ int a;//loop variable int Length_Text;//length of text variable char Code_Character[100],Text_Character;//character variables //ask for string printf("\nPlease enter a phrase to translate (No punctuation characters):"); //ask for string fflush(stdin); scanf("%[^\n]",Code_Character);//store printf("\n"); strlwr(Code_Character);//convert to lower case Length_Text = strlen(Code_Character);//get length for(a=0;a<Length_Text;a++)//for loop for translating { Text_Character = Code_Character[a]; Sleep(400);//sleep pauses system for variable miliseconds printf(" "); switch(Text_Character)//switch for each character { case 'a'://if 'a' BeepP(800,100);//beep short printf(".");//print dot Sleep(100);//sleep BeepP(800,300);//beep long printf("-");//print hyphen break;//leave case case 'b': BeepP(800,300); printf("-"); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); break; case 'c': BeepP(800,300); Sleep(100); BeepP(800,100); Sleep(100); BeepP(800,300); Sleep(100); BeepP(800,100); break; case 'd': BeepP(800,300); Sleep(100); BeepP(800,100); Sleep(100); BeepP(800,100); break; case 'e': BeepP(800,100); printf("."); break; case 'f': BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,100); printf("."); break; case 'g': BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,100); printf("."); Sleep(100); break; case 'h': BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); break; case 'i': BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); break; case 'j': BeepP(800,100); printf("."); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); break; case 'k': BeepP(800,300); printf("-"); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,300); printf("-"); break; case 'l': BeepP(800,100); printf("."); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); break; case 'm': BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); break; case 'n': BeepP(800,300); printf("-"); Sleep(100); BeepP(800,100); printf("."); break; case 'o': BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); break; case 'p': BeepP(800,100); printf("."); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,100); printf("."); break; case 'q': BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,300); printf("-"); break; case 'r': BeepP(800,100); printf("."); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,100); printf("."); break; case 's': BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); break; case 't': BeepP(800,300); printf("-"); break; case 'u': BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,300); printf("-"); break; case 'v': BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,300); printf("-"); break; case 'w': BeepP(800,100); printf("."); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); break; case 'x': BeepP(800,300); printf("-"); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,300); printf("-"); break; case 'y': BeepP(800,300); printf("-"); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); break; case 'z': BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); break; case '1': BeepP(800,100); printf("."); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); break; case '2': BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); break; case '3': BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); break; case '4': BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,300); printf("-"); break; case '5': BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); break; case '6': BeepP(800,300); printf("-"); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); break; case '7': BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); break; case '8': BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,100); printf("."); Sleep(100); BeepP(800,100); printf("."); break; case '9': BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,100); printf("."); break; case '0': BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); Sleep(100); BeepP(800,300); printf("-"); break; }//end switch }//end translating "for loop" printf("\n\nPress any key to continue."); getch(); return; } void surprise(void)//surprise function{ BeepP(329,150); Sleep(100); BeepP(329,150); Sleep(100); BeepP(329,300); Sleep(100); BeepP(329,150); Sleep(100); BeepP(329,150); Sleep(100); BeepP(329,300); Sleep(100); BeepP(329,150); Sleep(100); BeepP(392,150); Sleep(100); BeepP(261,150); Sleep(100); BeepP(293,150); Sleep(100); BeepP(329,600); Sleep(100); BeepP(349,150); Sleep(100); BeepP(349,150); Sleep(100); BeepP(349,150); Sleep(100); BeepP(349,150); Sleep(100); BeepP(349,150); Sleep(100); BeepP(329,150); Sleep(100); BeepP(329,150); Sleep(100); BeepP(329,150); Sleep(100); BeepP(392,150); Sleep(100); BeepP(392,150); Sleep(100); BeepP(350,150); Sleep(100); BeepP(293,150); Sleep(100); BeepP(261,600); Sleep(100); return;} Link to comment Share on other sites More sharing options...
sledjunk Posted June 29, 2013 Share Posted June 29, 2013 :lmao: Link to comment Share on other sites More sharing options...
white dragon Posted June 29, 2013 Share Posted June 29, 2013 lol...thx for clearing that up slomo...u r a problem solver Link to comment Share on other sites More sharing options...
slomo Posted July 4, 2013 Share Posted July 4, 2013 lol...thx for clearing that up slomo...u r a problem solver PM me with an email address if you want to see how it works ! - can't attach the .exe version here. Link to comment Share on other sites More sharing options...
Turbo Doo Posted July 5, 2013 Share Posted July 5, 2013 lol...thx for clearing that up slomo...u r a problem solver X2 on that one.. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.