My first four programs.

Discuss and publish sample code and applications written in OrbC (OrbForms Designer or PocketC Architect)

Postby Aux10 on Thu Feb 02, 2006 8:16 pm

Hi I just thought that I would post the source code for my first four programs. I made them using PocketC for palm OS in memo pad. I just started learning PocketC 5 days ago and I just love it! I've tried to learn other languages before but the hardware needed was unfavorable like its required WIndows computer (I'm a MAC user) or had to be done on a desktop. (I prefer laptops over desktops). In just 5 days I've made programs that i've never dreamed of making in my life. The thing I like the most is that I can do programing on something that I can put in my pocket and take where ever I go. I just love it its so fun!
----------------------------------------------------------------------------
//Bad Mood
//Ethan White, 1/30/06

main(){
string name;
clear();
title("Bad Mood");
puts("\t Program Instructions");
puts("\n");
puts("\n");
puts("When asked enter your name, and then press Ok");
puts(" After that just tap the screen to see the next line");
puts("\n");
puts("\n");
puts("\t Tap the screen to continue");
wait();
clear();
name = gets ("What is your name?");
puts("Hi, " + name + "!");
puts("\n");
wait();
puts("Isn't this fun?");
puts("\n");
wait();
puts("What's that you say?");
puts("\n");
wait();
puts("Its not?");
puts("\n");
wait();
puts("Well then I hate you!");
wait();
puts("\n");
puts("I don't like you, " + name + "!");
puts("\n");
wait();
puts("Stop touching me!");
puts("\n");
wait();
alert("GOOD BYE FOR EVER!!!");
exit();
}//end main
----------------------------------------------------------------------------
//Good Mood
//Ethan White 1/31/06

main(){
string name;
clear();
title("Good Mood");
name = gets ("What is your name?");
puts("Hi " + name + "!");
puts("\n");
wait();
puts("Lovely day is it not?");
puts("\n");
wait();
puts("My name is Palm.");
puts("\n");
wait();
puts("" + name + " now thats a nice name you got.");
puts("\n");
wait();
puts("It was nice to meet you " + name + "!");
puts("\n");
wait();
alert("Good bye " + name + "! It was nice meeting you!");
clear();
exit();
}//end main
----------------------------------------------------------------------------
//String Practice
//Ethan White, 2\1\06

main(){
string name;
string number;
string letter;
clear();
title("String Practice");
name = gets("What is your name?");
puts("Hi " + name + "!");
puts("\n");
wait();
number = strlen (name);
puts("Your name has " + (string)number + " letters.");
puts("\n");
wait();
letter = strleft(name, 1);
puts("Your name starts with the letter " + letter + ".");
puts("\n");
wait();
letter = strright(name, 1);
puts("Then it ends with the letter " + letter + ".");
puts("\n");
wait();
letter = strupr(name);
puts("Look I can write it in uppercase. " + letter +".");
wait();
puts("\n");
letter = strlwr(name);
puts("I can even do it in lowercase. " + letter + ".");
wait();
puts("\n");
puts("Bye " + name + "!");
wait();
exit();
}//end main
----------------------------------------------------------------------------
//Case Scrambler
//Ethan White, 2/2/06

main(){
string word;
string letter;
string lcase;
clear();
title("Case Scrambler");
word = gets("Enter a word that has no more than 20 letters.");
puts("Here is your case scrambeled word.");
puts("\n");
letter = substr(word, 0, 1);
lcase = strlwr(letter);
puts("" + lcase + "");
letter = substr(word, 1, 1);
lcase = strupr(letter);
puts("" + lcase + "");
letter = substr(word, 2, 1);
lcase = strlwr(letter);
puts("" + lcase + "");
letter = substr(word, 3, 1);
lcase = strupr(letter);
puts("" + lcase + "");
letter = substr(word, 4, 1);
lcase = strlwr(letter);
puts("" + lcase + "");
letter = substr(word, 5, 1);
lcase = strupr(letter);
puts("" + lcase + "");
letter = substr(word, 6, 1);
lcase = strlwr(letter);
puts("" + lcase + "");
letter = substr(word, 7, 1);
lcase = strupr(letter);
puts("" + lcase + "");
letter = substr(word, 8, 1);
lcase = strlwr(letter);
puts("" + lcase + "");
letter = substr(word, 9, 1);
lcase = strupr(letter);
puts("" + lcase + "");
letter = substr(word, 10, 1);
lcase = strlwr(letter);
puts("" + lcase + "");
letter = substr(word, 11, 1);
lcase = strupr(letter);
puts("" + lcase + "");
letter = substr(word, 12, 1);
lcase = strlwr(letter);
puts("" + lcase + "");
letter = substr(word, 13, 1);
lcase = strupr(letter);
puts("" + lcase + "");
letter = substr(word, 14, 1);
lcase = strlwr(letter);
puts("" + lcase + "");
letter = substr(word, 15, 1);
lcase = strupr(letter);
puts("" + lcase + "");
letter = substr(word, 16, 1);
lcase = strlwr(letter);
puts("" + lcase + "");
letter = substr(word, 17, 1);
lcase = strupr(letter);
puts("" + lcase + "");
letter = substr(word, 18, 1);
lcase = strlwr(letter);
puts("" + lcase + "");
letter = substr(word, 19, 1);
lcase = strupr(letter);
puts("" + lcase + "");
wait();
exit();
}//end main
----------------------------------------------------------------------------
Aux10
 
Posts: 1
Joined: Thu Feb 02, 2006 7:37 pm
Location: USA

Return to OrbC User Samples

Who is online

Users browsing this forum: No registered users and 2 guests

cron