C
C#12mo ago
hustarico

❔ my screen is different than the tutorial

so I wanted to start learningc# to make games,but when i got to making the template of the console code I hade a different screen than the one in the tutorial ,he had a dozen lines laready typed using the template while I had only one,does make any difference and does it mean I can't keep following him because of release difference of something?pls help me I really don't understand (the blue screen is mine,the dark one is the tutorial)
7 Replies
SinFluxx
SinFluxx12mo ago
Top-level statements - C# tutorial
This tutorial shows how you can use top-level statements to experiment and prove concepts while exploring your ideas
SinFluxx
SinFluxx12mo ago
The whole article may be a bit much (?) but essentially it is the same code, just that what's showing on your machine has the "top level statements" removed to reduce clutter, but also can be confusing when you're starting out, as you've discovered! You should be able to just manually add them back in yourself
hustarico
hustarico12mo ago
and if don't add them it's ok?
ero
ero12mo ago
please try to read the links you're provided (starting with the one that literally came with the template you have right there in the screenshot) but yes, you're fine without adding them
hustarico
hustarico12mo ago
ok,thank you so much for your help
Angius
Angius12mo ago
namespace MyApp
{
public class Program
{
public static void Main()
{
Console.WriteLine("Hello World!");
}
}
}
namespace MyApp
{
public class Program
{
public static void Main()
{
Console.WriteLine("Hello World!");
}
}
}
Is the same as
namespace MyApp;

public class Program
{
public static void Main()
{
Console.WriteLine("Hello World!");
}
}
namespace MyApp;

public class Program
{
public static void Main()
{
Console.WriteLine("Hello World!");
}
}
And the same as
Console.WriteLine("Hello World!");
Console.WriteLine("Hello World!");
For the most part, at least
Accord
Accord12mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.