Skip to content

Commit

Permalink
g3
Browse files Browse the repository at this point in the history
  • Loading branch information
czhower committed Jul 25, 2017
1 parent 4fb8e18 commit 1797706
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 59 deletions.
4 changes: 0 additions & 4 deletions Demos/GuessG3/GuessKernelGen3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,4 @@
<None Remove="*.Cosmos" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\source\Cosmos.System\Cosmos.System.csproj" />
</ItemGroup>

</Project>
57 changes: 5 additions & 52 deletions Demos/GuessG3/Kernel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,18 @@
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
//using Cosmos.Debug.Kernel;
using Sys = Cosmos.System;

/*
* Beware Demo Kernels are not recompiled when its dependencies changes!
* To force recompilation right click on on the Cosmos icon of the demo solution and do "Build".
*/
namespace Guess
{
public class GuessOS : Sys.Kernel
{
protected int mCount = 0;
namespace Guess {
public class GuessOS : Sys.Kernel {

protected int mMagicNo = 22;

public GuessOS()
{
// Didnt check if tickcount is working yet.. can change this later
//var xRandom = new Random(234243534);
//mMagicNo = xRandom.Next(1, 100);
}

protected override void BeforeRun()
{
//Cosmos.Core.HMI.Init();
Console.Clear();

Console.WriteLine("Guess Demo");
Console.WriteLine("Please guess a number from 1 to 100.");
}

protected override void Run()
{
mCount++;

//mDebugger.Send("");
//mDebugger.SendMessage("Kernel", "New iteration");
Console.WriteLine();
Console.WriteLine("Guess #" + mCount);
Console.Write("Please enter a guess: ");
string xInputStr = Console.ReadLine();
Console.Write("Input length: ");
Console.WriteLine(xInputStr.Length.ToString());
int xGuess = int.Parse(xInputStr);
Console.WriteLine("Your guess was " + xGuess);
if (xGuess < mMagicNo)
{
Console.WriteLine("Too low.");
}
else if (xGuess > mMagicNo)
{
Console.WriteLine("Too high.");
}
else
{
Console.WriteLine("You guessed it!");
Console.WriteLine("Press any key to end Guess Demo. Thanks for playing!");
Console.ReadKey();
Stop();
protected override void Run() {
Console.WriteLine("Booted Kernel Gen3");
while (true) {
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions source/Cosmos.Build.MSBuild/Cosmos.targets
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
<Reference Remove="System.Core" />
</ItemGroup>
<ItemGroup Condition="$(UseGen3Kernel) == 'True'">
<Reference Include="Cosmos.Core_Asm, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" />
<Reference Include="Cosmos.Core_Plugs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" />
<Reference Include="Cosmos.System_Plugs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" />
<Reference Remove="System.Core" />
</ItemGroup>

Expand Down

0 comments on commit 1797706

Please sign in to comment.