Goutham

17 April 09 - Ganeshan
Well done.

Install to USB and keep adding to and improving the code.

Hello guys..
I modified the source code of the program which was placed in BB. I have replaced the condition part of the program with switch case but I haven't checked wehther its working or not beacuse I dont have VB installed in my system.

Regards
Goutham.

16/04/2009

Hello Guys..
This the source code I have modified which is working now.

using System;
using Cosmos.Compiler.Builder;
namespace CosmosBoot
{
class Program
{
#region Cosmos Builder logic
// Most users wont touch this. This will call the Cosmos Build tool
[STAThread]
static void Main(string[] args)
{
BuildUI.Run();
}
#endregion

// Main entry point of the kernel
public static void Init()
{
var xBoot = new Cosmos.Sys.Boot();
xBoot.Execute();
Console.Clear();
Console.WriteLine("");
Console.WriteLine("Let us control Goutham's robot using switch case");
Console.WriteLine("");
while (true)
{
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("");
Console.Write("Enter 1 to go forward, 2 to turn right, 3 to turn left, 0 to stop");
Console.WriteLine("");
Console.ForegroundColor = ConsoleColor.White;
short x = short.Parse(Console.ReadLine());
switch (x)
{
case 1:
Console.WriteLine("");
Console.WriteLine("Robor going forward");
break;
case 2:
Console.WriteLine("");
Console.WriteLine("Robor turning right");
break;
case 3:
Console.WriteLine("");
Console.WriteLine("Robor turning left");
break;
case 0:
Console.WriteLine("");
Console.WriteLine("Robor tired ——stopping");
break;

}

}
Console.WriteLine("");
Console.WriteLine("Bye, Bye");
Console.WriteLine("");
Console.WriteLine("Press a key to shutdown…");
Console.Read();
----------------****-----------------—-

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License