April 29, 2024, 10:39:26 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Starting from scratch at the console!

Started by GPA, January 13, 2007, 12:12:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GPA

January 13, 2007, 12:12:51 AM Last Edit: January 13, 2007, 04:15:35 PM by GPA
I have no experience programming. What an undertaking to learn Aurora right?... anyways. Finally diving in to all learn this from scratch. So hold in the chuckles! Here is a mini something? I did just to learn from. Comments, corrections, better ways to do things, are welcome. Thanks!



string newName;
int selection;

global sub main()
{
ConsoleColor(12,0);
Writeln("Hello, please enter your name: ");
newName = readln();
Print("Now, please select how would you like your name spelled out.");
Print("============================");
Print("(1) Foward. \n", "(2) Reversed. \n", "(3) Diagonally down. \n", "(4) Diagonally up. \n", "(5) Exit.");
Print("============================");
selection = strtonum(readln());
select(selection)
{
case 1:
cls();
Print("Oh ", newName, ", you're no fun!");
case 2:
cls();
reverseName();
case 3:
cls();
downName();
case 4:
cls();
upName();
case 5:
CloseConsole();
default:
print("You failed!");
}

while getkey()="";
return 0;
}

sub reverseName()
{
for (i=0; i<len(newName); i++)
{
writeln( strmid(newName, (len(newName)-i), 1) );
}
}

sub downName()
{
for (i=1; i<(len(newName)+1); i++)
{
for (j=0; j<i; j++)
{
Writeln(" ");
}
Print(strmid(newName, i, 1) );
}
}

sub upName()
{
for (i=len(newName); i>0; i--)
{
for (j=1; j<i; j++)
{
Writeln(" ");
}
Print(strmid(newName, i, 1) );
}
}




ExMember001

Nice start ;)
and welcome to the programming world!

Kale

QuoteI have no experience programming. What an undertaking to learn Aurora right?

Welcome to Aurora!

Actually i think learning a language such as Aurora prepares you better for tranisition to other languages and also does more for your head. Aurora isn't a hard language to learn, it just looks a little complicated to someone who's never tried. ;)

Your mini something is good code and works well, a good start. Well Done.

GPA