Skip to content

Commit

Permalink
Restore guess demo.
Browse files Browse the repository at this point in the history
  • Loading branch information
mterwoord committed Jul 5, 2015
1 parent 5fca0ec commit 8e2a89a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 47 deletions.
28 changes: 14 additions & 14 deletions Demos/Guess/Guess.Cosmos
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
<OutputPath>bin\Debug\</OutputPath>
<Framework>MicrosoftNET</Framework>
<UseInternalAssembler>False</UseInternalAssembler>
<EnableGDB>False</EnableGDB>
<DebugMode>IL</DebugMode>
<EnableGDB>True</EnableGDB>
<DebugMode>Source</DebugMode>
<TraceMode>User</TraceMode>
<BuildTarget>PXE</BuildTarget>
<VMWareFlavor>Player</VMWareFlavor>
<StartCosmosGDB>False</StartCosmosGDB>
<StartCosmosGDB>True</StartCosmosGDB>
<VMwareEdition>Workstation</VMwareEdition>
<VMwareDeploy>ISO</VMwareDeploy>
<IgnoreDebugStubAttribute>False</IgnoreDebugStubAttribute>
Expand Down Expand Up @@ -60,15 +60,15 @@
<VMware_Deployment>ISO</VMware_Deployment>
<VMware_Launch>VMware</VMware_Launch>
<VMware_DebugEnabled>True</VMware_DebugEnabled>
<VMware_DebugMode>IL</VMware_DebugMode>
<VMware_DebugMode>Source</VMware_DebugMode>
<VMware_IgnoreDebugStubAttribute>False</VMware_IgnoreDebugStubAttribute>
<VMware_VMwareEdition>Workstation</VMware_VMwareEdition>
<VMware_OutputPath>bin\Debug\</VMware_OutputPath>
<VMware_Framework>MicrosoftNET</VMware_Framework>
<VMware_UseInternalAssembler>False</VMware_UseInternalAssembler>
<VMware_TraceAssemblies>All</VMware_TraceAssemblies>
<VMware_EnableGDB>False</VMware_EnableGDB>
<VMware_StartCosmosGDB>False</VMware_StartCosmosGDB>
<VMware_EnableGDB>True</VMware_EnableGDB>
<VMware_StartCosmosGDB>True</VMware_StartCosmosGDB>
<ISO_Deployment>ISO</ISO_Deployment>
<ISO_Launch>None</ISO_Launch>
<ISO_DebugEnabled>False</ISO_DebugEnabled>
Expand Down Expand Up @@ -138,7 +138,7 @@
<Bochs_ShowLaunchConsole>False</Bochs_ShowLaunchConsole>
<Bochs_DebugEnabled>True</Bochs_DebugEnabled>
<Bochs_StackCorruptionDetectionEnabled>True</Bochs_StackCorruptionDetectionEnabled>
<Bochs_DebugMode>Source</Bochs_DebugMode>
<Bochs_DebugMode>IL</Bochs_DebugMode>
<Bochs_IgnoreDebugStubAttribute>False</Bochs_IgnoreDebugStubAttribute>
<Bochs_VisualStudioDebugPort>Pipe: Cosmos\Serial</Bochs_VisualStudioDebugPort>
<Bochs_PxeInterface>192.168.43.1</Bochs_PxeInterface>
Expand Down Expand Up @@ -186,12 +186,12 @@
<OutputPath>bin\Debug\</OutputPath>
<Framework>MicrosoftNET</Framework>
<UseInternalAssembler>False</UseInternalAssembler>
<EnableGDB>False</EnableGDB>
<DebugMode>IL</DebugMode>
<EnableGDB>True</EnableGDB>
<DebugMode>Source</DebugMode>
<TraceMode>User</TraceMode>
<BuildTarget>PXE</BuildTarget>
<VMWareFlavor>Player</VMWareFlavor>
<StartCosmosGDB>False</StartCosmosGDB>
<StartCosmosGDB>True</StartCosmosGDB>
<VMwareEdition>Workstation</VMwareEdition>
<VMwareDeploy>ISO</VMwareDeploy>
<IgnoreDebugStubAttribute>False</IgnoreDebugStubAttribute>
Expand Down Expand Up @@ -226,15 +226,15 @@
<VMware_Deployment>ISO</VMware_Deployment>
<VMware_Launch>VMware</VMware_Launch>
<VMware_DebugEnabled>True</VMware_DebugEnabled>
<VMware_DebugMode>IL</VMware_DebugMode>
<VMware_DebugMode>Source</VMware_DebugMode>
<VMware_IgnoreDebugStubAttribute>False</VMware_IgnoreDebugStubAttribute>
<VMware_VMwareEdition>Workstation</VMware_VMwareEdition>
<VMware_OutputPath>bin\Debug\</VMware_OutputPath>
<VMware_Framework>MicrosoftNET</VMware_Framework>
<VMware_UseInternalAssembler>False</VMware_UseInternalAssembler>
<VMware_TraceAssemblies>All</VMware_TraceAssemblies>
<VMware_EnableGDB>False</VMware_EnableGDB>
<VMware_StartCosmosGDB>False</VMware_StartCosmosGDB>
<VMware_EnableGDB>True</VMware_EnableGDB>
<VMware_StartCosmosGDB>True</VMware_StartCosmosGDB>
<ISO_Deployment>ISO</ISO_Deployment>
<ISO_Launch>None</ISO_Launch>
<ISO_DebugEnabled>False</ISO_DebugEnabled>
Expand Down Expand Up @@ -310,7 +310,7 @@
<Bochs_ShowLaunchConsole>False</Bochs_ShowLaunchConsole>
<Bochs_DebugEnabled>True</Bochs_DebugEnabled>
<Bochs_StackCorruptionDetectionEnabled>True</Bochs_StackCorruptionDetectionEnabled>
<Bochs_DebugMode>Source</Bochs_DebugMode>
<Bochs_DebugMode>IL</Bochs_DebugMode>
<Bochs_IgnoreDebugStubAttribute>False</Bochs_IgnoreDebugStubAttribute>
<Bochs_VisualStudioDebugPort>Pipe: Cosmos\Serial</Bochs_VisualStudioDebugPort>
<Bochs_PxeInterface>192.168.43.1</Bochs_PxeInterface>
Expand Down
55 changes: 22 additions & 33 deletions Demos/Guess/GuessOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,39 +45,28 @@ protected override void Run()
{
mCount++;

var xListClasses = new List<KVPClass>();
var xListStructs = new List<KVPStruct>();

xListClasses.Add(new KVPClass { Key = 1, Value = 2 });
xListClasses.Add(new KVPClass { Key = 2, Value = 5 });

var xListItem= xListClasses[0];
Console.Write("Classes0. Key = ");
Console.Write(xListItem.Key);
Console.Write("Value = ");
Console.WriteLine(xListItem.Value);
xListItem = xListClasses[1];
Console.Write("Classes1. Key = ");
Console.Write(xListItem.Key);
Console.Write("Value = ");
Console.WriteLine(xListItem.Value);

xListStructs.Add(new KVPStruct { Key = 1, Value = 2 });
xListStructs.Add(new KVPStruct { Key = 2, Value = 5 });

var xStructItem = xListStructs[0];
Console.Write("Item0. Key = ");
Console.Write(xStructItem.Key);
Console.Write("Value = ");
Console.WriteLine(xStructItem.Value);
xStructItem = xListStructs[1];
Console.Write("Item1. Key = ");
Console.Write(xStructItem.Key);
Console.Write("Value = ");
Console.WriteLine(xStructItem.Value);


Stop();
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!");
Stop();
}
}
}
}

0 comments on commit 8e2a89a

Please sign in to comment.