Anoop

17 April 09 - Ganeshan
Well done.

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

hi guys….. i have modified the file which ganeshan had given and done a small changes , the file which i made changes are as follows

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("Lets move the robot guys");
Console.WriteLine("");
while (true)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("");
Console.Write("Enter W to go forward, D to turn right, A to turn left, Z to go backwards, S to stop");
Console.WriteLine("");
Console.ForegroundColor = ConsoleColor.Yellow;
string x = Console.ReadLine();
if (x == "w")
{
Console.WriteLine("");
Console.WriteLine("Robot going forward");
}
if (x == "d")
{
Console.WriteLine("");
Console.WriteLine("Robot turning right");
}
if (x == "a")
{
Console.WriteLine("");
Console.WriteLine("Robot turning left");
}
if (x== "z")
{
Console.WriteLine("");
Console.WriteLine("Robot going backwards");
}

if (x == "s")
{
Console.WriteLine("");
Console.WriteLine("Robot tired - stopping.");
break;
}
}

Console.WriteLine("");
Console.WriteLine("Bye, Bye");
Console.WriteLine("");
Console.WriteLine("Press a key to shutdown…");
Console.Read();
Cosmos.Sys.Deboot.ShutDown();
}
}
}

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