Update mono debug; even though it doesn't work
This commit is contained in:
parent
5b88837919
commit
cd3b5f5baa
5 changed files with 61 additions and 17 deletions
|
|
@ -2,11 +2,36 @@
|
|||
|
||||
namespace csharp
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello World!");
|
||||
}
|
||||
class Program
|
||||
{
|
||||
string toaster = "Making round of toast";
|
||||
static int max_bread = 100;
|
||||
int bread = max_bread;
|
||||
|
||||
void PrintToast( int r ) {
|
||||
int this_round = ( max_bread - bread - r);
|
||||
Console.WriteLine( this.toaster + ": " + this_round );
|
||||
}
|
||||
|
||||
void MakeToast( int rounds ) {
|
||||
if (this.bread - rounds < 0) {
|
||||
throw new Exception( "No moar bread!" );
|
||||
}
|
||||
|
||||
this.bread -= rounds;
|
||||
for (int r = 0; r < rounds; ++r) {
|
||||
this.PrintToast( r );
|
||||
}
|
||||
|
||||
Console.WriteLine( "Got only " + this.bread + " left" );
|
||||
}
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Program p = new Program();
|
||||
for (int x = 1; x < 10; ++ x) {
|
||||
p.MakeToast( x );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue