sparks wrote:
I was sort of expecting a tutorial on how to move from scratch to C# here... This is kinda the opposite. Is it not extremely defeatist to tell a load of Scratchers that Scratch is easier than C#? That's why most of them are here...
![]()
Fixed it for you.
Offline
We're putting things very different from what they really are over here! le me just clear it all up a bit:
first of all, you are not talking about C# but C#.NET since you are importing the System.dll and related libraries. That is making it a whole lot easier for you, basic C# is not easy at all (same with VB).
second, Scratch and C# (called C-sharp, btw) are different -- not harder or easier.
C# is a text language, Scratch is visual and uses blocks.
C# has advanced string manipulation, File I/O (well, the .NET framework does), and much better integration with the Windows and Mac system.
Scratch is cross-platform, limited to a single project and has some differences in code structure (but not too many).
third, C# is made to be easier thn C++. both are based on C, an assembly language.notice how they've added two plus signs each time
last, but not least, converting Scratch to C# and other languages and vice versa is dead easy. Let's take some more advanced coding:
into VisualBasic would be:
Sub Main()
If Rnd() = 23 Then
Location = Location + New Point(10, 0)
Else
Dim dumdum As Integer
dumdum = Rnd + 2
whoo()
End Sub
Sub whoo()
Print("I'm tired :S")
End SubIn C#:
int main()
{if (Rnd() = 23) {
Location = Location + 10;} else {
int dumdum;
dumdum = Rnd() + 2;
whoo();}
int whoo() {
cout << "I'm tired :S";
}Offline
markyparky56 wrote:
nxsupert wrote:
markyparky56 wrote:
1200%? No way! Maybe 10 or 20% at the most. It only starts to get confusing when you try using things like XNA.
well in c++ you need to make shore that there are NO errors or you might end up deleting everything on your computer(1 0f 20 bad things that can happen).
What kind of program were you creating?! If you stick to things not involving File I/O then you will never encounter something like that.
@nxsupert
Maybe start with things like getting the hang of using commands such as
Headers, like System and its sub-sections like System.IO etc.
Basic input/output like:Code:
Console.writeline("Hello World!"); Console.read();
boring .
i do simulators , game editors , and A.I .
and it is called fstream in C++
Last edited by nxsupert (2011-01-05 11:11:14)
Offline
Java isn't that hard either once you get the hang of it
System.out.println("Hello World! What's your name?");
String name = new Scanner(System.in).nextLine();
System.out.println("Why hello "+name+"!");Last edited by nerevar (2010-12-31 15:12:22)
Offline
That is very basic. Maybe you should add more blocks or make your own Scratch Like program in C#.
Here's a simple console number guessing game programed in vb.net.
To import it into your project open up a new console application and past this code in it.
a:
System.Console.Write("Original code Copyrighted (c) by what-the. Do not remove this message! " & vbCrLf)
System.Console.Write(vbCrLf & " would you like to play a game? (y,n) ")
If Console.ReadLine = "y" Then
GoTo playagame
Else
GoTo pickrandom
End If
playagame:
System.Console.Write(vbCrLf & "Ok")
System.Threading.Thread.Sleep(100)
System.Console.Write(" I ")
System.Threading.Thread.Sleep(100)
System.Console.Write("will ")
System.Threading.Thread.Sleep(100)
System.Console.Write("think")
System.Threading.Thread.Sleep(100)
System.Console.Write(" of")
System.Threading.Thread.Sleep(100)
System.Console.Write(" a")
System.Threading.Thread.Sleep(100)
System.Console.Write(" number")
System.Threading.Thread.Sleep(100)
System.Console.Write(" between")
System.Threading.Thread.Sleep(100)
System.Console.Write(" 1")
System.Threading.Thread.Sleep(100)
System.Console.Write(" and")
System.Threading.Thread.Sleep(100)
System.Console.Write(" 100")
System.Threading.Thread.Sleep(100)
System.Console.Write(" and")
System.Threading.Thread.Sleep(50)
System.Console.Write(" you")
System.Threading.Thread.Sleep(50)
System.Console.Write(" have")
System.Threading.Thread.Sleep(50)
System.Console.Write(" to")
System.Threading.Thread.Sleep(50)
System.Console.Write(" guess")
System.Threading.Thread.Sleep(50)
System.Console.Write(" it.")
System.Threading.Thread.Sleep(400)
System.Console.Write(vbCrLf & "You will get ten guesses and I will tell you if it's higher or lower.")
System.Threading.Thread.Sleep(400)
startguess:
Dim Value As Integer
Dim trys As Integer
Dim r As New Random(System.DateTime.Now.Millisecond)
trys = 1
Value = r.Next(1, 100)
System.Console.Write(vbCrLf & "I am thinking of a number between 1 and 100. What is it? ")
Dim guess As Integer
Do While trys < 10
Try
guess = Console.ReadLine
Catch
System.Console.Write(vbCrLf & "Please only enter numbers! Starting again.")
GoTo startguess
End Try
If guess = Value Then
System.Console.Write(vbCrLf & "Correct. You guessed the number in " & trys & " guesses")
trys = 10
System.Console.Write(vbCrLf & "Do you want to play again?(y,n) ")
If Console.ReadLine = "y" Then
GoTo startguess
Else
GoTo pickrandom
End If
Else
If guess > Value Then
System.Console.Write(vbCrLf & "Lower ")
Else
System.Console.Write(vbCrLf & "Higher ")
End If
End If
trys = trys + 1
Loop
System.Console.Write(vbCrLf & "I win! Gameover. The number was " & Value & ". Do you want to try again? (y,n) ")
If Console.ReadLine = "y" Then
GoTo startguess
Else
GoTo pickrandom
End If
pickrandom:
My site Offline
Don't forget actionscript! Very easy to learn and free I think if you download a free version thing from adobe (I use Flash CS4). Every advanced scratcher should try AS!
Last edited by Daffy22 (2011-01-03 12:01:48)
Offline
why step into such a terrible language? Just go into python or something less bad.
Offline
I was planing on doing a tutorial to day but my c# editor isn't working.
pleas look at this
http://scratch.mit.edu/forums/viewtopic.php?id=53689
Offline
nxsupert wrote:
songhead95 wrote:
why step into such a terrible language? Just go into python or something less bad.
if you want to be a proper game maker you need to learn c#,c++, Java ext.
depends what you go into, they teach C++ at most universities and colleges. Java and C# are probably quite common aswell.
I'm trying to concentrate on Python at the moment, its actualy really simple.
Offline
I think if that if scratch were to ever go to another language, it should be something like java or python, some language that can be used on EVERY computer. the well-known c# IDE is visual studios, developed by Microsoft, and SOLD--it is not free.
http://scratch.mit.edu/projects/undacovabroda45/1282323Offline
undacovabroda45 wrote:
I think if that if scratch were to ever go to another language, it should be something like java or python, some language that can be used on EVERY computer. the well-known c# IDE is visual studios, developed by Microsoft, and SOLD--it is not free.
that is if you use the pro . it is free here http://www.microsoft.com/express/Windows/
___________________________________________________________________
every one i have found a really good 3d game maker :
http://unity3d.com/
Offline
LS97 wrote:
We're putting things very different from what they really are over here! le me just clear it all up a bit:
first of all, you are not talking about C# but C#.NET since you are importing the System.dll and related libraries. That is making it a whole lot easier for you, basic C# is not easy at all (same with VB).
second, Scratch and C# (called C-sharp, btw) are different -- not harder or easier.
C# is a text language, Scratch is visual and uses blocks.
C# has advanced string manipulation, File I/O (well, the .NET framework does), and much better integration with the Windows and Mac system.
Scratch is cross-platform, limited to a single project and has some differences in code structure (but not too many).
third, C# is made to be easier thn C++. both are based on C, an assembly language.notice how they've added two plus signs each time![]()
last, but not least, converting Scratch to C# and other languages and vice versa is dead easy. Let's take some more advanced coding:
http://i1027.photobucket.com/albums/y33 … ft/cex.gif
into VisualBasic would be:Code:
Sub Main() If Rnd() = 23 Then Location = Location + New Point(10, 0) Else Dim dumdum As Integer dumdum = Rnd + 2 whoo() End Sub Sub whoo() Print("I'm tired :S") End SubIn C#:
Code:
int main() {if (Rnd() = 23) { Location = Location + 10;} else { int dumdum; dumdum = Rnd() + 2; whoo();} int whoo() { cout << "I'm tired :S"; }
int main()
{if (Rnd() = 23) {
Location = Location + 10;} else {
int dumdum;
dumdum = Rnd() + 2;
whoo();}
int whoo() {
cout << "I'm tired :S";
}???????????????????????????????????????????
that is c++
Offline
nxsupert wrote:
Code:
int main() {if (Rnd() = 23) { Location = Location + 10;} else { int dumdum; dumdum = Rnd() + 2; whoo();} int whoo() { cout << "I'm tired :S"; }???????????????????????????????????????????
that is c++
Do you really think there's that much difference between the two?
Tell me what part of that code is not C#
Last edited by LS97 (2011-01-11 11:29:07)
Offline
nxsupert wrote:
undacovabroda45 wrote:
I think if that if scratch were to ever go to another language, it should be something like java or python, some language that can be used on EVERY computer. the well-known c# IDE is visual studios, developed by Microsoft, and SOLD--it is not free.
that is if you use the pro . it is free here http://www.microsoft.com/express/Windows/
If you're interested in having the Professional version (I believe it's about £500) for free, and legal, I'm sure Microsoft wouldn't mind me sharing their site wit anyone interested: http://www.dreamspark.com/.
It's actually their site! If you're a student and can prove it, you've got it! Besides, you get loads of additional software free too.
It worked with me
Offline
LS97 wrote:
nxsupert wrote:
Code:
int main() {if (Rnd() = 23) { Location = Location + 10;} else { int dumdum; dumdum = Rnd() + 2; whoo();} int whoo() { cout << "I'm tired :S"; }???????????????????????????????????????????
that is c++Do you really think there's that much difference between the two?
Tell me what part of that code is not C#
all of it
Offline
nxsupert wrote:
LS97 wrote:
nxsupert wrote:
Code:
int main() {if (Rnd() = 23) { Location = Location + 10;} else { int dumdum; dumdum = Rnd() + 2; whoo();} int whoo() { cout << "I'm tired :S"; }???????????????????????????????????????????
that is c++Do you really think there's that much difference between the two?
Tell me what part of that code is not C#all of it
Don't be stupid. Tell me what you do not consider C#!
Offline
LS97 wrote:
nxsupert wrote:
LS97 wrote:
Do you really think there's that much difference between the two?
Tell me what part of that code is not C#all of it
Don't be stupid. Tell me what you do not consider C#!
ok
int dumdum
dumdum = Rnd() + 2;
whoo()
are c#
Offline
nxsupert wrote:
LS97 wrote:
nxsupert wrote:
all of itDon't be stupid. Tell me what you do not consider C#!
ok
int dumdum
dumdum = Rnd() + 2;
whoo()
are c#
And what about the int main() {} ? what's that got that you consder non-c#?
Offline
LS97 wrote:
nxsupert wrote:
LS97 wrote:
Don't be stupid. Tell me what you do not consider C#!ok
int dumdum
dumdum = Rnd() + 2;
whoo()
are c#And what about the int main() {} ? what's that got that you consder non-c#?
int main() {} ??????
i have never seen that before in c#.(i cant check at the moment . my computer is has gust had its recovery program , blue screens were showing when i did a download)
Offline
If anyone wants to proper games like on websites you need flash. (I think there is something called 'flux' by adobe which is free, I use Fl CS4
)
_____________
nxsupert, that is C#
Offline
nxsupert wrote:
LS97 wrote:
nxsupert wrote:
ok
int dumdum
dumdum = Rnd() + 2;
whoo()
are c#And what about the int main() {} ? what's that got that you consder non-c#?
int main() {} ??????
i have never seen that before in c#.(i cant check at the moment . my computer is has gust had its recovery program , blue screens were showing when i did a download)
You probably remember some like
void button1_click(Object sender, EventArgs e)
{
code here;
}which is exactly the same principle. Except that one is (generally) automatically done by your IDE and I've used lines breaks for it. But line breaks do not matter in C#..
Offline
Daffy22 wrote:
If anyone wants to proper games like on websites you need flash. (I think there is something called 'flux' by adobe which is free, I use Fl CS4
)
You might be talking about adobe flex
http://scratch.mit.edu/projects/undacovabroda45/1282323Offline