Ranking
Dayum, at some point I wanted to get intro programming to make a Prototype roguelike.
Of course you don't learn programming in one day so I ragequit.
Centuries Of Damn
Ok, so in MonoDevelop, how would you save your C# as an executable? So, for example, how would you save your 'Hello World' program? Like compiling it and all. I have no idea when it comes to this, so I'm confused.
-----------------------------------------------------------------------------
Yay I managed to make this:
Scripted chat code:
using System;
class InteractiveChat
{
public static void Main()
{
string myInput;
int myInt;
Console.Write("What is your name?: ");
Console.Write("Hello, {0}! How old are you? Type it in here: ", Console.ReadLine());
Console.Write("Cool, you're {0} years old! ", Console.ReadLine());
Console.Write("Why are you here? Do tell me: ");
Console.Write(" '{0}'? Interesting I guess. ", Console.ReadLine());
Console.Write("What do you think is the meaning to life?: ");
Console.Write(" '{0}' eh? Well I wouldn't know, I'm just a script. ", Console.ReadLine());
Console.WriteLine("What verb/phrase would best describe what you are going to do once this script finishes?: ");
Console.Write("Well I would {0} if I could, but I'm stuck inside this command line", Console.ReadLine());
Console.WriteLine("Do you think I'm interesting? Write either 1 for yes or 2 for no: ");
myInput = Console.ReadLine();
myInt = Int32.Parse(myInput);
if (myInt > 1)
{
Console.WriteLine("Well I'm sad you don't think I'm interesting... I'll go now. Bye...", myInt);
}
else
{
Console.WriteLine("Thanks! I would think you're interesting, but I'm a script, and can't think!");
Console.WriteLine("So where are you working, or taking classes? What's the name of the company or school?: ");
Console.WriteLine("I think I've heard of {0} before. Sounds interesting. Do you like it there? ",Console.ReadLine());
Console.WriteLine("Well I think I'd feel the same way if I went there each day, and if I had human feelings.",Console.ReadLine());
Console.WriteLine("What do you do in your free time?: ");
Console.WriteLine("Personally, I really want to try and {0} sometime, but I'm stuck in this command line",Console.ReadLine());
}
}
}


Also, classes are just lines of code which you can use in another one by referring to it right? And if I did something wrong/unnecessary in the code, please tell me. Also, how can I make it so that someone can answer by typing in 'yes' or 'no' instead of a number? Integers can't be words, so how would you go about doing that?
Last edited by kaddon; Oct 7, 2011 at 03:14 PM. Reason: Updating code
Proud member of Pandora
C# code:
if (String.Compare(myInput, "no", true) == 0)

Third parameter is for "do I ignore the cases of the strings?". The function returns 0 if the strings are equal.

Classes are essentially a feature of the OO paradigm -- basically, your program is made up of a bunch of "Objects" which each have methods and properties of their own, keeping the global namespace clean. Each class defines a "type" of object.
For example, System.Console is an object and you've used two of its methods (WriteLine and Write) in your above code.

Personally I've tried Python, Ruby, Pascal, Basic, C++, Java and Assembly.
Of those languages I would probably recommend C++ since it's relatively easy to learn and is very widely used in the entire software industry. Java can be slightly easier to learn, but also has a lot of limitations and isn't nearly as powerful.
I have a friend who mostly uses C# and according to him it's a lot like C++ but is an evolved version of it. So I'd guess that C# is a bit harder but is more powerful than C++. C#, if I'm not mistaken, was developed by Microsoft, and probably works better with Windows than any other OS.
Pascal and Basic aren't really used much any more since they're both very old and outdated. They are both very simple.
Ruby and Python aren't used much for actual programming, they are more common as scripting languages. But they can be quite easy to learn.
Don't even bother with Assembly, as it is used to program microcontrollers and microprocessors, and has pretty much no use in the software industry.

Java's strongest point is that it's very portable. The same isn't true of most nontrivial C++ applications. C++ is perhaps easier to learn than C, but C is much more interesting in my opinion. C# is essentially Java++ with .NET (and yes, made by Microsoft).
Since when was scripting not regarded as programming? Ruby, Perl, Lua, Haskell and Python are the languages I'd point to first for a programming beginner. They're very simple to learn but still powerful enough to get most of what you want done done.
ASM is still used enough to be worth learning IMO.


</mytwocents> (IT'S OK PEOPLE I KNOW HIM (as well as you can know anyone after ~20 minutes chatting) AND I KNOW VIRTUE VERY WELL so I hope you don't mind me posting this. If you do, sorry!)
))<>((
Thank you for that very good post, legsol.
Didn't really think of it before, but scripting is indeed very good for beginners.
And I forgot to say that a very good thing about Java is that it is cross-platform between Mac, Windows and Linux.
crazylars: Nope, I'm just dumb
I miss you Foxfaeg, I will never forget you <3
legsol ,since you came here to help it's okay.

I am currently looking for some interesting things to do in either java or c++, like some challenges in order to make me actually do somethig. If you have any ideas, you could post them here and I will try to make them. If i succeed I will also post the sourcecode so other people can learn from it(hopefully).
Proud member of [Pandora]
c++ and c# are your best choices.

Easy mode: Python

Why would you do that mode: Java

No no no, just no mode: Everything else
Have you ever licked Nutella off of a penis?
[SIGPIC][/SIGPIC]
I love you, MocroGunz.
Opinion time again:

I'm thinking it might not actually be smart to go the C# route on a Mac now after reading more about frameworks and such. What are your opinions on Objective-C? And Objective-C=Cocoa? I'm confused on that. And because it's sort of a Mac only thing, do you guys think I should virtualize Windows via BootCamp and continue on with C# or something? I dunno at this point… D:
Proud member of Pandora